]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
add a system test, confirming that named fails to reload without crashing
authorEvan Hunt <each@isc.org>
Thu, 25 Jul 2019 20:53:01 +0000 (16:53 -0400)
committerEvan Hunt <each@isc.org>
Sun, 28 Jul 2019 20:16:29 +0000 (13:16 -0700)
(cherry picked from commit 8f1cdaeed94fb9bdb4a7a4c8aeddae4ef4a0f805)

bin/tests/system/geoip/clean.sh
bin/tests/system/geoip/ns2/named15.conf.in
bin/tests/system/geoip/ns2/named16.conf.in [new file with mode: 0644]
bin/tests/system/geoip/tests.sh
util/copyrights

index d6fe94b852c933cea39938d7a52e9abe47192e02..1257fdae15ea41c8186fec1366f3fbcb76782b7b 100644 (file)
@@ -14,6 +14,6 @@ rm -f ns2/example*.db
 rm -f dig.out.* rndc.out.*
 rm -f data2/*dat
 [ -d data2 ] && rmdir data2
-rm -f ns?/named.run
+rm -f ns?/named.run ns?/named.run.*
 rm -f ns?/named.memstats
 rm -f ns*/named.lock
index 01ee377cba05e405677ad9e587d1097db9d55ee8..6e983caa2b017bb0fd70af371a7fc831fc957285 100644 (file)
@@ -36,7 +36,7 @@ view two {
        match-clients { geoip country US; };
        zone "example" {
                type master;
-               file "../ns2/example2.db";
+               file "example2.db";
        };
 };
 
diff --git a/bin/tests/system/geoip/ns2/named16.conf.in b/bin/tests/system/geoip/ns2/named16.conf.in
new file mode 100644 (file)
index 0000000..68c0e2c
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+
+// NS2
+
+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 { fd92:7065:b8e:ffff::2; };
+       recursion no;
+       dnssec-validation no;
+       geoip-directory "../data2";
+};
+
+key rndc_key {
+       secret "1234abcd8765";
+       algorithm hmac-sha256;
+};
+
+controls {
+       inet 10.53.0.2 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
+};
+
+view one {
+       match-clients { geoip continent EU; };
+       zone "example" {
+               type master;
+               file "example1.db";
+       };
+};
+
+view none {
+       zone "example" {
+               type master;
+               file "examplebogus.db";
+       };
+};
index cb1473af79aeed0efc637ebd9f8ca2f7021ee0a4..d9e03792f75df83c70d3d73675a8372a309c766a 100644 (file)
@@ -452,6 +452,7 @@ status=`expr $status + $ret`
 
 n=`expr $n + 1`
 echo_i "reloading server with different geoip-directory ($n)"
+ret=0
 copy_setports ns2/named15.conf.in ns2/named.conf
 $RNDCCMD 10.53.0.2 reload 2>&1 | sed 's/^/ns2 /' | cat_i
 sleep 3
@@ -473,6 +474,16 @@ fi
 [ $ret -eq 0 ] || echo_i "failed"
 status=`expr $status + $ret`
 
+n=`expr $n + 1`
+echo_i "reloading server with different geoip-directory, missing continent support ($n)"
+nextpart ns2/named.run > /dev/null
+copy_setports ns2/named16.conf.in ns2/named.conf
+$RNDCCMD 10.53.0.2 reload > /dev/null 2>&1
+sleep 3
+nextpart ns2/named.run | grep 'no GeoIP database installed' > /dev/null 2>&1 || ret=1
+[ $ret -eq 0 ] || echo_i "failed"
+status=`expr $status + $ret`
+
 n=`expr $n + 1`
 echo_i "checking other GeoIP options are parsed correctly ($n)"
 ret=0
index d6144f1d733c078bb0c46651eed2ab320675e42b..d1451a873e460942ea71bbb14510727d1600e64d 100644 (file)
 ./bin/tests/system/geoip/ns2/named13.conf.in   CONF-C  2018,2019
 ./bin/tests/system/geoip/ns2/named14.conf.in   CONF-C  2018,2019
 ./bin/tests/system/geoip/ns2/named15.conf.in   CONF-C  2018,2019
+./bin/tests/system/geoip/ns2/named16.conf.in   CONF-C  2019
 ./bin/tests/system/geoip/ns2/named2.conf.in    CONF-C  2018,2019
 ./bin/tests/system/geoip/ns2/named3.conf.in    CONF-C  2018,2019
 ./bin/tests/system/geoip/ns2/named4.conf.in    CONF-C  2018,2019