Merge pull request #44 from ifupdown-ng/feature/link-hwaddress

link executor: add support for hwaddress option
This commit is contained in:
Ariadne Conill 2020-08-26 03:36:06 -06:00 committed by GitHub
commit d21d83fb26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -6,6 +6,7 @@ set -e
IF_LINK_OPTIONS="$IF_LINK_OPTIONS" IF_LINK_OPTIONS="$IF_LINK_OPTIONS"
[ -n "$IF_MTU" ] && IF_LINK_OPTIONS="$IF_LINK_OPTIONS mtu $IF_MTU" [ -n "$IF_MTU" ] && IF_LINK_OPTIONS="$IF_LINK_OPTIONS mtu $IF_MTU"
[ -n "$IF_HWADDRESS" ] && IF_LINK_OPTIONS="$IF_LINK_OPTIONS address $IF_HWADDRESS"
is_vlan() { is_vlan() {
case "$IFACE" in case "$IFACE" in

View file

@ -7,6 +7,7 @@ tests_init \
up \ up \
down \ down \
mtu \ mtu \
hwaddress \
vlan_explicit_up \ vlan_explicit_up \
vlan_explicit_down \ vlan_explicit_down \
vlan_guessed_up \ vlan_guessed_up \
@ -32,6 +33,12 @@ mtu_body() {
${EXECUTOR} ${EXECUTOR}
} }
hwaddress_body() {
export IFACE=eth0 PHASE=up MOCK=echo IF_HWADDRESS=12:34:56:78:90:ab
atf_check -s exit:0 -o match:'ip link set up dev eth0 address 12:34:56:78:90:ab' \
${EXECUTOR}
}
vlan_explicit_up_body() { vlan_explicit_up_body() {
export IFACE=servers PHASE=up MOCK=echo \ export IFACE=servers PHASE=up MOCK=echo \
IF_VLAN_RAW_DEVICE="eth0" IF_VLAN_ID="123" IF_VLAN_RAW_DEVICE="eth0" IF_VLAN_ID="123"