]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
add a system test with an ADB loop
authorEvan Hunt <each@isc.org>
Tue, 19 Oct 2021 06:14:28 +0000 (23:14 -0700)
committerEvan Hunt <each@isc.org>
Thu, 21 Oct 2021 09:15:55 +0000 (02:15 -0700)
Add a lame delegation to lame.example.org with only an A record
in the additional section; on failure, this will trigger a retry
with AAAA, which will loop. Test that dig returns SERVFAIL, in
addition to confirming that named doesn't hang on shutdown.

bin/tests/system/resolver/ans2/ans.pl
bin/tests/system/resolver/ans3/ans.pl
bin/tests/system/resolver/tests.sh

index cc923e3dfb60964cd2dfed472f6addfd75ef947f..d9f6f53508f94e2261b28dd14756efb2a05180a1 100644 (file)
@@ -102,6 +102,11 @@ for (;;) {
        } elsif ($qname =~ /example\.net/) {
                $packet->push("authority", new Net::DNS::RR("example.net 300 NS ns.example.net"));
                $packet->push("additional", new Net::DNS::RR("ns.example.net 300 A 10.53.0.3"));
+       } elsif ($qname =~ /lame\.example\.org/) {
+               $packet->header->ad(0);
+               $packet->header->aa(0);
+               $packet->push("authority", new Net::DNS::RR("lame.example.org 300 NS ns.lame.example.org"));
+               $packet->push("additional", new Net::DNS::RR("ns.lame.example.org 300 A 10.53.0.3"));
        } elsif ($qname =~ /sub\.example\.org/) {
                # Data for CNAME/DNAME filtering.  The final answers are
                # expected to be accepted regardless of the filter setting.
index be8708ddf54c95301777790557d5761e0801048c..15d4c987809556668c1367f0c25bedcdff03c09f 100644 (file)
@@ -98,6 +98,11 @@ for (;;) {
        } elsif ($qname =~ /^nxdomain\.example\.net$/i) {
                $packet->header->aa(1);
                $packet->header->rcode(NXDOMAIN);
+       } elsif ($qname =~ /lame\.example\.org/) {
+               $packet->header->ad(0);
+               $packet->header->aa(0);
+               $packet->push("authority", new Net::DNS::RR("lame.example.org 300 NS ns.lame.example.org"));
+               $packet->push("additional", new Net::DNS::RR("ns.lame.example.org 300 A 10.53.0.3"));
        } elsif ($qname eq "cname.sub.example.org") {
                $packet->push("answer",
                              new Net::DNS::RR($qname .
index 165b196b70a155cfc05a5376703ce0a2cf9b5f55..d8485f29edafd44bb91b6074efa75ca0be29ae02 100755 (executable)
@@ -889,5 +889,13 @@ grep 'cname-next\.example\.net\..*CNAME.http-server\.example\.net\.' dig.out.ns7
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
+n=`expr $n + 1`
+echo_i "check ADB find loops are detected ($n)"
+ret=0
+$DIG $DIGOPTS +tcp +tries=1 +timeout=5 @10.53.0.1 fake.lame.example.org > dig.out.ns1.${n} || ret=1
+grep "status: SERVFAIL" dig.out.ns1.${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