From c97594b89bd3ea38af39301878fd38fa4aeeb226 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Tue, 28 Jul 2020 13:48:53 -0600 Subject: [PATCH] tests: add test for mock dependency generator --- tests/fixtures/mock-dependency-generator.interfaces | 2 ++ tests/ifquery_test | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 tests/fixtures/mock-dependency-generator.interfaces diff --git a/tests/fixtures/mock-dependency-generator.interfaces b/tests/fixtures/mock-dependency-generator.interfaces new file mode 100644 index 0000000..d07127f --- /dev/null +++ b/tests/fixtures/mock-dependency-generator.interfaces @@ -0,0 +1,2 @@ +iface br0 + use mock-dependency-generator diff --git a/tests/ifquery_test b/tests/ifquery_test index 52318f5..91c1380 100755 --- a/tests/ifquery_test +++ b/tests/ifquery_test @@ -12,7 +12,8 @@ tests_init \ use_dhcp \ state_query_home \ state_query_work \ - state_print + state_print \ + learned_dependency noargs_body() { atf_check -s exit:1 -e ignore ifquery -S/dev/null @@ -69,3 +70,8 @@ state_print_body() { atf_check -s exit:0 -o match:"wlan0=work" \ ifquery -S $FIXTURES/alias-work.ifstate -i $FIXTURES/alias-home-work.interfaces -s } + +learned_dependency_body() { + atf_check -s exit:0 -o match:"requires eth0 eth1 eth2 eth3 eth4" \ + ifquery -E $EXECUTORS -i $FIXTURES/mock-dependency-generator.interfaces br0 +}