tests: add tests for auto interface skipping

This commit is contained in:
Ariadne Conill 2020-09-09 20:46:50 -06:00
parent ceb82f4fd2
commit e754e836af
4 changed files with 34 additions and 1 deletions

View file

@ -0,0 +1,3 @@
dummy=dummy 2
bat=bat 2
br=br 1

View file

@ -0,0 +1,13 @@
auto dummy
iface dummy
link-type dummy
auto bat
iface bat
link-type dummy
requires dummy
auto br
iface br
link-type dummy
requires bat

View file

@ -22,6 +22,7 @@ tests_init \
deferred_teardown_1 \
deferred_teardown_2 \
deferred_teardown_3 \
teardown_dep_ordering \
regress_opt_f
noargs_body() {
@ -172,6 +173,14 @@ deferred_teardown_3_body() {
-i $FIXTURES/deferred-teardown-2.interfaces tun0 tun1 tun2 tun3
}
teardown_dep_ordering_body() {
atf_check -s exit:0 -o ignore \
-e match:"skipping auto interface bat" \
-e match:"skipping auto interface dummy" \
ifdown -n -i $FIXTURES/teardown-dep-ordering.interfaces \
-S $FIXTURES/teardown-dep-ordering.ifstate -E $EXECUTORS -a
}
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

View file

@ -18,7 +18,8 @@ tests_init \
learned_dependency \
learned_dependency_2 \
learned_executor \
implicit_vlan
implicit_vlan \
teardown_dep_ordering
noargs_body() {
atf_check -s exit:1 -e ignore ifup -S/dev/null
@ -131,3 +132,10 @@ implicit_vlan_body() {
-e match:"attempting to run link executor" \
ifup -n -S/dev/null -E $EXECUTORS -i $FIXTURES/vlan.interfaces eth0.8
}
teardown_dep_ordering_body() {
atf_check -s exit:0 -o ignore \
-e match:"skipping auto interface bat" \
-e match:"skipping auto interface dummy" \
ifup -n -i $FIXTURES/teardown-dep-ordering.interfaces -E $EXECUTORS -a
}