link executor tests: test vlan dependency learning

This commit is contained in:
Ariadne Conill 2020-08-24 03:01:38 -06:00
parent badcccaa5b
commit 8e7c935cdf
2 changed files with 19 additions and 2 deletions

View file

@ -56,6 +56,8 @@ up|down)
fi
;;
depend)
if is_vlan; then
echo "$IF_VLAN_RAW_DEVICE"
fi
;;
esac

View file

@ -10,7 +10,9 @@ tests_init \
vlan_explicit_up \
vlan_explicit_down \
vlan_guessed_up \
vlan_guessed_down
vlan_guessed_down \
vlan_explicit_depend \
vlan_guessed_depend
up_body() {
export IFACE=lo PHASE=up MOCK=echo
@ -55,3 +57,16 @@ vlan_guessed_down_body() {
atf_check -s exit:0 -o match:'ip link delete link eth0 name eth0.8 type vlan id 8' \
${EXECUTOR}
}
vlan_explicit_depend_body() {
export IFACE=servers PHASE=up MOCK=echo \
IF_VLAN_RAW_DEVICE="eth0" IF_VLAN_ID="123"
atf_check -s exit:0 -o match:'eth0' \
${EXECUTOR}
}
vlan_guessed_depend_body() {
export IFACE=eth0.8 PHASE=depend
atf_check -s exit:0 -o match:'eth0' \
${EXECUTOR}
}