]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Added test for nsdname-wait-recurse option
authorDiego Fronza <diego@isc.org>
Mon, 2 Mar 2020 18:16:34 +0000 (15:16 -0300)
committerDiego Fronza <diego@isc.org>
Mon, 16 Mar 2020 18:18:46 +0000 (15:18 -0300)
bin/tests/system/rpzrecurse/clean.sh
bin/tests/system/rpzrecurse/ns3/named3.conf.in [new file with mode: 0644]
bin/tests/system/rpzrecurse/setup.sh
bin/tests/system/rpzrecurse/tests.sh

index ffd9dfd50a82ea5005311a3855493d7f580d3538..9117a241ebdc08cc3aa5b04e010824c9f7ef0488 100644 (file)
@@ -22,7 +22,7 @@ rm -f ns2/*.queries
 rm -f ns2/named.[0-9]*.conf
 rm -f ns2/named.conf.header
 
-rm -f ns3/named2.conf
+rm -f ns3/named.conf
 
 rm -f dnsrps*.conf dnsrpzd*
 rm -f ns*/session.key
diff --git a/bin/tests/system/rpzrecurse/ns3/named3.conf.in b/bin/tests/system/rpzrecurse/ns3/named3.conf.in
new file mode 100644 (file)
index 0000000..73470fa
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+
+include "../../common/rndc.key";
+
+controls {
+       inet 10.53.0.3 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
+};
+
+options {
+       query-source address 10.53.0.3;
+       notify-source 10.53.0.3;
+       transfer-source 10.53.0.3;
+       port @PORT@;
+       pid-file "named.pid";
+       listen-on { 10.53.0.3; };
+       listen-on-v6 { none; };
+       recursion yes;
+       dnssec-validation yes;
+       response-policy { zone "policy"; } nsdname-wait-recurse no
+               nsdname-enable yes;
+
+       include "../dnsrps.conf";
+};
+
+zone "policy" { type master; file "policy.db"; };
+
+zone "example.tld" { type master; file "example.db"; };
+
+zone "." { type master; file "root.db"; };
index 36786a72dee78092ae77f5808009b0f052f4ba21..9ab709fc9d78a7b12be33379e099fa75bdb0ad8e 100644 (file)
@@ -42,7 +42,6 @@ copy_setports ns2/named.conf.header.in ns2/named.conf.header
 copy_setports ns2/named.default.conf ns2/named.conf
 
 copy_setports ns3/named1.conf.in ns3/named.conf
-copy_setports ns3/named2.conf.in ns3/named2.conf
 
 copy_setports ns4/named.conf.in ns4/named.conf
 
index 3679d35c8f05b4786be3db1505e8fa6253c467ea..ca63987d0f492857d9c884625dc82ba445a90074 100644 (file)
@@ -493,10 +493,10 @@ for mode in native dnsrps; do
   $DIG -p ${PORT} @10.53.0.3 foo.child.example.tld a > dig.out.yes.$t
   t2=`$PERL -e 'print time()."\n";'`
   p1=`expr $t2 - $t1`
-  echo_i "elasped time $p1 seconds"
+  echo_i "elapsed time $p1 seconds"
 
   $RNDC  -c ../common/rndc.conf -s 10.53.0.3 -p ${CONTROLPORT} flush
-  cp -f ns3/named2.conf ns3/named.conf
+  copy_setports ns3/named2.conf.in ns3/named.conf
   $RNDC  -c ../common/rndc.conf -s 10.53.0.3 -p ${CONTROLPORT} reload > /dev/null
 
   echo_i "timing 'nsip-wait-recurse no'"
@@ -504,12 +504,44 @@ for mode in native dnsrps; do
   $DIG -p ${PORT} @10.53.0.3 foo.child.example.tld a > dig.out.no.$t
   t4=`$PERL -e 'print time()."\n";'`
   p2=`expr $t4 - $t3`
-  echo_i "elasped time $p2 seconds"
+  echo_i "elapsed time $p2 seconds"
 
   if test $p1 -le $p2; then ret=1; fi
   if test $ret != 0; then echo_i "failed"; fi
   status=`expr $status + $ret`
 
+  $RNDC  -c ../common/rndc.conf -s 10.53.0.3 -p ${CONTROLPORT} flush
+  # restore original named.conf
+  copy_setports ns3/named1.conf.in ns3/named.conf
+  $RNDC  -c ../common/rndc.conf -s 10.53.0.3 -p ${CONTROLPORT} reload > /dev/null
+
+  t=`expr $t + 1`
+  echo_i "checking 'nsdname-wait-recurse no' is faster than 'nsdname-wait-recurse yes' ($t)"
+  add_test_marker 10.53.0.2
+  echo_i "timing 'nsdname-wait-recurse yes' (default)"
+  ret=0
+  t1=`$PERL -e 'print time()."\n";'`
+  $DIG -p ${PORT} @10.53.0.3 foo.child.example.tld a > dig.out.yes.$t
+  t2=`$PERL -e 'print time()."\n";'`
+  p1=`expr $t2 - $t1`
+  echo_i "elapsed time $p1 seconds"
+
+  $RNDC  -c ../common/rndc.conf -s 10.53.0.3 -p ${CONTROLPORT} flush
+  copy_setports ns3/named3.conf.in ns3/named.conf
+  $RNDC  -c ../common/rndc.conf -s 10.53.0.3 -p ${CONTROLPORT} reload > /dev/null
+
+  echo_i "timing 'nsdname-wait-recurse no'"
+  t3=`$PERL -e 'print time()."\n";'`
+  $DIG -p ${PORT} @10.53.0.3 foo.child.example.tld a > dig.out.no.$t
+  t4=`$PERL -e 'print time()."\n";'`
+  p2=`expr $t4 - $t3`
+  echo_i "elapsed time $p2 seconds"
+
+  if test $p1 -le $p2; then ret=1; fi
+  if test $ret != 0; then echo_i "failed"; fi
+  status=`expr $status + $ret`
+
+
   [ $status -ne 0 ] && pf=fail || pf=pass
   case $mode in
   native)