]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
add a regression test for default allow-recursion settings
authorEvan Hunt <each@isc.org>
Wed, 6 Jun 2018 22:58:54 +0000 (15:58 -0700)
committerOndřej Surý <ondrej@sury.org>
Thu, 14 Jun 2018 12:48:46 +0000 (14:48 +0200)
bin/tests/system/allow-query/clean.sh
bin/tests/system/allow-query/ns1/named.conf.in [new file with mode: 0644]
bin/tests/system/allow-query/ns1/root.db [new file with mode: 0644]
bin/tests/system/allow-query/ns3/named.args [new file with mode: 0644]
bin/tests/system/allow-query/ns3/named.conf.in [new file with mode: 0644]
bin/tests/system/allow-query/setup.sh
bin/tests/system/allow-query/tests.sh
util/copyrights

index 0dc142ae31f058b51b2996ec98af9e6dab3cb900..fc20b0b0a44cfd59094af771c492671aeb1eab45 100644 (file)
@@ -19,6 +19,7 @@
 #
 
 rm -f dig.out.*
-rm -f ns2/named.conf ns2/controls.conf
+rm -f ns*/named.conf
+rm -f ns2/controls.conf
 rm -f */named.memstats
 rm -f ns*/named.run ns*/named.run.prev
diff --git a/bin/tests/system/allow-query/ns1/named.conf.in b/bin/tests/system/allow-query/ns1/named.conf.in
new file mode 100644 (file)
index 0000000..10de9f5
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+options {
+       port @PORT@;
+       pid-file "named.pid";
+       listen-on { 10.53.0.1; };
+       listen-on-v6 { none; };
+       recursion no;
+};
+
+zone "." {
+       type master;
+       file "root.db";
+};
diff --git a/bin/tests/system/allow-query/ns1/root.db b/bin/tests/system/allow-query/ns1/root.db
new file mode 100644 (file)
index 0000000..053d201
--- /dev/null
@@ -0,0 +1,21 @@
+; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+;
+; Permission to use, copy, modify, and/or distribute this software for any
+; purpose with or without fee is hereby granted, provided that the above
+; copyright notice and this permission notice appear in all copies.
+;
+; THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+; AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+; PERFORMANCE OF THIS SOFTWARE.
+
+$TTL 300
+@                      SOA     ns1. hostmaster.localhost. 1 3600 1200 604800 3600
+                       NS      ns1.
+ns1.                   A       10.53.0.1
+
+normal.example.                NS      ns2.normal.example.
+ns2.normal.example.    A       10.53.0.2
diff --git a/bin/tests/system/allow-query/ns3/named.args b/bin/tests/system/allow-query/ns3/named.args
new file mode 100644 (file)
index 0000000..410c635
--- /dev/null
@@ -0,0 +1,2 @@
+# this server only has 127.0.0.1 in its localhost/localnets ACLs
+-m record,size,mctx -c named.conf -d 99 -g -T clienttest -T fixedlocal
diff --git a/bin/tests/system/allow-query/ns3/named.conf.in b/bin/tests/system/allow-query/ns3/named.conf.in
new file mode 100644 (file)
index 0000000..e2e9f45
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+options {
+       port @PORT@;
+       pid-file "named.pid";
+       listen-on { 10.53.0.3; };
+       listen-on-v6 { none; };
+       recursion yes;
+       dnssec-validation no;
+};
+
+zone "." {
+       type hint;
+       file "../../common/root.hint";
+};
index d2620e0e57a304fec1355667de0eeee2407f3687..316d3593575ee6a1b73d40c4b91a768a30288df3 100644 (file)
@@ -18,4 +18,6 @@ SYSTEMTESTTOP=..
 . $SYSTEMTESTTOP/conf.sh
 
 copy_setports ../common/controls.conf.in ns2/controls.conf
+copy_setports  ns1/named.conf.in ns1/named.conf
 copy_setports  ns2/named01.conf.in ns2/named.conf
+copy_setports  ns3/named.conf.in ns3/named.conf
index 5d77ef6796aaa2768cd11a20f167ba5326246ed6..b00aa1b43fac72c67bc90fe5b18c1c40c3c1d81b 100644 (file)
@@ -607,5 +607,16 @@ grep '^a.aclnotallow.example' dig.out.ns2.2.$n > /dev/null && ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
+# Test 58 - allow-recursion inheritance
+n=`expr $n + 1`
+echo_i "test $n: default recursion configuration"
+ret=0
+$DIG -p ${PORT} @10.53.0.3 -b 127.0.0.1 a.normal.example a > dig.out.ns3.1.$n
+grep 'status: NOERROR' dig.out.ns3.1.$n > /dev/null || ret=1
+$DIG -p ${PORT} @10.53.0.3 -b 10.53.0.1 a.normal.example a > dig.out.ns3.2.$n
+grep 'status: REFUSED' dig.out.ns3.2.$n > /dev/null || 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 01888574133db761115a3c2545718e370bcb59a0..b458201f26ec247eba594e98e049764ca9968fa9 100644 (file)
 ./bin/tests/system/addzone/tests.sh            SH      2010,2011,2012,2013,2015,2016,2017,2018
 ./bin/tests/system/allow-query/.gitignore      X       2018
 ./bin/tests/system/allow-query/clean.sh                SH      2018
+./bin/tests/system/allow-query/ns1/named.conf.in       CONF-C  2018
+./bin/tests/system/allow-query/ns1/root.db     ZONE    2018
 ./bin/tests/system/allow-query/ns2/generic.db  ZONE    2018
 ./bin/tests/system/allow-query/ns2/named01.conf.in     CONF-C  2018
 ./bin/tests/system/allow-query/ns2/named02.conf.in     CONF-C  2018
 ./bin/tests/system/allow-query/ns2/named55.conf.in     CONF-C  2018
 ./bin/tests/system/allow-query/ns2/named56.conf.in     CONF-C  2018
 ./bin/tests/system/allow-query/ns2/named57.conf.in     CONF-C  2018
+./bin/tests/system/allow-query/ns3/named.args  X       2018
+./bin/tests/system/allow-query/ns3/named.conf.in       CONF-C  2018
 ./bin/tests/system/allow-query/setup.sh                SH      2018
 ./bin/tests/system/allow-query/tests.sh                SH      2018
 ./bin/tests/system/ans.pl                      PERL    2011,2012,2014,2017,2018