]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Test reconfig after adding inline signed zones won't crash named
authorDiego Fronza <diego@isc.org>
Fri, 12 Feb 2021 19:53:34 +0000 (16:53 -0300)
committerDiego Fronza <diego@isc.org>
Mon, 15 Feb 2021 14:15:20 +0000 (11:15 -0300)
This test ensures that named won't crash after many inline-signed zones
are added to configurarion, followed by a rndc reconfig.

bin/tests/system/views/clean.sh
bin/tests/system/views/ns2/named3.conf.in [new file with mode: 0644]
bin/tests/system/views/tests.sh

index 894b7ce0f7f41a39b88682456d508bb56de6209e..d4f2e6084c7278bad4e2c5b1ce03231a0509823f 100644 (file)
@@ -27,6 +27,8 @@ rm -f ns2/internal/K*
 rm -f ns2/internal/inline.db.jbk
 rm -f ns2/internal/inline.db.signed
 rm -f ns2/internal/inline.db.signed.jnl
+rm -f ns2/zones.conf
+rm -f ns2/db.* ns2/K*
 rm -f dig.out.external dig.out.internal
 rm -f ns*/named.lock
 rm -f ns*/managed-keys.bind* ns*/*.mkeys*
diff --git a/bin/tests/system/views/ns2/named3.conf.in b/bin/tests/system/views/ns2/named3.conf.in
new file mode 100644 (file)
index 0000000..9e36020
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+
+options {
+       query-source address 10.53.0.2;
+       notify-source 10.53.0.2;
+       transfer-source 10.53.0.2;
+       port @PORT@;
+       pid-file "named.pid";
+       listen-on { 10.53.0.2; };
+       listen-on-v6 { none; };
+       recursion no;
+       notify no;
+};
+
+key rndc_key {
+       secret "1234abcd8765";
+       algorithm hmac-sha256;
+};
+
+controls {
+       inet 10.53.0.2 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
+};
+
+include "zones.conf";
index 01ea650652506e506806e00ab1e31d9bb6142994..bb721c4c679c9d393cca5c24bdac062502f63b21 100644 (file)
@@ -132,5 +132,46 @@ test "$int" != "$ext" || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
+echo_i "verifying adding of multiple inline zones followed by reconfiguration works"
+
+[ ! -f ns2/zones.conf ] && touch ns2/zones.conf
+copy_setports ns2/named3.conf.in ns2/named.conf
+
+for i in `seq 1 50`; do
+       ret=0
+       zone_name=`printf "example%03d.com" $i`
+
+# Add a new zone to the configuration.
+       cat >> ns2/zones.conf << EOF
+zone "${zone_name}" {
+    type master;
+    file "db.${zone_name}";
+    dnssec-dnskey-kskonly yes;
+    auto-dnssec maintain;
+    inline-signing yes;
+};
+EOF
+
+# Create a master file for the zone.
+       cat > "ns2/db.${zone_name}" <<EOF
+\$TTL   86400
+@      IN  SOA localhost. hostmaster.localhost (
+                1612542642  ; serial
+                12H ; refresh
+                1H  ; retry
+                2w  ; expiry
+                1h  ; minimum
+        )
+
+        IN      NS      localhost
+localhost       IN      A       127.0.0.1
+EOF
+
+    $KEYGEN -q -Kns2 -fk -aecdsa256 ${zone_name} > /dev/null
+    $RNDCCMD 10.53.0.2 reconfig || ret=1
+    if [ $ret != 0 ]; then echo_i "failed"; break; fi
+done # end for #
+status=`expr $status + $ret`
+
 echo_i "exit status: $status"
 [ $status -eq 0 ] || exit 1