tests: add ifdown variant of the bonded bridge test

This commit is contained in:
Ariadne Conill 2020-07-24 04:54:13 -06:00
parent 8714dab11d
commit 37394310ea
2 changed files with 20 additions and 1 deletions

4
tests/fixtures/bonded-bridge.ifstate vendored Normal file
View file

@ -0,0 +1,4 @@
eth0=eth0
eth1=eth1
bond0=bond0
br0=br0

View file

@ -10,7 +10,8 @@ tests_init \
static_ipv6 \
inet_dhcp \
alias_eth0_home \
alias_eth0_work
alias_eth0_work \
bonded_bridge
noargs_body() {
atf_check -s exit:1 -e ignore ifdown -S/dev/null
@ -76,3 +77,17 @@ alias_eth0_work_body() {
ifdown -S $FIXTURES/alias-work.ifstate \
-i $FIXTURES/alias-home-work.interfaces -n wlan0
}
bonded_bridge_body() {
atf_check -s exit:0 -e ignore \
-o match:'ip link set down dev eth0' \
-o match:'ip link set down dev eth1' \
-o match:'ip link set down dev bond0' \
-o match:'ip link set down dev br0' \
-o match:'del 203.0.113.2/24 dev br0' \
-o match:'del 2001:db8:1000:2::2/64 dev br0' \
-o match:'default via 203.0.113.1' \
-o match:'default via 2001:db8:1000:2::1' \
ifdown -S $FIXTURES/bonded-bridge.ifstate \
-i $FIXTURES/bonded-bridge.interfaces -n br0
}