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 +}