diff --git a/tests/fixtures/dependency-loop.ifstate b/tests/fixtures/dependency-loop.ifstate new file mode 100644 index 0000000..4b7a3ef --- /dev/null +++ b/tests/fixtures/dependency-loop.ifstate @@ -0,0 +1,3 @@ +lo=lo +a=a +b=b diff --git a/tests/ifdown_test b/tests/ifdown_test index 5aafc86..fb6cf8e 100755 --- a/tests/ifdown_test +++ b/tests/ifdown_test @@ -23,7 +23,8 @@ tests_init \ deferred_teardown_2 \ deferred_teardown_3 \ teardown_dep_ordering \ - regress_opt_f + regress_opt_f \ + dependency_loop_breaking noargs_body() { atf_check -s exit:1 -e ignore ifdown -S/dev/null @@ -185,3 +186,9 @@ regress_opt_f_body() { atf_check -s exit:0 -o ignore -e ignore \ ifdown -n -S $FIXTURES/vlan.ifstate -E $EXECUTORS -i $FIXTURES/vlan.interfaces -f eth0.8 } + +dependency_loop_breaking_body() { + atf_check -s exit:0 -o ignore \ + -e match:"ifdown: skipping auto interface a \\(already deconfigured\\), use --force to force deconfiguration" \ + ifdown -n -i $FIXTURES/dependency-loop.interfaces -E $EXECUTORS -a +}