Merge pull request #27 from ifupdown-ng/feature/link-mtu
link: support `mtu` parameter (like debian)
This commit is contained in:
commit
a2a532c8ba
2 changed files with 12 additions and 2 deletions
|
@ -1,5 +1,9 @@
|
|||
#!/bin/sh
|
||||
[ -z "$VERBOSE" ] || set -x
|
||||
OPTIONS=""
|
||||
case "$PHASE" in
|
||||
up|down) ${MOCK} ip link set $PHASE dev $IFACE ;;
|
||||
up|down)
|
||||
[ -n "$IF_MTU" ] && OPTIONS="$OPTIONS mtu $IF_MTU"
|
||||
${MOCK} ip link set $PHASE dev $IFACE $OPTIONS
|
||||
;;
|
||||
esac
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
. $(atf_get_srcdir)/../test_env.sh
|
||||
EXECUTOR="$(atf_get_srcdir)/../../executor-scripts/linux/link"
|
||||
|
||||
tests_init up down
|
||||
tests_init up down mtu
|
||||
|
||||
up_body() {
|
||||
export IFACE=lo PHASE=up MOCK=echo
|
||||
|
@ -16,3 +16,9 @@ down_body() {
|
|||
atf_check -s exit:0 -o match:'ip link set down dev lo' \
|
||||
${EXECUTOR}
|
||||
}
|
||||
|
||||
mtu_body() {
|
||||
export IFACE=eth0 PHASE=up MOCK=echo IF_MTU=1492
|
||||
atf_check -s exit:0 -o match:'ip link set up dev eth0 mtu 1492' \
|
||||
${EXECUTOR}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue