]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
add a test with CD=1 query for pending data
authorEvan Hunt <each@isc.org>
Tue, 18 Oct 2022 23:37:07 +0000 (16:37 -0700)
committerEvan Hunt <each@isc.org>
Wed, 19 Oct 2022 20:17:32 +0000 (13:17 -0700)
this is a regression test for [GL #3247].

bin/tests/system/rpz/clean.sh
bin/tests/system/rpz/ns2/base-tld2s.db
bin/tests/system/rpz/ns2/tld2.db
bin/tests/system/rpz/ns6/bl.tld2s.db.in [new file with mode: 0644]
bin/tests/system/rpz/ns6/named.conf.in
bin/tests/system/rpz/setup.sh
bin/tests/system/rpz/tests.sh

index 8b7cad861e5b0c4c81443ef3cfd9ef371ff9cf11..5162d3e0891e84b9de8d3a1a6cf73316d47d9a29 100644 (file)
@@ -30,7 +30,7 @@ fi
 # from the first test pass so the second pass can be set up correctly.
 # remove those files first, then decide whether to remove the others.
 rm -f ns*/*.key ns*/*.private
-rm -f ns2/tld2s.db ns2/bl.tld2.db
+rm -f ns2/tld2s.db */bl.tld2.db */bl.tld2s.db
 rm -f ns3/bl*.db ns3/fast-expire.db ns*/empty.db
 rm -f ns3/manual-update-rpz.db
 rm -f ns3/mixed-case-rpz.db
index 6235b49b39abdcf05d929f626c3838b0384dc4e5..77114ec928658a5277468c954f1a58e8b15b3bd2 100644 (file)
@@ -23,3 +23,4 @@ a0-1-scname   CNAME   a0-1.tld2.
 
 a3-5           A       192.168.3.5
 
+a7-2           A       192.168.7.2
index 63e985d34affaa6c9042b3ebf3b8936f0f90c5bf..c6f2556db59975b6088e76df78edd8fb7b99a841 100644 (file)
@@ -120,3 +120,6 @@ a6-2                A       192.168.6.2
 
 a7-1           A       192.168.7.1
                TXT     "a7-1 tld2 text"
+
+a7-2           A       192.168.7.2
+               TXT     "a7-2 tld2 text"
diff --git a/bin/tests/system/rpz/ns6/bl.tld2s.db.in b/bin/tests/system/rpz/ns6/bl.tld2s.db.in
new file mode 100644 (file)
index 0000000..4538050
--- /dev/null
@@ -0,0 +1,20 @@
+; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+;
+; SPDX-License-Identifier: MPL-2.0
+;
+; This Source Code Form is subject to the terms of the Mozilla Public
+; License, v. 2.0.  If a copy of the MPL was not distributed with this
+; file, you can obtain one at https://mozilla.org/MPL/2.0/.
+;
+; See the COPYRIGHT file distributed with this work for additional
+; information regarding copyright ownership.
+
+$TTL   3600
+@              SOA     rpz.tld2.  hostmaster.ns.tld2. ( 3 3600 1200 604800 60 )
+               NS      ns2
+               NS      ns3
+ns2            A       10.53.0.2
+ns3            A       10.53.0.3
+
+32.2.7.168.192.rpz-ip   A 1.1.1.1
+                        AAAA ::1
index 308b7bf458c2c3f2e019651a63ec97698133cec5..4c0520712f568baded4a42d514f26d35ea1aecfc 100644 (file)
@@ -30,6 +30,7 @@ options {
 
        response-policy {
            zone "policy1" min-update-interval 0;
+           zone "bl.tld2s" policy given;
        } qname-wait-recurse yes
        // add-soa yes # leave add-soa as default for unset test
        nsip-enable yes
@@ -59,3 +60,8 @@ zone "policy1" {
        notify-delay 0;
        allow-transfer  { any; };
 };
+
+zone "bl.tld2s." {
+    type primary;
+    file "bl.tld2s.db";
+};
index dfa807252456b9bd5b284b152941eee0437c3048..2e2c2bdfbddb320b21820afbd9a136b312fae684 100644 (file)
@@ -169,6 +169,7 @@ $PERL -e 'for ($cnt = $val = 1; $cnt <= 3000; ++$cnt) {
 cp ns2/bl.tld2.db.in ns2/bl.tld2.db
 cp ns5/empty.db.in ns5/empty.db
 cp ns5/empty.db.in ns5/policy2.db
+cp ns6/bl.tld2s.db.in ns6/bl.tld2s.db
 
 # Run dnsrpzd to get the license and prime the static policy zones
 if test -n "$TEST_DNSRPS"; then
index 6ee11fad2f2bccc94fb2935b2d7edaea81c8ab30..a955b25a3585cb90a915cf5cf0fb1ff7b6ce4485 100644 (file)
@@ -965,6 +965,15 @@ EOF
     done
   done
 
+  if [ native = "$mode" ]; then
+    t=`expr $t + 1`
+    echo_i "checking that rewriting CD=1 queries handles pending data correctly (${t})"
+    $RNDCCMD $ns3 flush
+    $RNDCCMD $ns6 flush
+    $DIG a7-2.tld2s -p ${PORT} @$ns6 +cd > dig.out.${t}
+    grep -w "1.1.1.1" dig.out.${t} > /dev/null || setret "failed"
+  fi
+
   [ $status -ne 0 ] && pf=fail || pf=pass
   case $mode in
   native)