From 050ab77bd3999b1ef8c60ee2793d55d7999c306f Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Mon, 24 Aug 2020 10:06:06 -0600 Subject: [PATCH] tests: add vlan-complex.interface and ifquery test for it --- tests/fixtures/vlan-complex.interfaces | 18 ++++++++++++++++++ tests/ifquery_test | 14 +++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 tests/fixtures/vlan-complex.interfaces diff --git a/tests/fixtures/vlan-complex.interfaces b/tests/fixtures/vlan-complex.interfaces new file mode 100644 index 0000000..e06b617 --- /dev/null +++ b/tests/fixtures/vlan-complex.interfaces @@ -0,0 +1,18 @@ +# From Alpine issue #11885. +iface lo inet loopback + +auto eth0 +iface eth0 + address 1.2.3.4/24 + address abcd:ef12:3456:3::4/64 + mtu 8000 + +auto servers +iface servers + address 1.2.10.4/24 + gateway 1.2.10.1 + address abcd:ef12:3456:10::4/64 + gateway abcd:ef12:3456:10::1 + mtu 8000 + vlan-raw-device eth0 + vlan_id 5 diff --git a/tests/ifquery_test b/tests/ifquery_test index 26c0c6f..9d86e28 100755 --- a/tests/ifquery_test +++ b/tests/ifquery_test @@ -32,7 +32,8 @@ tests_init \ tunnel_ifupdown2_rewrite \ gre_dependency \ vlan_explicit_learned_dependency \ - vlan_guessed_learned_dependency + vlan_guessed_learned_dependency \ + vlan_complex_learned_dependency noargs_body() { atf_check -s exit:1 -e ignore ifquery -S/dev/null @@ -206,3 +207,14 @@ vlan_guessed_learned_dependency_body() { -o match:"use vlan" \ ifquery -E $EXECUTORS_LINUX -i $FIXTURES/vlan.interfaces eth0.8 } + +vlan_complex_learned_dependency_body() { + atf_check -s exit:0 -o match:"requires eth0" \ + -o match:"use vlan" \ + -o match:"address 1.2.10.4/24" \ + -o match:"gateway 1.2.10.1" \ + -o match:"address abcd:ef12:3456:10::4/64" \ + -o match:"gateway abcd:ef12:3456:10::1" \ + -o match:"vlan-raw-device eth0" \ + ifquery -E $EXECUTORS_LINUX -i $FIXTURES/vlan-complex.interfaces servers +}