diff --git a/tests/fixtures/use-dhcp-eth0.interfaces b/tests/fixtures/use-dhcp-eth0.interfaces new file mode 100644 index 0000000..7daa26e --- /dev/null +++ b/tests/fixtures/use-dhcp-eth0.interfaces @@ -0,0 +1,3 @@ +auto eth0 +iface eth0 + use dhcp diff --git a/tests/ifdown_test b/tests/ifdown_test index 55f29ce..8813359 100755 --- a/tests/ifdown_test +++ b/tests/ifdown_test @@ -9,6 +9,7 @@ tests_init \ static_ipv4 \ static_ipv6 \ inet_dhcp \ + use_dhcp \ alias_eth0_home \ alias_eth0_work \ bonded_bridge @@ -59,6 +60,14 @@ inet_dhcp_body() { ifdown -S/dev/null -i $FIXTURES/dhcp-eth0.interfaces -n -a } +use_dhcp_body() { + atf_check -s exit:0 -e ignore \ + -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 +} + alias_eth0_home_body() { atf_check -s exit:0 -e ignore \ -o match:'ip link set down dev wlan0' \ diff --git a/tests/ifquery_test b/tests/ifquery_test index f3a5299..52318f5 100755 --- a/tests/ifquery_test +++ b/tests/ifquery_test @@ -9,6 +9,7 @@ tests_init \ static_ipv4 \ static_ipv6 \ dhcp_ipv4 \ + use_dhcp \ state_query_home \ state_query_work \ state_print @@ -47,6 +48,11 @@ dhcp_ipv4_body() { ifquery -S/dev/null -i $FIXTURES/dhcp-eth0.interfaces eth0 } +use_dhcp_body() { + atf_check -s exit:0 -o match:"use dhcp" \ + ifquery -S/dev/null -i $FIXTURES/use-dhcp-eth0.interfaces eth0 +} + state_query_home_body() { atf_check -s exit:0 -o match:"iface home" \ ifquery -S $FIXTURES/alias-home.ifstate -i $FIXTURES/alias-home-work.interfaces wlan0 diff --git a/tests/ifup_test b/tests/ifup_test index ed4e187..2091d0f 100755 --- a/tests/ifup_test +++ b/tests/ifup_test @@ -9,6 +9,7 @@ tests_init \ static_ipv4 \ static_ipv6 \ inet_dhcp \ + use_dhcp \ alias_eth0_home \ alias_eth0_work \ bonded_bridge @@ -59,6 +60,14 @@ inet_dhcp_body() { ifup -S/dev/null -i $FIXTURES/dhcp-eth0.interfaces -n -a } +use_dhcp_body() { + atf_check -s exit:0 -e ignore \ + -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 +} + alias_eth0_home_body() { atf_check -s exit:0 -e ignore \ -o match:'ip link set up dev wlan0' \