From 71290da7117181f57c38fc4063394dc5c1acc3d5 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Wed, 19 Aug 2020 02:14:08 -0600 Subject: [PATCH] tests: add ifupdown2 vrf configuration fixture, and some tests against it --- tests/fixtures/vrf-ifupdown2.interfaces | 7 +++++++ tests/ifquery_test | 14 +++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 tests/fixtures/vrf-ifupdown2.interfaces diff --git a/tests/fixtures/vrf-ifupdown2.interfaces b/tests/fixtures/vrf-ifupdown2.interfaces new file mode 100644 index 0000000..242cba5 --- /dev/null +++ b/tests/fixtures/vrf-ifupdown2.interfaces @@ -0,0 +1,7 @@ +iface vrf-red + vrf-table 1 + +auto eth0 +iface eth0 + use dhcp + vrf vrf-red diff --git a/tests/ifquery_test b/tests/ifquery_test index 0b557d7..f6afe13 100755 --- a/tests/ifquery_test +++ b/tests/ifquery_test @@ -19,7 +19,9 @@ tests_init \ inheritance_0 \ inheritance_1 \ implicit_vlan \ - vrf_dependency + vrf_dependency \ + vrf_ifupdown2_rewrite \ + vrf_ifupdown2_dependency noargs_body() { atf_check -s exit:1 -e ignore ifquery -S/dev/null @@ -118,3 +120,13 @@ vrf_dependency_body() { atf_check -s exit:0 -o match:"requires vrf-red" \ ifquery -E $EXECUTORS_LINUX -i $FIXTURES/vrf.interfaces eth0 } + +vrf_ifupdown2_rewrite_body() { + atf_check -s exit:0 -o match:"vrf-member vrf-red" \ + ifquery -E $EXECUTORS -i $FIXTURES/vrf-ifupdown2.interfaces eth0 +} + +vrf_ifupdown2_dependency_body() { + atf_check -s exit:0 -o match:"requires vrf-red" \ + ifquery -E $EXECUTORS_LINUX -i $FIXTURES/vrf-ifupdown2.interfaces eth0 +}