tests: add ifup/ifdown/ifquery tests for vlans
This commit is contained in:
parent
b27caaedf6
commit
0de4a3f6f9
4 changed files with 28 additions and 3 deletions
2
tests/fixtures/vlan.ifstate
vendored
Normal file
2
tests/fixtures/vlan.ifstate
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
eth0=eth0
|
||||
eth0.8=eth0.8
|
|
@ -17,7 +17,8 @@ tests_init \
|
|||
bonded_bridge \
|
||||
learned_dependency \
|
||||
learned_dependency_2 \
|
||||
learned_executor
|
||||
learned_executor \
|
||||
implicit_vlan
|
||||
|
||||
noargs_body() {
|
||||
atf_check -s exit:1 -e ignore ifdown -S/dev/null
|
||||
|
@ -132,3 +133,10 @@ learned_executor_body() {
|
|||
-E $EXECUTORS \
|
||||
-i $FIXTURES/mock-dependency-generator-2.interfaces br0
|
||||
}
|
||||
|
||||
implicit_vlan_body() {
|
||||
atf_check -s exit:0 -o ignore \
|
||||
-e match:"attempting to run vlan executor" \
|
||||
-e match:"attempting to run link executor" \
|
||||
ifdown -n -S $FIXTURES/vlan.ifstate -E $EXECUTORS -i $FIXTURES/vlan.interfaces eth0.8
|
||||
}
|
||||
|
|
|
@ -17,7 +17,8 @@ tests_init \
|
|||
learned_dependency_2 \
|
||||
learned_executor \
|
||||
inheritance_0 \
|
||||
inheritance_1
|
||||
inheritance_1 \
|
||||
implicit_vlan
|
||||
|
||||
noargs_body() {
|
||||
atf_check -s exit:1 -e ignore ifquery -S/dev/null
|
||||
|
@ -105,3 +106,9 @@ inheritance_1_body() {
|
|||
-o match:"address 2001:db8:1000:2::2/64" \
|
||||
ifquery -E $EXECUTORS -i $FIXTURES/inheritance.interfaces inherit1
|
||||
}
|
||||
|
||||
implicit_vlan_body() {
|
||||
atf_check -s exit:0 -o match:"requires eth0" \
|
||||
-o match:"use vlan" \
|
||||
ifquery -E $EXECUTORS -i $FIXTURES/vlan.interfaces eth0.8
|
||||
}
|
||||
|
|
|
@ -17,7 +17,8 @@ tests_init \
|
|||
bonded_bridge \
|
||||
learned_dependency \
|
||||
learned_dependency_2 \
|
||||
learned_executor
|
||||
learned_executor \
|
||||
implicit_vlan
|
||||
|
||||
noargs_body() {
|
||||
atf_check -s exit:1 -e ignore ifup -S/dev/null
|
||||
|
@ -123,3 +124,10 @@ learned_executor_body() {
|
|||
-e match:"attempting to run mock executor" \
|
||||
ifup -n -S/dev/null -E $EXECUTORS -i $FIXTURES/mock-dependency-generator-2.interfaces br0
|
||||
}
|
||||
|
||||
implicit_vlan_body() {
|
||||
atf_check -s exit:0 -o ignore \
|
||||
-e match:"attempting to run vlan executor" \
|
||||
-e match:"attempting to run link executor" \
|
||||
ifup -n -S/dev/null -E $EXECUTORS -i $FIXTURES/vlan.interfaces eth0.8
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue