From 8bc39aea7cc70b524fc7aad641a82787b0b7607f Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 24 Jul 2020 04:00:24 -0600 Subject: [PATCH] tests: add ifup test for bonded-bridge relationships --- tests/fixtures/bonded-bridge.interfaces | 16 ++++++++++++++++ tests/ifup_test | 16 +++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 tests/fixtures/bonded-bridge.interfaces diff --git a/tests/fixtures/bonded-bridge.interfaces b/tests/fixtures/bonded-bridge.interfaces new file mode 100644 index 0000000..3e3bff4 --- /dev/null +++ b/tests/fixtures/bonded-bridge.interfaces @@ -0,0 +1,16 @@ +iface bond0 + use bond + + requires eth0 eth1 + bond-mode 802.3ad + bond-xmit-hash-policy layer2+3 + +auto br0 +iface br0 + use bridge + + requires bond0 + address 203.0.113.2/24 + address 2001:db8:1000:2::2/64 + gateway 203.0.113.1 + gateway 2001:db8:1000:2::1 diff --git a/tests/ifup_test b/tests/ifup_test index 60c1f2f..ed4e187 100755 --- a/tests/ifup_test +++ b/tests/ifup_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 ifup -S/dev/null @@ -74,3 +75,16 @@ alias_eth0_work_body() { -o match:'default via 2001:db8:1000:2::1' \ ifup -S/dev/null -i $FIXTURES/alias-home-work.interfaces -n wlan0=work } + +bonded_bridge_body() { + atf_check -s exit:0 -e ignore \ + -o match:'ip link set up dev eth0' \ + -o match:'ip link set up dev eth1' \ + -o match:'ip link set up dev bond0' \ + -o match:'ip link set up dev br0' \ + -o match:'add 203.0.113.2/24 dev br0' \ + -o match:'add 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' \ + ifup -S/dev/null -i $FIXTURES/bonded-bridge.interfaces -n br0 +}