From cd8fbb64fb8373840b9da452cb022e9ece96d268 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Sat, 25 Jul 2020 02:50:24 -0600 Subject: [PATCH] tests: use mock executors --- tests/ifdown_test | 20 ++++++++++---------- tests/ifup_test | 20 ++++++++++---------- tests/test_env.sh | 1 + 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/tests/ifdown_test b/tests/ifdown_test index 0104361..c7283d5 100755 --- a/tests/ifdown_test +++ b/tests/ifdown_test @@ -33,7 +33,7 @@ dual_stack_body() { -o match:'del 2001:db8:1000:2::2/64 dev eth0' \ -o match:'default via 203.0.113.1' \ -o match:'default via 2001:db8:1000:2::1' \ - ifdown -S/dev/null -i $FIXTURES/static-eth0.interfaces -n -a + ifdown -S/dev/null -E $EXECUTORS -i $FIXTURES/static-eth0.interfaces -n -a } static_ipv4_body() { @@ -42,7 +42,7 @@ static_ipv4_body() { -o match:'ip link set down dev eth0' \ -o match:'del 203.0.113.2/24 dev eth0' \ -o match:'default via 203.0.113.1' \ - ifdown -S/dev/null -i $FIXTURES/static-eth0-v4.interfaces -n -a + ifdown -S/dev/null -E $EXECUTORS -i $FIXTURES/static-eth0-v4.interfaces -n -a } static_ipv4_netmask_body() { @@ -51,7 +51,7 @@ static_ipv4_netmask_body() { -o match:'ip link set down dev eth0' \ -o match:'del 203.0.113.2/29 dev eth0' \ -o match:'default via 203.0.113.1' \ - ifdown -S/dev/null -i $FIXTURES/static-eth0-v4-netmask.interfaces -n -a + ifdown -S/dev/null -E $EXECUTORS -i $FIXTURES/static-eth0-v4-netmask.interfaces -n -a } static_ipv6_body() { @@ -60,7 +60,7 @@ static_ipv6_body() { -o match:'ip link set down dev eth0' \ -o match:'del 2001:db8:1000:2::2/64 dev eth0' \ -o match:'default via 2001:db8:1000:2::1' \ - ifdown -S/dev/null -i $FIXTURES/static-eth0-v6.interfaces -n -a + ifdown -S/dev/null -E $EXECUTORS -i $FIXTURES/static-eth0-v6.interfaces -n -a } static_ipv6_netmask_body() { @@ -69,7 +69,7 @@ static_ipv6_netmask_body() { -o match:'ip link set down dev eth0' \ -o match:'del 2001:db8:1000:2::2/112 dev eth0' \ -o match:'default via 2001:db8:1000:2::1' \ - ifdown -S/dev/null -i $FIXTURES/static-eth0-v6-netmask.interfaces -n -a + ifdown -S/dev/null -E $EXECUTORS -i $FIXTURES/static-eth0-v6-netmask.interfaces -n -a } inet_dhcp_body() { @@ -77,7 +77,7 @@ inet_dhcp_body() { -o match:'ip link set down dev lo' \ -o match:'ip link set down dev eth0' \ -o match:'dhc' \ - ifdown -S/dev/null -i $FIXTURES/dhcp-eth0.interfaces -n -a + ifdown -S/dev/null -E $EXECUTORS -i $FIXTURES/dhcp-eth0.interfaces -n -a } use_dhcp_body() { @@ -85,7 +85,7 @@ use_dhcp_body() { -o match:'ip link set down dev lo' \ -o match:'ip link set down dev eth0' \ -o match:'dhc' \ - ifdown -S/dev/null -i $FIXTURES/use-dhcp-eth0.interfaces -n -a + ifdown -S/dev/null -E $EXECUTORS -i $FIXTURES/use-dhcp-eth0.interfaces -n -a } alias_eth0_home_body() { @@ -93,7 +93,7 @@ alias_eth0_home_body() { -o match:'ip link set down dev wlan0' \ -o match:'dhc' \ ifdown -S $FIXTURES/alias-home.ifstate \ - -i $FIXTURES/alias-home-work.interfaces -n wlan0 + -E $EXECUTORS -i $FIXTURES/alias-home-work.interfaces -n wlan0 } alias_eth0_work_body() { @@ -104,7 +104,7 @@ alias_eth0_work_body() { -o match:'default via 203.0.113.1' \ -o match:'default via 2001:db8:1000:2::1' \ ifdown -S $FIXTURES/alias-work.ifstate \ - -i $FIXTURES/alias-home-work.interfaces -n wlan0 + -E $EXECUTORS -i $FIXTURES/alias-home-work.interfaces -n wlan0 } bonded_bridge_body() { @@ -118,5 +118,5 @@ bonded_bridge_body() { -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 + -E $EXECUTORS -i $FIXTURES/bonded-bridge.interfaces -n br0 } diff --git a/tests/ifup_test b/tests/ifup_test index 9b35d21..b1850aa 100755 --- a/tests/ifup_test +++ b/tests/ifup_test @@ -33,7 +33,7 @@ dual_stack_body() { -o match:'add 2001:db8:1000:2::2/64 dev eth0' \ -o match:'default via 203.0.113.1' \ -o match:'default via 2001:db8:1000:2::1' \ - ifup -S/dev/null -i $FIXTURES/static-eth0.interfaces -n -a + ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/static-eth0.interfaces -n -a } static_ipv4_body() { @@ -42,7 +42,7 @@ static_ipv4_body() { -o match:'ip link set up dev eth0' \ -o match:'add 203.0.113.2/24 dev eth0' \ -o match:'default via 203.0.113.1' \ - ifup -S/dev/null -i $FIXTURES/static-eth0-v4.interfaces -n -a + ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/static-eth0-v4.interfaces -n -a } static_ipv4_netmask_body() { @@ -51,7 +51,7 @@ static_ipv4_netmask_body() { -o match:'ip link set up dev eth0' \ -o match:'add 203.0.113.2/29 dev eth0' \ -o match:'default via 203.0.113.1' \ - ifup -S/dev/null -i $FIXTURES/static-eth0-v4-netmask.interfaces -n -a + ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/static-eth0-v4-netmask.interfaces -n -a } static_ipv6_body() { @@ -60,7 +60,7 @@ static_ipv6_body() { -o match:'ip link set up dev eth0' \ -o match:'add 2001:db8:1000:2::2/64 dev eth0' \ -o match:'default via 2001:db8:1000:2::1' \ - ifup -S/dev/null -i $FIXTURES/static-eth0-v6.interfaces -n -a + ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/static-eth0-v6.interfaces -n -a } static_ipv6_netmask_body() { @@ -69,7 +69,7 @@ static_ipv6_netmask_body() { -o match:'ip link set up dev eth0' \ -o match:'add 2001:db8:1000:2::2/112 dev eth0' \ -o match:'default via 2001:db8:1000:2::1' \ - ifup -S/dev/null -i $FIXTURES/static-eth0-v6-netmask.interfaces -n -a + ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/static-eth0-v6-netmask.interfaces -n -a } inet_dhcp_body() { @@ -77,7 +77,7 @@ inet_dhcp_body() { -o match:'ip link set up dev lo' \ -o match:'ip link set up dev eth0' \ -o match:'dhc' \ - ifup -S/dev/null -i $FIXTURES/dhcp-eth0.interfaces -n -a + ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/dhcp-eth0.interfaces -n -a } use_dhcp_body() { @@ -85,14 +85,14 @@ use_dhcp_body() { -o match:'ip link set up dev lo' \ -o match:'ip link set up dev eth0' \ -o match:'dhc' \ - ifup -S/dev/null -i $FIXTURES/use-dhcp-eth0.interfaces -n -a + ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/use-dhcp-eth0.interfaces -n -a } alias_eth0_home_body() { atf_check -s exit:0 -e ignore \ -o match:'ip link set up dev wlan0' \ -o match:'dhc' \ - ifup -S/dev/null -i $FIXTURES/alias-home-work.interfaces -n wlan0=home + ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/alias-home-work.interfaces -n wlan0=home } alias_eth0_work_body() { @@ -102,7 +102,7 @@ alias_eth0_work_body() { -o match:'add 2001:db8:1000:2::2/64 dev wlan0' \ -o match:'default via 203.0.113.1' \ -o match:'default via 2001:db8:1000:2::1' \ - ifup -S/dev/null -i $FIXTURES/alias-home-work.interfaces -n wlan0=work + ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/alias-home-work.interfaces -n wlan0=work } bonded_bridge_body() { @@ -115,5 +115,5 @@ bonded_bridge_body() { -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 + ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/bonded-bridge.interfaces -n br0 } diff --git a/tests/test_env.sh b/tests/test_env.sh index 07a20f7..10f8699 100644 --- a/tests/test_env.sh +++ b/tests/test_env.sh @@ -1,5 +1,6 @@ PATH="$(atf_get_srcdir)/..:$PATH" FIXTURES="$(atf_get_srcdir)/fixtures" +EXECUTORS="$(atf_get_srcdir)/executors" tests_init() { TESTS="$@"