]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Added test for the proposed fix
authorDiego Fronza <diego@isc.org>
Wed, 15 Jan 2020 18:22:06 +0000 (15:22 -0300)
committerDiego Fronza <diego@isc.org>
Wed, 22 Jan 2020 19:15:51 +0000 (16:15 -0300)
Added test to ensure that NXDOMAIN is returned when BIND is queried for a
non existing domain in CH class (if a view of CHAOS class is configured)
and that it also doesn't crash anymore in those cases.

bin/tests/system/resolver/ns1/chaostest.db [new file with mode: 0644]
bin/tests/system/resolver/ns1/named.conf.in
bin/tests/system/resolver/tests.sh

diff --git a/bin/tests/system/resolver/ns1/chaostest.db b/bin/tests/system/resolver/ns1/chaostest.db
new file mode 100644 (file)
index 0000000..4c967b9
--- /dev/null
@@ -0,0 +1,5 @@
+$TTL           3600
+@              CHAOS SOA       @ @ 1970010100 86400 600 86400 300
+@              CHAOS NS        @
+version         CHAOS TXT       "CH 1.0"
+hostname        CHAOS TXT       "unknown"
index c7d5d14ce5d04548b630e3183ea02c22acf3997c..b26a1566013a2913c224a76844f6fd2b337569af 100644 (file)
@@ -46,7 +46,10 @@ server fd92:7065:b8e:ffff::1000 {
  * "globalcache" before the recursive "default"/IN view is configured.
  */
 view "class" chaos {
-       match-clients { none; };
+       zone "chaostest" CHAOS {
+                type master;
+                file "chaostest.db";
+        };
 };
 
 /*
index 788e0825283dabacd257feb9313969ba5916c564..5604236f5a21bf3f6f7547cb28f2e3611ea46869 100755 (executable)
@@ -805,5 +805,13 @@ grep "running as: .* -m record,size,mctx " ns1/named.run > /dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
+n=`expr $n + 1`
+echo_i "checking NXDOMAIN is returned when querying non existing domain in CH class ($n)"
+ret=0
+$DIG $DIGOPTS @10.53.0.1 id.hostname txt ch > dig.ns1.out.${n} || ret=1
+grep "status: NXDOMAIN" dig.ns1.out.${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