]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
add multi-view server and tests
authorMark Andrews <marka@isc.org>
Mon, 14 Jan 2019 05:40:00 +0000 (16:40 +1100)
committerEvan Hunt <each@isc.org>
Tue, 15 Jan 2019 02:31:02 +0000 (18:31 -0800)
(cherry picked from commit 7122b5786db12b0811f868977740e12e540488a0)
(cherry picked from commit 22b77f45b739a211c9524ce2528a2b41a809f19e)

bin/tests/system/mkeys/clean.sh
bin/tests/system/mkeys/ns6/named.conf.in [new file with mode: 0644]
bin/tests/system/mkeys/setup.sh
bin/tests/system/mkeys/tests.sh
util/copyrights

index 17bd50f27355d81b2f647b51c594528af9c49f57..8a70488737efa1f18524696f0dbef6a050276cab 100644 (file)
@@ -16,6 +16,7 @@ rm -f */managed-keys.bind* */named.secroots
 rm -f */managed.conf ns1/managed.key ns1/managed.key.id
 rm -f */named.memstats */named.run */named.run.prev
 rm -f dig.out* delv.out* rndc.out* signer.out*
-rm -f ns1/named.secroots ns1/root.db.signed* ns1/root.db.tmp
+rm -f ns1/root.db.signed* ns1/root.db.tmp
 rm -f */named.conf
 rm -f ns5/named.args
+rm -f ns6/view1.mkeys ns6/view2.mkeys
diff --git a/bin/tests/system/mkeys/ns6/named.conf.in b/bin/tests/system/mkeys/ns6/named.conf.in
new file mode 100644 (file)
index 0000000..37ddaa1
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * 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.
+ */
+
+// NS6
+
+options {
+       query-source address 10.53.0.6;
+       notify-source 10.53.0.6;
+       transfer-source 10.53.0.6;
+       port @PORT@;
+       pid-file "named.pid";
+       listen-on { 10.53.0.6; };
+       listen-on-v6 { none; };
+       recursion yes;
+       notify no;
+       dnssec-enable yes;
+       dnssec-validation auto;
+       bindkeys-file "managed.conf";
+};
+
+key rndc_key {
+       secret "1234abcd8765";
+       algorithm hmac-sha256;
+};
+
+controls {
+       inet 10.53.0.6 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
+};
+
+view view1 {
+       zone "." {
+               type hint;
+               file "../../common/root.hint";
+       };
+};
+
+view view2 {
+       zone "." {
+               type hint;
+               file "../../common/root.hint";
+       };
+};
index 202ddeb3ee08c2838226b64d518d07eb7ab70332..a8b6be46d08c89bc79fd5ef093924d3c96966007 100644 (file)
@@ -21,6 +21,7 @@ copy_setports ns1/named1.conf.in ns1/named.conf
 copy_setports ns2/named.conf.in ns2/named.conf
 copy_setports ns3/named.conf.in ns3/named.conf
 copy_setports ns5/named.conf.in ns5/named.conf
+copy_setports ns6/named.conf.in ns6/named.conf
 
 cp ns5/named1.args ns5/named.args
 
index 1e9097a5de88f4226f0ac8ba60ed14ad706eb7db..18facbf19561b7f4bcf6e921e3c3cf64c33844ec 100644 (file)
@@ -297,7 +297,7 @@ if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
 echo_i "reinitialize trust anchors"
-$PERL $SYSTEMTESTTOP/stop.pl --use-rndc mkeys ns2
+$PERL $SYSTEMTESTTOP/stop.pl --use-rndc --port ${CONTROLPORT} mkeys ns2
 rm -f ns2/managed-keys.bind*
 nextpart ns2/named.run > /dev/null
 $PERL $SYSTEMTESTTOP/start.pl --noclean --restart --port ${PORT} mkeys ns2
@@ -710,5 +710,20 @@ grep "status: NOERROR" dig.out.ns5.b.test$n > /dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
+n=`expr $n + 1`
+echo_i "check 'rndc managed-keys' and views ($n)"
+ret=0
+$RNDCCMD 10.53.0.6 managed-keys refresh in view1 > rndc.out.ns6.view1.test$n || ret=1
+grep "refreshing managed keys for 'view1'" rndc.out.ns6.view1.test$n > /dev/null || ret=1
+lines=`wc -l < rndc.out.ns6.view1.test$n`
+[ $lines -eq 1 ] || ret=1
+$RNDCCMD 10.53.0.6 managed-keys refresh > rndc.out.ns6.view2.test$n || ret=1
+lines=`wc -l < rndc.out.ns6.view2.test$n`
+grep "refreshing managed keys for 'view1'" rndc.out.ns6.view2.test$n > /dev/null || ret=1
+grep "refreshing managed keys for 'view2'" rndc.out.ns6.view2.test$n > /dev/null || ret=1
+[ $lines -eq 2 ] || ret=1
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=`expr $status + $ret`
+
 echo_i "exit status: $status"
 [ $status -eq 0 ] || exit 1
index 8ad19884419d0afd0a0eacf3b5abf15618d98ad9..2d1bbe867a1bcb01336b0fdc3e42f8f4c749f9f5 100644 (file)
 ./bin/tests/system/mkeys/ns5/named.conf.in     CONF-C  2018,2019
 ./bin/tests/system/mkeys/ns5/named1.args       X       2017,2018,2019
 ./bin/tests/system/mkeys/ns5/named2.args       X       2017,2018,2019
+./bin/tests/system/mkeys/ns6/named.conf.in     CONF-C  2019
 ./bin/tests/system/mkeys/prereq.sh             SH      2015,2016,2018,2019
 ./bin/tests/system/mkeys/setup.sh              SH      2015,2016,2017,2018,2019
 ./bin/tests/system/mkeys/tests.sh              SH      2015,2016,2017,2018,2019