tests: add tests for managing the tunnel executor

This commit is contained in:
Ariadne Conill 2020-08-19 03:13:02 -06:00
parent c24143982f
commit 953666f1fb
4 changed files with 40 additions and 1 deletions

View file

@ -2,6 +2,7 @@ auto tun0
iface tun0 iface tun0
tunnel-local 203.0.113.2 tunnel-local 203.0.113.2
tunnel-endpoint 203.0.113.1 tunnel-endpoint 203.0.113.1
tunnel-mode gre
tunnel-physdev eth0 tunnel-physdev eth0
address 203.0.113.10/30 address 203.0.113.10/30
gateway 203.0.113.9 gateway 203.0.113.9

View file

@ -2,6 +2,7 @@ auto tun0
iface tun0 iface tun0
local 203.0.113.2 local 203.0.113.2
endpoint 203.0.113.1 endpoint 203.0.113.1
mode gre
tunnel-dev eth0 tunnel-dev eth0
address 203.0.113.10/30 address 203.0.113.10/30
gateway 203.0.113.9 gateway 203.0.113.9

View file

@ -2,6 +2,7 @@ auto tun0
iface tun0 iface tun0
tunnel-local 203.0.113.2 tunnel-local 203.0.113.2
tunnel-remote 203.0.113.1 tunnel-remote 203.0.113.1
tunnel-mode gre
tunnel-dev eth0 tunnel-dev eth0
address 203.0.113.10/30 address 203.0.113.10/30
gateway 203.0.113.9 gateway 203.0.113.9

View file

@ -23,7 +23,12 @@ tests_init \
vrf_ifupdown2_rewrite \ vrf_ifupdown2_rewrite \
vrf_ifupdown2_dependency \ vrf_ifupdown2_dependency \
ppp_dependency \ ppp_dependency \
ppp_legacy_rewrite ppp_legacy_rewrite \
tunnel_dependency \
tunnel_legacy_dependency \
tunnel_legacy_rewrite \
tunnel_ifupdown2_dependency \
tunnel_ifupdown2_rewrite
noargs_body() { noargs_body() {
atf_check -s exit:1 -e ignore ifquery -S/dev/null atf_check -s exit:1 -e ignore ifquery -S/dev/null
@ -142,3 +147,34 @@ ppp_legacy_rewrite_body() {
atf_check -s exit:0 -o match:"ppp-provider someisp" \ atf_check -s exit:0 -o match:"ppp-provider someisp" \
ifquery -E $EXECUTORS_LINUX -i $FIXTURES/ppp-legacy.interfaces ppp0 ifquery -E $EXECUTORS_LINUX -i $FIXTURES/ppp-legacy.interfaces ppp0
} }
tunnel_dependency_body() {
atf_check -s exit:0 -o match:"requires eth0" \
ifquery -E $EXECUTORS_LINUX -i $FIXTURES/tunnel.interfaces tun0
}
tunnel_legacy_dependency_body() {
atf_check -s exit:0 -o match:"requires eth0" \
ifquery -E $EXECUTORS_LINUX -i $FIXTURES/tunnel-legacy.interfaces tun0
}
tunnel_ifupdown2_dependency_body() {
atf_check -s exit:0 -o match:"requires eth0" \
ifquery -E $EXECUTORS_LINUX -i $FIXTURES/tunnel-ifupdown2.interfaces tun0
}
tunnel_legacy_rewrite_body() {
atf_check -s exit:0 \
-o match:"tunnel-local 203.0.113.2" \
-o match:"tunnel-remote 203.0.113.1" \
-o match:"tunnel-mode gre" \
ifquery -E $EXECUTORS_LINUX -i $FIXTURES/tunnel-legacy.interfaces tun0
}
tunnel_ifupdown2_rewrite_body() {
atf_check -s exit:0 \
-o match:"tunnel-local 203.0.113.2" \
-o match:"tunnel-remote 203.0.113.1" \
-o match:"tunnel-mode gre" \
ifquery -E $EXECUTORS_LINUX -i $FIXTURES/tunnel-ifupdown2.interfaces tun0
}