tests: ifquery: add tests to verify stanza merging works as expected

This commit is contained in:
Ariadne Conill 2020-12-02 11:42:45 -07:00
parent c4d9d6fd06
commit b10094eae7

View file

@ -38,7 +38,9 @@ tests_init \
allow_undefined_positive \
allow_undefined_negative \
default_netmask_v4 \
default_netmask_v6
default_netmask_v6 \
stanza_merging_with_cidr \
stanza_merging_without_cidr
noargs_body() {
atf_check -s exit:1 -e ignore ifquery -S/dev/null
@ -256,3 +258,17 @@ default_netmask_v6_body() {
-o match:"2001:470:1f10::1/64" \
ifquery -i $FIXTURES/without-netmask.interfaces -p address v6
}
stanza_merging_with_cidr_body() {
atf_check -s exit:0 \
-o match:"203.0.113.1/32" \
-o match:"203.0.113.2/24" \
ifquery -i $FIXTURES/stanza-merging.interfaces -p address cidr
}
stanza_merging_without_cidr_body() {
atf_check -s exit:0 \
-o match:"203.0.113.1/32" \
-o match:"203.0.113.2/24" \
ifquery -i $FIXTURES/stanza-merging.interfaces -p address without-cidr
}