From: Diego Fronza Date: Mon, 2 Mar 2020 18:16:34 +0000 (-0300) Subject: Added test for nsdname-wait-recurse option X-Git-Tag: v9.17.1~42^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fe1011152156f92773d8b9038147351926d87f74;p=thirdparty%2Fbind9.git Added test for nsdname-wait-recurse option --- diff --git a/bin/tests/system/rpzrecurse/clean.sh b/bin/tests/system/rpzrecurse/clean.sh index ffd9dfd50a8..9117a241ebd 100644 --- a/bin/tests/system/rpzrecurse/clean.sh +++ b/bin/tests/system/rpzrecurse/clean.sh @@ -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 index 00000000000..73470fafbd8 --- /dev/null +++ b/bin/tests/system/rpzrecurse/ns3/named3.conf.in @@ -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"; }; diff --git a/bin/tests/system/rpzrecurse/setup.sh b/bin/tests/system/rpzrecurse/setup.sh index 36786a72dee..9ab709fc9d7 100644 --- a/bin/tests/system/rpzrecurse/setup.sh +++ b/bin/tests/system/rpzrecurse/setup.sh @@ -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 diff --git a/bin/tests/system/rpzrecurse/tests.sh b/bin/tests/system/rpzrecurse/tests.sh index 3679d35c8f0..ca63987d0f4 100644 --- a/bin/tests/system/rpzrecurse/tests.sh +++ b/bin/tests/system/rpzrecurse/tests.sh @@ -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)