]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Test grafting and synth-from-dnssec using primary zone
authorMark Andrews <marka@isc.org>
Mon, 20 Jun 2022 00:49:24 +0000 (10:49 +1000)
committerMark Andrews <marka@isc.org>
Tue, 5 Jul 2022 02:29:01 +0000 (12:29 +1000)
bin/tests/system/synthfromdnssec/ns2/named.conf.in
bin/tests/system/synthfromdnssec/ns5/internal2.db [new file with mode: 0644]
bin/tests/system/synthfromdnssec/ns5/named.conf.in
bin/tests/system/synthfromdnssec/tests.sh

index 736d428172e2fbbce3b0106793868e6093367b18..cc303072a2878147c2e071e66158865fbc81508c 100644 (file)
@@ -49,4 +49,9 @@ zone "example.internal" {
        file "example.internal.db";
 };
 
+zone "example.internal2" {
+       type primary;
+       file "example.internal.db";
+};
+
 include "../ns1/trusted.conf";
diff --git a/bin/tests/system/synthfromdnssec/ns5/internal2.db b/bin/tests/system/synthfromdnssec/ns5/internal2.db
new file mode 100644 (file)
index 0000000..4f07f70
--- /dev/null
@@ -0,0 +1,17 @@
+; 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     ns5 hostmaster 1 3600 1200 604800 3600
+@              NS      ns5
+ns5            A       10.53.0.5
+example                NS      ns2.example
+ns2.example    A       10.53.0.2
index a98ef39ddf38dd7287f46d0a0ab9e8f6957bfb3a..885708c767cc1616cfe201f9fc7fb375e44964fc 100644 (file)
@@ -52,4 +52,9 @@ zone "example.internal" {
        forwarders { 10.53.0.2; };
 };
 
+zone "internal2" {
+       type primary;
+       file "internal2.db";
+};
+
 include "../ns1/trusted.conf";
index f5383c97e2f334829a179883ddbd13242fb93c6b..aee907e2e0809f32638b390dc825de50103acf11 100644 (file)
@@ -884,5 +884,19 @@ n=$((n+1))
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=$((status+ret))
 
+echo_i "check synth-from-dnssec with grafted zone (primary zone) ($n)"
+ret=0
+#prime cache with NXDOMAIN NSEC covering 'fun' to 'minimal'
+dig_with_opts internal @10.53.0.5 > dig.out.ns5-1.test$n || ret=1
+grep "status: NXDOMAIN" dig.out.ns5-1.test$n >/dev/null || ret=1
+grep '^fun\..*NSEC.minimal\. ' dig.out.ns5-1.test$n >/dev/null || ret=1
+#perform lookup in grafted zone
+dig_with_opts example.internal2 @10.53.0.5 > dig.out.ns5-2.test$n || ret=1
+grep "status: NOERROR" dig.out.ns5-2.test$n >/dev/null || ret=1
+grep '^example\.internal2\..*A.1.2.3.4$' dig.out.ns5-2.test$n >/dev/null || ret=1
+n=$((n+1))
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=$((status+ret))
+
 echo_i "exit status: $status"
 [ $status -eq 0 ] || exit 1