diff --git a/tests/fixtures/mock-dependency-generator.ifstate b/tests/fixtures/mock-dependency-generator.ifstate new file mode 100644 index 0000000..39cf8ca --- /dev/null +++ b/tests/fixtures/mock-dependency-generator.ifstate @@ -0,0 +1,6 @@ +eth0=eth0 +eth1=eth1 +eth2=eth2 +eth3=eth3 +eth4=eth4 +br0=br0 diff --git a/tests/ifdown_test b/tests/ifdown_test index 0dcccf0..dfd4f77 100755 --- a/tests/ifdown_test +++ b/tests/ifdown_test @@ -14,7 +14,8 @@ tests_init \ use_dhcp \ alias_eth0_home \ alias_eth0_work \ - bonded_bridge + bonded_bridge \ + learned_dependency noargs_body() { atf_check -s exit:1 -e ignore ifdown -S/dev/null @@ -99,3 +100,15 @@ bonded_bridge_body() { ifdown -S $FIXTURES/bonded-bridge.ifstate \ -E $EXECUTORS -i $FIXTURES/bonded-bridge.interfaces -n br0 } + +learned_dependency_body() { + atf_check -s exit:0 -o ignore \ + -e match:"eth0" \ + -e match:"eth1" \ + -e match:"eth2" \ + -e match:"eth3" \ + -e match:"eth4" \ + ifdown -n -S $FIXTURES/mock-dependency-generator.ifstate \ + -E $EXECUTORS \ + -i $FIXTURES/mock-dependency-generator.interfaces br0 +} diff --git a/tests/ifup_test b/tests/ifup_test index cef02d5..1a2b4ea 100755 --- a/tests/ifup_test +++ b/tests/ifup_test @@ -14,7 +14,8 @@ tests_init \ use_dhcp \ alias_eth0_home \ alias_eth0_work \ - bonded_bridge + bonded_bridge \ + learned_dependency noargs_body() { atf_check -s exit:1 -e ignore ifup -S/dev/null @@ -96,3 +97,13 @@ bonded_bridge_body() { -o match:'executors/static' \ ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/bonded-bridge.interfaces -n br0 } + +learned_dependency_body() { + atf_check -s exit:0 -o ignore \ + -e match:"eth0" \ + -e match:"eth1" \ + -e match:"eth2" \ + -e match:"eth3" \ + -e match:"eth4" \ + ifup -n -S/dev/null -E $EXECUTORS -i $FIXTURES/mock-dependency-generator.interfaces br0 +}