From 37394310eadfa108ce3e6e008dfe54ec08702def Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 24 Jul 2020 04:54:13 -0600 Subject: [PATCH] tests: add ifdown variant of the bonded bridge test --- tests/fixtures/bonded-bridge.ifstate | 4 ++++ tests/ifdown_test | 17 ++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 tests/fixtures/bonded-bridge.ifstate diff --git a/tests/fixtures/bonded-bridge.ifstate b/tests/fixtures/bonded-bridge.ifstate new file mode 100644 index 0000000..6320c87 --- /dev/null +++ b/tests/fixtures/bonded-bridge.ifstate @@ -0,0 +1,4 @@ +eth0=eth0 +eth1=eth1 +bond0=bond0 +br0=br0 diff --git a/tests/ifdown_test b/tests/ifdown_test index 8288f85..55f29ce 100755 --- a/tests/ifdown_test +++ b/tests/ifdown_test @@ -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 +}