From: Diego Fronza Date: Tue, 22 Oct 2019 13:43:24 +0000 (-0300) Subject: Added test to verify that both include glob-expression and include X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=06b46a6935d9d89a141396c2ac27a1ef5668692b;p=thirdparty%2Fbind9.git Added test to verify that both include glob-expression and include non-glob-expression works. --- diff --git a/bin/tests/system/include-multiplecfg/ns2/mars.com.db b/bin/tests/system/include-multiplecfg/ns2/mars.com.db new file mode 100644 index 00000000000..fe9837a7a28 --- /dev/null +++ b/bin/tests/system/include-multiplecfg/ns2/mars.com.db @@ -0,0 +1,21 @@ +$TTL 86400 +@ IN SOA dns1.mars.com. hostmaster.mars.com. ( + 2001062501 ; serial + 21600 ; refresh after 6 hours + 3600 ; retry after 1 hour + 604800 ; expire after 1 week + 86400 ) ; minimum TTL of 1 day + + IN NS dns1.mars.com. + IN NS dns2.mars.com. + + IN MX 10 mail1.mars.com. + IN MX 20 mail2.mars.com. + + IN A 10.53.0.1 + +dns1 IN A 10.53.0.1 +dns2 IN A 10.53.0.2 + +mail1 IN A 10.53.0.1 +mail2 IN A 10.53.0.2 diff --git a/bin/tests/system/include-multiplecfg/ns2/mars.conf b/bin/tests/system/include-multiplecfg/ns2/mars.conf new file mode 100644 index 00000000000..746a2415b83 --- /dev/null +++ b/bin/tests/system/include-multiplecfg/ns2/mars.conf @@ -0,0 +1,8 @@ + +zone "mars.com" { + type master; + file "mars.com.db"; + allow-transfer { any; }; + allow-update { any; }; +}; + diff --git a/bin/tests/system/include-multiplecfg/ns2/named.conf.in b/bin/tests/system/include-multiplecfg/ns2/named.conf.in index 4ae6ac1c631..190264bf1df 100644 --- a/bin/tests/system/include-multiplecfg/ns2/named.conf.in +++ b/bin/tests/system/include-multiplecfg/ns2/named.conf.in @@ -23,5 +23,9 @@ options { # file "../../common/root.hint"; #}; +# Should include all files matching pattern. include "zone*.conf"; +# Shouldn't break standard file pattern. +include "mars.conf"; + diff --git a/bin/tests/system/include-multiplecfg/tests.sh b/bin/tests/system/include-multiplecfg/tests.sh index 9de935b5e05..d5c37caaa65 100644 --- a/bin/tests/system/include-multiplecfg/tests.sh +++ b/bin/tests/system/include-multiplecfg/tests.sh @@ -22,7 +22,7 @@ n=0 # Test 1 - check if zone1 was loaded. n=`expr $n + 1` -echo_i "test $n: glob include zone1" +echo_i "checking glob include of zone1 config ($n)" ret=0 $DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 zone1.com. a > dig.out.ns2.$n || ret=1 grep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1 @@ -32,7 +32,7 @@ status=`expr $status + $ret` # Test 2 - check if zone2 was loaded. n=`expr $n + 1` -echo_i "test $n: glob include zone2" +echo_i "checking glob include of zone2 config ($n)" ret=0 $DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 zone2.com. a > dig.out.ns2.$n || ret=1 grep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1 @@ -40,5 +40,15 @@ grep '^zone2.com.' dig.out.ns2.$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` +# Test 3 - check if standard file path (no magic chars) works. +n=`expr $n + 1` +echo_i "checking include of standard file path config ($n)" +ret=0 +$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 mars.com. a > dig.out.ns2.$n || ret=1 +grep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1 +grep '^mars.com.' dig.out.ns2.$n > /dev/null || ret=1 +if [ $ret != 0 ]; then echo_i "failed"; fi +status=`expr $status + $ret` + echo_i "exit status: $status" [ $status -eq 0 ] || exit 1