]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add inline-signing with $INCLUDE test
authorMatthijs Mekking <matthijs@isc.org>
Fri, 19 Mar 2021 14:21:17 +0000 (15:21 +0100)
committerMatthijs Mekking <matthijs@isc.org>
Wed, 14 Apr 2021 09:48:46 +0000 (11:48 +0200)
Add a test case for inline-signing for a zone with an $INCLUDE
statement. There is already a test for a missing include file, this
one adds a test for a zone with an include file that does exist.

Test if the record in the included file is loaded.

(cherry picked from commit 6463ee0f40046a75c98d1d7c2f46eb679d87a90b)

bin/tests/system/inline/ns3/include.db.in [new file with mode: 0644]
bin/tests/system/inline/ns3/master7.db.in [new file with mode: 0644]
bin/tests/system/inline/tests.sh

diff --git a/bin/tests/system/inline/ns3/include.db.in b/bin/tests/system/inline/ns3/include.db.in
new file mode 100644 (file)
index 0000000..7468708
--- /dev/null
@@ -0,0 +1 @@
+f              A       10.0.0.7
diff --git a/bin/tests/system/inline/ns3/master7.db.in b/bin/tests/system/inline/ns3/master7.db.in
new file mode 100644 (file)
index 0000000..cec8ad7
--- /dev/null
@@ -0,0 +1,24 @@
+; 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.
+
+$TTL 300       ; 5 minutes
+@                      IN SOA  ns3 . (
+                               2000042412 ; serial
+                               20         ; refresh (20 seconds)
+                               20         ; retry (20 seconds)
+                               1814400    ; expire (3 weeks)
+                               3600       ; minimum (1 hour)
+                               )
+                       NS      ns3
+ns3                    A       10.53.0.3
+
+c                      A       10.0.0.3
+e                      A       10.0.0.5
+
+$INCLUDE include.db
index eb967c980628469f277dc6a4d08a9dd2d7ad585e..d60f530894c91d63b0decebb441fccbf234b8854 100755 (executable)
@@ -962,6 +962,30 @@ $DIFF dig.out.ns3.test$n.1  dig.out.ns3.test$n.2 > /dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
+n=`expr $n + 1`
+echo_i "check inline-signing with an include file ($n)"
+ret=0
+$DIG $DIGOPTS +short @10.53.0.3 master SOA > dig.out.ns3.test$n.1 || ret=1
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=`expr $status + $ret`
+sleep 1
+nextpart ns3/named.run > /dev/null
+cp ns3/master7.db.in ns3/master.db
+rndc_reload ns3 10.53.0.3
+_includefile_loaded() {
+       $DIG $DIGOPTS @10.53.0.3 f.master A > dig.out.ns3.test$n
+       grep "status: NOERROR" dig.out.ns3.test$n > /dev/null || return 1
+       grep "ANSWER: 2," dig.out.ns3.test$n > /dev/null || return 1
+       grep "10\.0\.0\.7" dig.out.ns3.test$n > /dev/null || return 1
+       return 0
+}
+retry_quiet 10 _includefile_loaded
+# Sanity check: the SOA record should be changed
+$DIG $DIGOPTS +short @10.53.0.3 master SOA > dig.out.ns3.test$n.2 || ret=1
+$DIFF dig.out.ns3.test$n.1  dig.out.ns3.test$n.2 > /dev/null && ret=1
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=`expr $status + $ret`
+
 n=`expr $n + 1`
 echo_i "test add/del zone combinations ($n)"
 ret=0