]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
add system test to confirm glue is returned in priming queries
authorEvan Hunt <each@isc.org>
Tue, 18 Jun 2019 02:12:02 +0000 (19:12 -0700)
committerEvan Hunt <each@isc.org>
Wed, 26 Jun 2019 15:53:42 +0000 (08:53 -0700)
bin/tests/system/additional/ns1/named1.conf.in
bin/tests/system/additional/ns1/named2.conf.in
bin/tests/system/additional/ns1/named3.conf.in
bin/tests/system/additional/ns1/named4.conf.in
bin/tests/system/additional/ns1/root.db [new file with mode: 0644]
bin/tests/system/additional/tests.sh

index 1fb8e7a60170ed7201fa6880f995becdaa72d920..4c850109d93d29b98fba02140f07413bcc257ec3 100644 (file)
@@ -29,6 +29,11 @@ controls {
        inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
 };
 
+zone "." {
+        type master;
+        file "root.db";
+};
+
 zone "rt.example" {
        type master;
        file "rt.db";
index 84a55481e7c21a8c3f40b23864b1583c7d8033b9..b71434892c51037384170941885339b418b047b5 100644 (file)
@@ -29,6 +29,11 @@ controls {
        inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
 };
 
+zone "." {
+        type master;
+        file "root.db";
+};
+
 zone "rt.example" {
        type master;
        file "rt.db";
index c0b697986a40c463f65c2b1fbd44826acaa28848..3df718436ab286e3c884e3eb206ebffa2d679458 100644 (file)
@@ -30,6 +30,11 @@ controls {
        inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
 };
 
+zone "." {
+        type master;
+        file "root.db";
+};
+
 zone "rt.example" {
        type master;
        file "rt.db";
index a8f0aa4beb03eecf80874916b33f886730823832..f7947c2e2af12207794d948737a85bf5b156a67f 100644 (file)
@@ -29,6 +29,11 @@ controls {
        inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
 };
 
+zone "." {
+        type master;
+        file "root.db";
+};
+
 zone "mx.example" {
        type master;
        file "mx.db";
diff --git a/bin/tests/system/additional/ns1/root.db b/bin/tests/system/additional/ns1/root.db
new file mode 100644 (file)
index 0000000..7db363b
--- /dev/null
@@ -0,0 +1,19 @@
+; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+;
+; 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 http://mozilla.org/MPL/2.0/.
+;
+; See the COPYRIGHT file distributed with this work for additional
+; information regarding copyright ownership.
+
+. IN SOA ns2. hostmaster ( 2 8H 2H 4W 1D);
+. NS ns1.rt.example.
+. NS ns2.rt.example.
+ns1.rt.example. A 10.53.0.1
+ns2.rt.example. A 10.53.0.2
+rt.example. NS ns1.
+naptr.example. NS ns1.
+rt2.example. NS ns1.
+naptr2.example. NS ns1.
+nid.example. NS ns1.
index e3e9a3da25ee435f2092e06bcbff76d181edc163..40642869b18da658a67d8495177e9ac91f06ef47 100644 (file)
@@ -210,6 +210,38 @@ dotests() {
     if [ $ret -eq 1 ] ; then
             echo_i " failed"; status=1
     fi
+
+    n=`expr $n + 1`
+    echo_i "test with NS, root zone ($n)"
+    ret=0
+    $DIG $DIGOPTS -t NS . @10.53.0.1 > dig.out.$n || ret=1
+    # Always expect glue for root priming queries, regardless $minimal
+    grep 'ADDITIONAL: 3' dig.out.$n > /dev/null || ret=1
+    if [ $ret -eq 1 ] ; then
+            echo_i " failed"; status=1
+    fi
+
+    n=`expr $n + 1`
+    echo_i "test with NS, non-root zone ($n)"
+    ret=0
+    $DIG $DIGOPTS -t NS rt.example @10.53.0.1 > dig.out.$n || ret=1
+    case $minimal in
+    yes)
+      grep 'ADDITIONAL: 1' dig.out.$n > /dev/null || ret=1
+      ;;
+    no)
+      grep 'ADDITIONAL: 2' dig.out.$n > /dev/null || ret=1
+      ;;
+    no-auth)
+      grep 'ADDITIONAL: 2' dig.out.$n > /dev/null || ret=1
+      ;;
+    no-auth-recursive)
+      grep 'ADDITIONAL: 2' dig.out.$n > /dev/null || ret=1
+      ;;
+    esac
+    if [ $ret -eq 1 ] ; then
+            echo_i " failed"; status=1
+    fi
 }
 
 echo_i "testing with 'minimal-responses yes;'"