tests: add ifup/ifdown tests for learned dependencies (close #5)
This commit is contained in:
parent
21bcbe1017
commit
cf59f6af4c
3 changed files with 32 additions and 2 deletions
6
tests/fixtures/mock-dependency-generator.ifstate
vendored
Normal file
6
tests/fixtures/mock-dependency-generator.ifstate
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
eth0=eth0
|
||||
eth1=eth1
|
||||
eth2=eth2
|
||||
eth3=eth3
|
||||
eth4=eth4
|
||||
br0=br0
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue