tests: add fixture & test for VRF topology learning

This commit is contained in:
Ariadne Conill 2020-08-18 16:52:11 -06:00
parent ba98705c8f
commit 2c37b22d70
4 changed files with 18 additions and 1 deletions

View file

@ -23,6 +23,9 @@ post-down)
[ -n "$IF_VRF_TABLE" ] && handle_init "del" [ -n "$IF_VRF_TABLE" ] && handle_init "del"
exit 0 exit 0
;; ;;
depend)
echo "$IF_VRF_MEMBER"
;;
*) *)
exit 0 exit 0
;; ;;

7
tests/fixtures/vrf.interfaces vendored Normal file
View file

@ -0,0 +1,7 @@
iface vrf-red
vrf-table 1
auto eth0
iface eth0
use dhcp
vrf-member vrf-red

View file

@ -18,7 +18,8 @@ tests_init \
learned_executor \ learned_executor \
inheritance_0 \ inheritance_0 \
inheritance_1 \ inheritance_1 \
implicit_vlan implicit_vlan \
vrf_dependency
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
@ -112,3 +113,8 @@ implicit_vlan_body() {
-o match:"use vlan" \ -o match:"use vlan" \
ifquery -E $EXECUTORS -i $FIXTURES/vlan.interfaces eth0.8 ifquery -E $EXECUTORS -i $FIXTURES/vlan.interfaces eth0.8
} }
vrf_dependency_body() {
atf_check -s exit:0 -o match:"requires vrf-red" \
ifquery -E $EXECUTORS_LINUX -i $FIXTURES/vrf.interfaces eth0
}

View file

@ -1,6 +1,7 @@
PATH="$(atf_get_srcdir)/..:$(atf_get_srcdir)/../..:$PATH" PATH="$(atf_get_srcdir)/..:$(atf_get_srcdir)/../..:$PATH"
FIXTURES="$(atf_get_srcdir)/fixtures" FIXTURES="$(atf_get_srcdir)/fixtures"
EXECUTORS="$(atf_get_srcdir)/executors" EXECUTORS="$(atf_get_srcdir)/executors"
EXECUTORS_LINUX="$(atf_get_srcdir)/../executor-scripts/linux"
tests_init() { tests_init() {
TESTS="$@" TESTS="$@"