From: Witold Kręcicki Date: Tue, 11 Dec 2018 11:59:11 +0000 (+0100) Subject: Use rndc_reload in tests, make sure that reload is complete before continuing X-Git-Tag: v9.13.6~89^2~1 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=6d501384058800aeb320e12e0aed570183fcccc5;p=thirdparty%2Fbind9.git Use rndc_reload in tests, make sure that reload is complete before continuing --- diff --git a/bin/tests/system/acl/tests.sh b/bin/tests/system/acl/tests.sh index 93e5c72afd1..fe49a86a0e2 100644 --- a/bin/tests/system/acl/tests.sh +++ b/bin/tests/system/acl/tests.sh @@ -33,7 +33,7 @@ $DIG $DIGOPTS tsigzone. \ grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo_i "test $t failed" ; status=1; } copy_setports ns2/named2.conf.in ns2/named.conf -$RNDCCMD 10.53.0.2 reload 2>&1 | sed 's/^/ns2 /' | cat_i +rndc_reload ns2 10.53.0.2 sleep 5 # prefix 10/8 should fail @@ -56,7 +56,7 @@ grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo_i "test $t failed" ; status=1; echo_i "testing nested ACL processing" # all combinations of 10.53.0.{1|2} with key {one|two}, should succeed copy_setports ns2/named3.conf.in ns2/named.conf -$RNDCCMD 10.53.0.2 reload 2>&1 | sed 's/^/ns2 /' | cat_i +rndc_reload ns2 10.53.0.2 sleep 5 # should succeed @@ -102,7 +102,7 @@ grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo_i "test $t failed" ; status=1; # now we only allow 10.53.0.1 *and* key one, or 10.53.0.2 *and* key two copy_setports ns2/named4.conf.in ns2/named.conf -$RNDCCMD 10.53.0.2 reload 2>&1 | sed 's/^/ns2 /' | cat_i +rndc_reload ns2 10.53.0.2 sleep 5 # should succeed @@ -137,7 +137,7 @@ grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo_i "test $t failed" ; status=1; echo_i "testing allow-query-on ACL processing" copy_setports ns2/named5.conf.in ns2/named.conf -$RNDCCMD 10.53.0.2 reload 2>&1 | sed 's/^/ns2 /' | cat_i +rndc_reload ns2 10.53.0.2 sleep 5 t=`expr $t + 1` $DIG -p ${PORT} +tcp soa example. \ @@ -161,7 +161,7 @@ grep "Transfer failed." dig.out.${t} >/dev/null 2>&1 || ret=1 status=`expr $status + $ret` echo_i "calling rndc reconfig" -$RNDCCMD 10.53.0.3 reconfig 2>&1 | sed 's/^/ns3 /' | cat_i +rndc_reconfig ns3 10.53.0.3 sleep 1 @@ -190,7 +190,7 @@ grep "Transfer failed." dig.out.${t} >/dev/null 2>&1 || ret=1 status=`expr $status + $ret` echo_i "calling rndc reconfig" -$RNDCCMD 10.53.0.4 reconfig 2>&1 | sed 's/^/ns4 /' | cat_i +rndc_reconfig ns4 10.53.0.4 sleep 1 diff --git a/bin/tests/system/additional/tests.sh b/bin/tests/system/additional/tests.sh index 692af541ff3..6819ec62245 100644 --- a/bin/tests/system/additional/tests.sh +++ b/bin/tests/system/additional/tests.sh @@ -218,8 +218,7 @@ dotests echo_i "reconfiguring server: minimal-responses no" copy_setports ns1/named2.conf.in ns1/named.conf -$RNDCCMD 10.53.0.1 reconfig 2>&1 | sed 's/^/ns1 /' | cat_i -sleep 2 +rndc_reconfig ns1 10.53.0.1 echo_i "testing with 'minimal-responses no;'" minimal=no @@ -236,8 +235,7 @@ fi echo_i "reconfiguring server: minimal-any yes" copy_setports ns1/named3.conf.in ns1/named.conf -$RNDCCMD 10.53.0.1 reconfig 2>&1 | sed 's/^/ns1 /' | cat_i -sleep 2 +rndc_reconfig ns1 10.53.0.1 n=`expr $n + 1` echo_i "testing with 'minimal-any yes;' over UDP ($n)" @@ -272,8 +270,7 @@ dotests echo_i "reconfiguring server: minimal-responses no-auth-recursive" copy_setports ns1/named4.conf.in ns1/named.conf -$RNDCCMD 10.53.0.1 reconfig 2>&1 | sed 's/^/ns1 /' | cat_i -sleep 2 +rndc_reconfig ns1 10.53.0.1 echo_i "testing with 'minimal-responses no-auth-recursive;'" minimal=no-auth-recursive @@ -303,8 +300,7 @@ fi echo_i "reconfiguring server: minimal-responses no" copy_setports ns1/named2.conf.in ns1/named.conf -$RNDCCMD 10.53.0.1 reconfig 2>&1 | sed 's/^/ns1 /' | cat_i -sleep 2 +rndc_reconfig ns1 10.53.0.1 n=`expr $n + 1` echo_i "testing NS handling in ANY responses (authoritative) ($n)" diff --git a/bin/tests/system/addzone/tests.sh b/bin/tests/system/addzone/tests.sh index b5ca0f782b1..21495c7ad92 100755 --- a/bin/tests/system/addzone/tests.sh +++ b/bin/tests/system/addzone/tests.sh @@ -469,8 +469,7 @@ status=`expr $status + $ret` echo_i "reconfiguring server with multiple views" rm -f ns2/named.conf copy_setports ns2/named2.conf.in ns2/named.conf -$RNDCCMD 10.53.0.2 reconfig 2>&1 | sed 's/^/I:ns2 /' -sleep 5 +rndc_reconfig ns2 10.53.0.2 echo_i "adding new zone to external view ($n)" # NOTE: The internal view has "recursion yes" set, and so queries for @@ -591,8 +590,7 @@ status=`expr $status + $ret` echo_i "reconfiguring server with multiple views and new-zones-directory" rm -f ns2/named.conf copy_setports ns2/named3.conf.in ns2/named.conf -$RNDCCMD 10.53.0.2 reconfig 2>&1 | sed 's/^/I:ns2 /' -sleep 5 +rndc_reconfig ns2 10.53.0.2 echo_i "checking new zone is still loaded after dir change ($n)" ret=0 @@ -659,8 +657,7 @@ status=`expr $status + $ret` echo_i "ensure the configuration context is cleaned up correctly ($n)" ret=0 -$RNDCCMD 10.53.0.2 reconfig > /dev/null 2>&1 || ret=1 -sleep 5 +rndc_reconfig ns2 10.53.0.2 $RNDCCMD 10.53.0.2 status > /dev/null 2>&1 || ret=1 n=`expr $n + 1` if [ $ret != 0 ]; then echo_i "failed"; fi @@ -670,8 +667,7 @@ echo_i "check delzone after reconfig failure ($n)" ret=0 $RNDCCMD 10.53.0.3 addzone 'inlineslave.example. IN { type slave; file "inlineslave.db"; masterfile-format text; masters { testmaster; }; };' > /dev/null 2>&1 || ret=1 copy_setports ns3/named2.conf.in ns3/named.conf -$RNDCCMD 10.53.0.3 reconfig > /dev/null 2>&1 && ret=1 -sleep 5 +rndc_reconfgi ns3 10.53.0.3 $RNDCCMD 10.53.0.3 delzone inlineslave.example > /dev/null 2>&1 || ret=1 n=`expr $n + 1` if [ $ret != 0 ]; then echo_i "failed"; fi diff --git a/bin/tests/system/allow-query/tests.sh b/bin/tests/system/allow-query/tests.sh index a350c843321..479910c8250 100644 --- a/bin/tests/system/allow-query/tests.sh +++ b/bin/tests/system/allow-query/tests.sh @@ -55,14 +55,6 @@ SYSTEMTESTTOP=.. DIGOPTS="+tcp +nosea +nostat +nocmd +norec +noques +noauth +noadd +nostats +dnssec -p ${PORT}" -rndc_reload() { - echo_i "`$RNDC -c ../common/rndc.conf -s $2 -p ${CONTROLPORT} reload 2>&1 | sed 's/^/'$1' /'`" - for try in 0 1 2 3 4 5 6 7 8 9; do - nextpart $1/named.run | grep "reloading configuration succeeded" > /dev/null && break - sleep 1 - done -} - status=0 n=0 diff --git a/bin/tests/system/autosign/tests.sh b/bin/tests/system/autosign/tests.sh index a01a3eaac20..cf14a00de40 100755 --- a/bin/tests/system/autosign/tests.sh +++ b/bin/tests/system/autosign/tests.sh @@ -1227,7 +1227,7 @@ rekey_calls=`grep "zone reconf.example.*next key event" ns3/named.run | wc -l` [ "$rekey_calls" -eq 0 ] || ret=1 # ...then we add auto-dnssec and reconfigure $RNDCCMD 10.53.0.3 modzone reconf.example '{ type master; file "reconf.example.db"; allow-update { any; }; auto-dnssec maintain; };' 2>&1 | sed 's/^/ns3 /' | cat_i -$RNDCCMD 10.53.0.3 reconfig 2>&1 | sed 's/^/ns3 /' | cat_i +rndc_reconfig ns3 10.53.0.3 for i in 0 1 2 3 4 5 6 7 8 9; do lret=0 rekey_calls=`grep "zone reconf.example.*next key event" ns3/named.run | wc -l` diff --git a/bin/tests/system/builtin/tests.sh b/bin/tests/system/builtin/tests.sh index 391c239b614..2a0e795acb1 100644 --- a/bin/tests/system/builtin/tests.sh +++ b/bin/tests/system/builtin/tests.sh @@ -148,7 +148,7 @@ if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi n=`expr $n + 1` echo_i "Checking that reloading empty zones is silent ($n)" -$RNDCCMD 10.53.0.1 reload > /dev/null +rndc_reload ns1 10.53.0.1 ret=0 grep "automatic empty zone" ns1/named.run > /dev/null || ret=1 grep "received control channel command 'reload'" ns1/named.run > /dev/null || ret=1 diff --git a/bin/tests/system/conf.sh.common b/bin/tests/system/conf.sh.common index aceb5596cbe..a09968802f9 100644 --- a/bin/tests/system/conf.sh.common +++ b/bin/tests/system/conf.sh.common @@ -240,6 +240,26 @@ nextpartpeek() { nextpartread $1 2> /dev/null } +rndc_reload() { + echo_i "`$RNDC -c ../common/rndc.conf -s $2 -p ${CONTROLPORT} reload $3 2>&1 | sed 's/^/'$1' /'`" + # reloading single zone is synchronous, if we're reloading whole server + # we need to wait for reload to finish + if [ -z "$3" ]; then + for __try in 0 1 2 3 4 5 6 7 8 9; do + $RNDC -c ../common/rndc.conf -s $2 -p ${CONTROLPORT} status | grep "reload/reconfig in progress" > /dev/null || break; + sleep 1 + done + fi +} + +rndc_reconfig() { + echo_i "`$RNDC -c ../common/rndc.conf -s $2 -p ${CONTROLPORT} reconfig 2>&1 | sed 's/^/'$1' /'`" + for __try in 0 1 2 3 4 5 6 7 8 9; do + $RNDC -c ../common/rndc.conf -s $2 -p ${CONTROLPORT} status | grep "reload/reconfig in progress" > /dev/null || break; + sleep 1 + done +} + # # Export command paths # diff --git a/bin/tests/system/dlzexternal/tests.sh b/bin/tests/system/dlzexternal/tests.sh index 87dd13b10ec..85f5705a628 100644 --- a/bin/tests/system/dlzexternal/tests.sh +++ b/bin/tests/system/dlzexternal/tests.sh @@ -93,7 +93,7 @@ addr=`eval echo "$out" | cut -f1 -d'#'` status=`expr $status + $ret` newtest "testing DLZ driver is cleaned up on reload" -$RNDCCMD 10.53.0.1 reload 2>&1 | sed 's/^/ns1 /' | cat_i +rndc_reload ns1 10.53.0.1 for i in 0 1 2 3 4 5 6 7 8 9; do ret=0 grep 'dlz_example: shutting down zone example.nil' ns1/named.run > /dev/null 2>&1 || ret=1 diff --git a/bin/tests/system/dnssec/tests.sh b/bin/tests/system/dnssec/tests.sh index fc5e21e7e26..69fe4a84b71 100644 --- a/bin/tests/system/dnssec/tests.sh +++ b/bin/tests/system/dnssec/tests.sh @@ -1825,7 +1825,7 @@ lines=$(wc -l < rndc.out.ns4.test$n.1) rndccmd 10.53.0.4 nta secure.example 2>&1 | sed 's/^/ns4 /' | cat_i rndccmd 10.53.0.4 nta fakenode.secure.example 2>&1 | sed 's/^/ns4 /' | cat_i # reload should maintain NTAs -rndccmd 10.53.0.4 reload 2>&1 | sed 's/^/ns4 /' | cat_i +rndc_reload ns4 10.53.0.4 rndccmd 10.53.0.4 nta -d > rndc.out.ns4.test$n.2 lines=$(wc -l < rndc.out.ns4.test$n.2) [ "$lines" -eq 4 ] || ret=1 @@ -2788,7 +2788,7 @@ for file in K*.moved; do done $SIGNER -S -N increment -e now+1mi -o expiring.example expiring.example.db > /dev/null 2>&1 ) || ret=1 -rndccmd 10.53.0.3 reload expiring.example 2>&1 | sed 's/^/ns3 /' | cat_i +rndc_reload ns3 10.53.0.3 expiring.example rndccmd 10.53.0.4 flush 2>&1 | sed 's/^/ns4 /' | cat_i dig_with_answeropts +cd expiring.example soa @10.53.0.4 > dig.out.ns4.1.$n diff --git a/bin/tests/system/dyndb/tests.sh b/bin/tests/system/dyndb/tests.sh index 2bbff206b21..4215b1d40ec 100644 --- a/bin/tests/system/dyndb/tests.sh +++ b/bin/tests/system/dyndb/tests.sh @@ -145,7 +145,7 @@ grep "loading params for dyndb 'sample2' from .*named.conf:" ns1/named.run > /de status=`expr $status + $ret` echo_i "checking dyndb still works after reload" -$RNDCCMD 10.53.0.1 reload 2>&1 | sed 's/^/ns1 /' | cat_i +rndc_reload ns1 10.53.0.1 test_add test5.ipv4.example.nil. A "10.53.0.10" || ret=1 status=`expr $status + $ret` diff --git a/bin/tests/system/emptyzones/tests.sh b/bin/tests/system/emptyzones/tests.sh index 5872479211d..cf53e0a2dd0 100644 --- a/bin/tests/system/emptyzones/tests.sh +++ b/bin/tests/system/emptyzones/tests.sh @@ -21,8 +21,7 @@ n=0 n=`expr $n + 1` echo_i "check that switching to automatic empty zones works ($n)" ret=0 -$RNDCCMD 10.53.0.1 reload > /dev/null || ret=1 -sleep 5 +rndc_reload ns1 10.53.0.1 copy_setports ns1/named2.conf.in ns1/named.conf $RNDCCMD 10.53.0.1 reload > /dev/null || ret=1 diff --git a/bin/tests/system/fetchlimit/tests.sh b/bin/tests/system/fetchlimit/tests.sh index d7fb00a4935..f360a86bcd7 100644 --- a/bin/tests/system/fetchlimit/tests.sh +++ b/bin/tests/system/fetchlimit/tests.sh @@ -116,7 +116,7 @@ if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` copy_setports ns3/named2.conf.in ns3/named.conf -$RNDCCMD reconfig 2>&1 | sed 's/^/ns3 /' | cat_i +rndc_reconfig ns3 10.53.0.3 echo_i "checking lame server clients are dropped at the per-domain limit" ret=0 @@ -155,7 +155,7 @@ if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` copy_setports ns3/named3.conf.in ns3/named.conf -$RNDCCMD reconfig 2>&1 | sed 's/^/ns3 /' | cat_i +rndc_reconfig ns3 10.53.0.3 echo_i "checking lame server clients are dropped near the soft limit" ret=0 diff --git a/bin/tests/system/filter-aaaa/tests.sh b/bin/tests/system/filter-aaaa/tests.sh index f9b4d882b9e..ee497b8d298 100644 --- a/bin/tests/system/filter-aaaa/tests.sh +++ b/bin/tests/system/filter-aaaa/tests.sh @@ -749,13 +749,13 @@ $TESTSOCK6 fd92:7065:b8e:ffff::1 || { # Reconfiguring for IPv6 tests echo_i "reconfiguring servers" copy_setports ns1/named2.conf.in ns1/named.conf -$RNDCCMD 10.53.0.1 reconfig 2>&1 | sed 's/^/ns1 /' | cat_i +rndc_reconfig ns1 10.53.0.1 copy_setports ns2/named2.conf.in ns2/named.conf -$RNDCCMD 10.53.0.2 reconfig 2>&1 | sed 's/^/ns2 /' | cat_i +rndc_reconfig ns2 10.53.0.2 copy_setports ns3/named2.conf.in ns3/named.conf -$RNDCCMD 10.53.0.3 reconfig 2>&1 | sed 's/^/ns3 /' | cat_i +rndc_reconfig ns3 10.53.0.3 copy_setports ns4/named2.conf.in ns4/named.conf -$RNDCCMD 10.53.0.4 reconfig 2>&1 | sed 's/^/ns4 /' | cat_i +rndc_reconfig ns4 10.53.0.4 # BEGIN IPv6 TESTS diff --git a/bin/tests/system/geoip/tests.sh b/bin/tests/system/geoip/tests.sh index 0722b420c6f..a0c6d0640c5 100644 --- a/bin/tests/system/geoip/tests.sh +++ b/bin/tests/system/geoip/tests.sh @@ -37,7 +37,7 @@ status=`expr $status + $ret` echo_i "reloading server" copy_setports ns2/named2.conf.in ns2/named.conf -$RNDCCMD 10.53.0.2 reload 2>&1 | sed 's/^/ns2 /' | cat_i +rndc_reload ns2 10.53.0.2 sleep 3 n=`expr $n + 1` @@ -56,7 +56,7 @@ status=`expr $status + $ret` echo_i "reloading server" copy_setports ns2/named3.conf.in ns2/named.conf -$RNDCCMD 10.53.0.2 reload 2>&1 | sed 's/^/ns2 /' | cat_i +rndc_reload ns2 10.53.0.2 sleep 3 n=`expr $n + 1` @@ -75,7 +75,7 @@ status=`expr $status + $ret` echo_i "reloading server" copy_setports ns2/named4.conf.in ns2/named.conf -$RNDCCMD 10.53.0.2 reload 2>&1 | sed 's/^/ns2 /' | cat_i +rndc_reload ns2 10.53.0.2 sleep 3 n=`expr $n + 1` @@ -95,7 +95,7 @@ status=`expr $status + $ret` echo_i "reloading server" copy_setports ns2/named5.conf.in ns2/named.conf -$RNDCCMD 10.53.0.2 reload 2>&1 | sed 's/^/ns2 /' | cat_i +rndc_reload ns2 10.53.0.2 sleep 3 n=`expr $n + 1` @@ -115,7 +115,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo_i "reloading server" copy_setports ns2/named6.conf.in ns2/named.conf -$RNDCCMD 10.53.0.2 reload 2>&1 | sed 's/^/ns2 /' | cat_i +rndc_reload ns2 10.53.0.2 sleep 3 if $TESTSOCK6 fd92:7065:b8e:ffff::3 @@ -146,7 +146,7 @@ status=`expr $status + $ret` echo_i "reloading server" copy_setports ns2/named7.conf.in ns2/named.conf -$RNDCCMD 10.53.0.2 reload 2>&1 | sed 's/^/ns2 /' | cat_i +rndc_reload ns2 10.53.0.2 sleep 3 n=`expr $n + 1` @@ -165,7 +165,7 @@ status=`expr $status + $ret` echo_i "reloading server" copy_setports ns2/named8.conf.in ns2/named.conf -$RNDCCMD 10.53.0.2 reload 2>&1 | sed 's/^/ns2 /' | cat_i +rndc_reload ns2 10.53.0.2 sleep 3 n=`expr $n + 1` @@ -184,7 +184,7 @@ status=`expr $status + $ret` echo_i "reloading server" copy_setports ns2/named9.conf.in ns2/named.conf -$RNDCCMD 10.53.0.2 reload 2>&1 | sed 's/^/ns2 /' | cat_i +rndc_reload ns2 10.53.0.2 sleep 3 n=`expr $n + 1` @@ -203,7 +203,7 @@ status=`expr $status + $ret` echo_i "reloading server" copy_setports ns2/named10.conf.in ns2/named.conf -$RNDCCMD 10.53.0.2 reload 2>&1 | sed 's/^/ns2 /' | cat_i +rndc_reload ns2 10.53.0.2 sleep 3 n=`expr $n + 1` @@ -222,7 +222,7 @@ status=`expr $status + $ret` echo_i "reloading server" copy_setports ns2/named11.conf.in ns2/named.conf -$RNDCCMD 10.53.0.2 reload 2>&1 | sed 's/^/ns2 /' | cat_i +rndc_reload ns2 10.53.0.2 sleep 3 n=`expr $n + 1` @@ -241,7 +241,7 @@ status=`expr $status + $ret` echo_i "reloading server" copy_setports ns2/named12.conf.in ns2/named.conf -$RNDCCMD 10.53.0.2 reload 2>&1 | sed 's/^/ns2 /' | cat_i +rndc_reload ns2 10.53.0.2 sleep 3 n=`expr $n + 1` @@ -260,7 +260,7 @@ status=`expr $status + $ret` echo_i "reloading server" copy_setports ns2/named13.conf.in ns2/named.conf -$RNDCCMD 10.53.0.2 reload 2>&1 | sed 's/^/ns2 /' | cat_i +rndc_reload ns2 10.53.0.2 sleep 3 n=`expr $n + 1` @@ -273,7 +273,7 @@ status=`expr $status + $ret` echo_i "reloading server" copy_setports ns2/named14.conf.in ns2/named.conf -$RNDCCMD 10.53.0.2 reload 2>&1 | sed 's/^/ns2 /' | cat_i +rndc_reload ns2 10.53.0.2 sleep 3 n=`expr $n + 1` @@ -293,7 +293,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo_i "reloading server with different geoip-directory ($n)" copy_setports ns2/named15.conf.in ns2/named.conf -$RNDCCMD 10.53.0.2 reload 2>&1 | sed 's/^/ns2 /' | cat_i +rndc_reload ns2 10.53.0.2 sleep 3 awk '/using "..\/data2" as GeoIP directory/ {m=1} ; { if (m>0) { print } }' ns2/named.run | grep "GeoIP City .* DB not available" > /dev/null || ret=1 [ $ret -eq 0 ] || echo_i "failed" diff --git a/bin/tests/system/inline/tests.sh b/bin/tests/system/inline/tests.sh index 3dd2804e048..15a2c012dcf 100755 --- a/bin/tests/system/inline/tests.sh +++ b/bin/tests/system/inline/tests.sh @@ -332,7 +332,7 @@ n=`expr $n + 1` echo_i "check adding of record to unsigned master ($n)" ret=0 cp ns3/master2.db.in ns3/master.db -$RNDCCMD 10.53.0.3 reload master 2>&1 | sed 's/^/ns3 /' | cat_i +rndc_reload ns3 10.53.0.3 master for i in 1 2 3 4 5 6 7 8 9 do ans=0 @@ -350,7 +350,7 @@ n=`expr $n + 1` echo_i "check adding record fails when SOA serial not changed ($n)" ret=0 echo "c A 10.0.0.3" >> ns3/master.db -$RNDCCMD 10.53.0.3 reload 2>&1 | sed 's/^/ns3 /' | cat_i +rndc_reload ns3 10.53.0.3 sleep 1 $DIG $DIGOPTS @10.53.0.3 c.master A > dig.out.ns3.test$n grep "NXDOMAIN" dig.out.ns3.test$n > /dev/null || ret=1 @@ -605,7 +605,7 @@ status=`expr $status + $ret` copy_setports ns5/named.conf.post ns5/named.conf (cd ns5; $KEYGEN -q -a rsasha256 bits) > /dev/null 2>&1 (cd ns5; $KEYGEN -q -a rsasha256 -f KSK bits) > /dev/null 2>&1 -$RNDCCMD 10.53.0.5 reload 2>&1 | sed 's/^/ns5 /' | cat_i +rndc_reload ns5 10.53.0.5 for i in 1 2 3 4 5 6 7 8 9 10 do ret=0 @@ -909,7 +909,7 @@ ret=1 sleep 1 nextpart ns3/named.run > /dev/null cp ns3/master5.db.in ns3/master.db -$RNDCCMD 10.53.0.3 reload 2>&1 | sed 's/^/ns3 /' | cat_i +rndc_reload ns3 10.53.0.3 for i in 1 2 3 4 5 6 7 8 9 10 do if nextpart ns3/named.run | grep "zone master.*sending notifies" > /dev/null; then diff --git a/bin/tests/system/ixfr/tests.sh b/bin/tests/system/ixfr/tests.sh index 70c8103627e..d023eef3024 100644 --- a/bin/tests/system/ixfr/tests.sh +++ b/bin/tests/system/ixfr/tests.sh @@ -54,7 +54,7 @@ zone "nil" { }; EOF -$RNDCCMD 10.53.0.1 reload | sed 's/^/ns1 /' | cat_i +rndc_reload ns1 10.53.0.1 for i in 0 1 2 3 4 5 6 7 8 9 do diff --git a/bin/tests/system/masterformat/tests.sh b/bin/tests/system/masterformat/tests.sh index 6d2fbc7783c..31f4164f546 100755 --- a/bin/tests/system/masterformat/tests.sh +++ b/bin/tests/system/masterformat/tests.sh @@ -319,7 +319,7 @@ echo_i "checking map format zone is scheduled for resigning (signzone) ($n)" ret=0 rndccmd 10.53.0.1 freeze signed > rndc.out 2>&1 || ret=1 (cd ns1 || exit 1; $SIGNER -S -O map -f signed.db.map -o signed signed.db > /dev/null 2>&1) -rndccmd 10.53.0.1 reload signed > rndc.out 2>&1 || ret=1 +rndc_reload ns1 10.53.0.1 signed rndccmd 10.53.0.1 zonestatus signed > rndc.out 2>&1 || ret=1 grep 'next resign' rndc.out > /dev/null 2>&1 || ret=1 n=$((n+1)) diff --git a/bin/tests/system/mirror/tests.sh b/bin/tests/system/mirror/tests.sh index 4ffcd25698a..074e82a4514 100644 --- a/bin/tests/system/mirror/tests.sh +++ b/bin/tests/system/mirror/tests.sh @@ -45,7 +45,7 @@ wait_for_load() { reload_zone() { zone=$1 serial=$2 - $RNDCCMD 10.53.0.2 reload > /dev/null 2>&1 + rndc_reload ns2 10.53.0.2 wait_for_load $zone $serial ns2/named.run } @@ -303,7 +303,7 @@ nextpart ns2/named.run | grep "query 'foo.initially-unavailable/A/IN'" > /dev/nu # Reconfigure ns2 so that the zone can be mirrored on ns3. sed "s/10.53.0.254/10.53.0.3/;" ns2/named.conf > ns2/named.conf.modified mv ns2/named.conf.modified ns2/named.conf -$RNDCCMD 10.53.0.2 reconfig > /dev/null 2>&1 +rndc_reconfig ns2 10.53.0.2 # Flush the cache on ns3 and retransfer the mirror zone. $RNDCCMD 10.53.0.3 flush > /dev/null 2>&1 nextpart ns3/named.run > /dev/null @@ -326,7 +326,7 @@ ret=0 # mirrored on ns3. sed "s/10.53.0.3/10.53.0.254/;" ns2/named.conf > ns2/named.conf.modified mv ns2/named.conf.modified ns2/named.conf -$RNDCCMD 10.53.0.2 reconfig > /dev/null 2>&1 +rndc_reconfig ns2 10.53.0.2 # Stop ns3, update the timestamp of the zone file to one far in the past, then # restart ns3. $PERL $SYSTEMTESTTOP/stop.pl --use-rndc --port ${CONTROLPORT} mirror ns3 @@ -394,7 +394,7 @@ sed '/^zone "verify-reconfig" {$/,/^};$/ { }' ns3/named.conf > ns3/named.conf.modified mv ns3/named.conf.modified ns3/named.conf nextpart ns3/named.run > /dev/null -$RNDCCMD 10.53.0.3 reconfig > /dev/null 2>&1 +rndc_reconfig ns3 10.53.0.3 # Zones whose type was changed should not be reusable, which means the tested # zone should have been reloaded from disk. wait_for_load verify-reconfig ${ORIGINAL_SERIAL} ns3/named.run @@ -418,7 +418,7 @@ sed '/^zone "verify-reconfig" {$/,/^};$/ { s/type slave;/type mirror;/ }' ns3/named.conf > ns3/named.conf.modified mv ns3/named.conf.modified ns3/named.conf -$RNDCCMD 10.53.0.3 reconfig > /dev/null 2>&1 +rndc_reconfig ns3 10.53.0.3 # The reconfigured zone should fail verification. wait_for_load verify-reconfig ${UPDATED_SERIAL_BAD} ns3/named.run $DIG $DIGOPTS @10.53.0.3 +norec verify-reconfig SOA > dig.out.ns3.test$n 2>&1 || ret=1 diff --git a/bin/tests/system/mkeys/tests.sh b/bin/tests/system/mkeys/tests.sh index e8c2923c20e..4b502ab82f5 100644 --- a/bin/tests/system/mkeys/tests.sh +++ b/bin/tests/system/mkeys/tests.sh @@ -35,7 +35,7 @@ mkeys_reconfig_on() { mkeys_reload_on() { nsidx=$1 nextpart ns${nsidx}/named.run > /dev/null - $RNDCCMD 10.53.0.${nsidx} reload . | sed "s/^/ns${nsidx} /" | cat_i + rndc_reload ns${nsidx} 10.53.0.${nsidx} wait_for_log "loaded serial" ns${nsidx}/named.run } diff --git a/bin/tests/system/notify/tests.sh b/bin/tests/system/notify/tests.sh index 1be2b4712e3..728c6c2af65 100644 --- a/bin/tests/system/notify/tests.sh +++ b/bin/tests/system/notify/tests.sh @@ -94,7 +94,7 @@ if [ ! "$CYGWIN" ]; then $KILL -HUP `cat ns2/named.pid` else echo_i "reloading with example2 using rndc and waiting up to 45 seconds" - $RNDCCMD 10.53.0.2 reload 2>&1 | sed 's/^/I:ns2 /' + rndc_reload ns2 10.53.0.2 fi try=0 diff --git a/bin/tests/system/nsupdate/tests.sh b/bin/tests/system/nsupdate/tests.sh index 9762a0f8916..dd0286fe48d 100755 --- a/bin/tests/system/nsupdate/tests.sh +++ b/bin/tests/system/nsupdate/tests.sh @@ -378,7 +378,7 @@ if [ ! "$CYGWIN" ]; then $KILL -HUP `cat ns2/named.pid` else echo_i "reload slave" - $RNDCCMD 10.53.0.2 reload > /dev/null 2>&1 + rndc_reload ns2 10.53.0.2 fi sleep 5 @@ -401,7 +401,7 @@ if [ ! "$CYGWIN" ]; then $KILL -HUP `cat ns2/named.pid` else echo_i "reload slave again" - $RNDCCMD 10.53.0.2 reload > /dev/null 2>&1 + rndc_reload ns2 10.53.0.2 fi sleep 5 diff --git a/bin/tests/system/redirect/tests.sh b/bin/tests/system/redirect/tests.sh index 0e2adf77b83..546e4b136f6 100644 --- a/bin/tests/system/redirect/tests.sh +++ b/bin/tests/system/redirect/tests.sh @@ -353,8 +353,7 @@ ret=0 sleep 1 # ensure file mtime will have changed sed -e 's/0 0 0 0 0/1 0 0 0 0/' < ns2/example.db.in > ns2/example.db sed -e 's/0 0 0 0 0/1 0 0 0 0/' -e 's/\.1$/.2/' < ns2/redirect.db.in > ns2/redirect.db -$RNDCCMD 10.53.0.2 reload > rndc.out || ret=1 -sed 's/^/ns2 /' rndc.out | cat_i +rndc_reload ns2 10.53.0.2 for i in 1 2 3 4 5 6 7 8 9; do tmp=0 $DIG $DIGOPTS +short @10.53.0.2 soa example.nil > dig.out.ns1.test$n || tmp=1 diff --git a/bin/tests/system/resolver/tests.sh b/bin/tests/system/resolver/tests.sh index 75ab5c06622..89e74cd1d0d 100755 --- a/bin/tests/system/resolver/tests.sh +++ b/bin/tests/system/resolver/tests.sh @@ -406,8 +406,7 @@ ret=0 $DIG $DIGOPTS @10.53.0.5 www.to-be-removed.tld A > dig.ns5.prime.${n} grep "status: NOERROR" dig.ns5.prime.${n} > /dev/null || { ret=1; echo_i "priming failed"; } cp ns4/tld2.db ns4/tld.db -($RNDCCMD 10.53.0.4 reload tld 2>&1 ) | -sed -e '/reload queued/d' -e 's/^/ns4 /' | cat_i +rndc_reload ns4 10.53.0.4 tld old= for i in 0 1 2 3 4 5 6 7 8 9 do diff --git a/bin/tests/system/rpz/tests.sh b/bin/tests/system/rpz/tests.sh index 84537e472de..89b8c1738f4 100644 --- a/bin/tests/system/rpz/tests.sh +++ b/bin/tests/system/rpz/tests.sh @@ -543,12 +543,12 @@ EOF addr 127.0.0.17 "a4-4.tld2 -b $ns1" # 17 client-IP address trigger nxdomain a7-1.tld2 # 18 slave policy zone (RT34450) cp ns2/blv2.tld2.db.in ns2/bl.tld2.db - $RNDCCMD $ns2 reload bl.tld2 | sed 's/^/ns2 /' | cat_i + rndc_reload ns2 $ns2 bl.tld2 ck_soa 2 bl.tld2 $ns3 nochange a7-1.tld2 # 19 PASSTHRU sleep 1 # ensure that a clock tick has occured so that named will do the reload cp ns2/blv3.tld2.db.in ns2/bl.tld2.db - $RNDCCMD $ns2 reload bl.tld2 | sed 's/^/ns2 /' | cat_i + rndc_reload ns2 $ns2 bl.tld2 ck_soa 3 bl.tld2 $ns3 nxdomain a7-1.tld2 # 20 slave policy zone (RT34450) end_group @@ -780,7 +780,7 @@ EOF echo_i "checking that going from an empty policy zone works (${t})" nsd $ns5 add '*.x.servfail.policy2.' x.servfail.policy2. sleep 1 - $RNDCCMD $ns7 reload policy2 | sed 's/^/ns7 /' | cat_i + rndc_reload ns7 $ns7 policy2 $DIG z.x.servfail -p ${PORT} @$ns7 > dig.out.${t} grep NXDOMAIN dig.out.${t} > /dev/null || setret "failed" diff --git a/bin/tests/system/rpzrecurse/tests.sh b/bin/tests/system/rpzrecurse/tests.sh index 2e1813622de..dfc10b7ccf5 100644 --- a/bin/tests/system/rpzrecurse/tests.sh +++ b/bin/tests/system/rpzrecurse/tests.sh @@ -320,7 +320,7 @@ for mode in native dnsrps; do sleep 1 echo_i "removing the policy zone" cp ns2/named.default.conf ns2/named.conf - $RNDC -c ../common/rndc.conf -s 10.53.0.2 -p ${CONTROLPORT} reconfig 2>&1 | sed 's/^/I:ns2 /' | cat_i + rndc_reconfig ns2 10.53.0.2 test -f dnsrpzd.pid && $KILL -USR1 `cat dnsrpzd.pid` sleep 1 echo_i "resuming authority server" diff --git a/bin/tests/system/serve-stale/tests.sh b/bin/tests/system/serve-stale/tests.sh index c3460b8fe37..b6dea112604 100755 --- a/bin/tests/system/serve-stale/tests.sh +++ b/bin/tests/system/serve-stale/tests.sh @@ -354,8 +354,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo_i "running 'rndc reload' ($n)" ret=0 -$RNDCCMD 10.53.0.1 reload > rndc.out.test$n 2>&1 || ret=1 -grep "server reload successful" rndc.out.test$n > /dev/null || ret=1 +rndc_reload ns1 10.53.0.1 if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` diff --git a/bin/tests/system/staticstub/tests.sh b/bin/tests/system/staticstub/tests.sh index 95cad164f43..cda9fe5fcaf 100755 --- a/bin/tests/system/staticstub/tests.sh +++ b/bin/tests/system/staticstub/tests.sh @@ -102,7 +102,7 @@ grep "1st sub test data" dig.out.ns2.test1.$n > /dev/null || ret=1 # temporarily disable the the parent zone copy_setports ns3/named.conf.in tmp sed 's/EXAMPLE_ZONE_PLACEHOLDER//' tmp > ns3/named.conf -$RNDCCMD 10.53.0.3 reload 2>&1 | sed 's/^/ns3 /' | cat_i +rndc_reload ns3 10.53.0.3 # query the child zone again. this should directly go to the child and # succeed. for i in 0 1 2 3 4 5 6 7 8 9 @@ -115,7 +115,7 @@ grep "2nd sub test data" dig.out.ns2.test2.$n > /dev/null || ret=1 # re-enable the parent copy_setports ns3/named.conf.in tmp sed 's/EXAMPLE_ZONE_PLACEHOLDER/zone "example" { type master; file "example.db.signed"; };/' tmp > ns3/named.conf -$RNDCCMD 10.53.0.3 reload 2>&1 | sed 's/^/ns3 /' | cat_i +rndc_reload ns3 10.53.0.3 if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` @@ -128,7 +128,7 @@ grep "10.53.0.4" dig.out.ns2.test1.$n > /dev/null || ret=1 $DIG $DIGOPTS +tcp example. @10.53.0.2 aaaa > dig.out.ns2.test2.$n || ret=1 grep "::1" dig.out.ns2.test2.$n > /dev/null || ret=1 # reload the server. this will flush the ADB. -$RNDCCMD 10.53.0.2 reload 2>&1 | sed 's/^/ns2 /' | cat_i +rndc_reload ns2 10.53.0.2 # ask another RR that would require delegation. static-stub configuration # should still be used instead of the authoritative A/AAAA cached above. $DIG $DIGOPTS +tcp data3.example. @10.53.0.2 txt > dig.out.ns2.test3.$n || ret=1 @@ -196,7 +196,7 @@ echo_i "checking server reload with a different static-stub config ($n)" ret=0 copy_setports ns2/named.conf.in tmp sed 's/SERVER_CONFIG_PLACEHOLDER/server-addresses { 10.53.0.4; };/' tmp > ns2/named.conf -$RNDCCMD 10.53.0.2 reload 2>&1 | sed 's/^/ns2 /' | cat_i +rndc_reload ns2 10.53.0.2 $DIG $DIGOPTS +tcp data2.example.org. @10.53.0.2 txt > dig.out.ns2.test$n || ret=1 grep "2nd example org data" dig.out.ns2.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi diff --git a/bin/tests/system/statschannel/tests.sh b/bin/tests/system/statschannel/tests.sh index 37146eafa36..550a758ec6e 100644 --- a/bin/tests/system/statschannel/tests.sh +++ b/bin/tests/system/statschannel/tests.sh @@ -46,6 +46,7 @@ fi gettraffic() { + sleep 1 echo_i "... using $1" case $1 in xml) path='xml/v3/traffic' ;; diff --git a/bin/tests/system/views/tests.sh b/bin/tests/system/views/tests.sh index 18e7fc19e14..49c54994c39 100644 --- a/bin/tests/system/views/tests.sh +++ b/bin/tests/system/views/tests.sh @@ -33,8 +33,8 @@ copy_setports ns3/named2.conf.in ns3/named.conf echo_i "reloading ns2 and ns3 with rndc" nextpart ns2/named.run > /dev/null nextpart ns3/named.run > /dev/null -$RNDCCMD 10.53.0.2 reload 2>&1 | sed 's/^/ns2 /' | cat_i -$RNDCCMD 10.53.0.3 reload 2>&1 | sed 's/^/ns3 /' | cat_i +rndc_reload ns2 10.53.0.2 +rndc_reload ns3 10.53.0.3 echo_i "wait for reload" a=0 b=0 diff --git a/bin/tests/system/xfer/tests.sh b/bin/tests/system/xfer/tests.sh index 12e761f6a52..d9286c40161 100755 --- a/bin/tests/system/xfer/tests.sh +++ b/bin/tests/system/xfer/tests.sh @@ -68,11 +68,11 @@ digcomp dig.out.ns2 dig.out.ns3 || status=1 echo_i "reload servers for in preparation for ixfr-from-differences tests" -$RNDCCMD 10.53.0.1 reload 2>&1 | sed 's/^/ns1 /' | cat_i -$RNDCCMD 10.53.0.2 reload 2>&1 | sed 's/^/ns2 /' | cat_i -$RNDCCMD 10.53.0.3 reload 2>&1 | sed 's/^/ns3 /' | cat_i -$RNDCCMD 10.53.0.6 reload 2>&1 | sed 's/^/ns6 /' | cat_i -$RNDCCMD 10.53.0.7 reload 2>&1 | sed 's/^/ns7 /' | cat_i +rndc_reload ns1 10.53.0.1 +rndc_reload ns2 10.53.0.2 +rndc_reload ns3 10.53.0.3 +rndc_reload ns6 10.53.0.6 +rndc_reload ns7 10.53.0.7 sleep 2 @@ -83,28 +83,28 @@ $PERL -i -p -e ' s/1397051952/1397051953/ ' ns1/slave.db -$RNDCCMD 10.53.0.1 reload 2>&1 | sed 's/^/ns1 /' | cat_i +rndc_reload ns1 10.53.0.1 $PERL -i -p -e ' s/0\.0\.0\.0/0.0.0.1/; s/1397051952/1397051953/ ' ns2/example.db -$RNDCCMD 10.53.0.2 reload 2>&1 | sed 's/^/ns2 /' | cat_i +rndc_reload ns2 10.53.0.2 $PERL -i -p -e ' s/0\.0\.0\.0/0.0.0.1/; s/1397051952/1397051953/ ' ns6/master.db -$RNDCCMD 10.53.0.6 reload 2>&1 | sed 's/^/ns6 /' | cat_i +rndc_reload ns6 10.53.0.6 $PERL -i -p -e ' s/0\.0\.0\.0/0.0.0.1/; s/1397051952/1397051953/ ' ns7/master2.db -$RNDCCMD 10.53.0.7 reload 2>&1 | sed 's/^/ns7 /' | cat_i +rndc_reload ns7 10.53.0.7 sleep 3 @@ -272,7 +272,7 @@ EOF cur=`awk 'END {print NR}' ns4/named.run` -$RNDCCMD 10.53.0.4 reload | sed 's/^/ns4 /' | cat_i +rndc_reload ns4 10.53.0.4 for i in 0 1 2 3 4 5 6 7 8 9 do diff --git a/bin/tests/system/xferquota/tests.sh b/bin/tests/system/xferquota/tests.sh index 0fbc1149f01..919d7e25302 100755 --- a/bin/tests/system/xferquota/tests.sh +++ b/bin/tests/system/xferquota/tests.sh @@ -28,7 +28,7 @@ while [ $count != 300 ]; do if [ ! "$CYGWIN" ]; then $KILL -HUP `cat ns1/named.pid` else - $RNDCCMD 10.53.0.1 reload > /dev/null 2>&1 + rndc_reload ns1 10.53.0.1 fi fi sleep 1 diff --git a/bin/tests/system/zonechecks/tests.sh b/bin/tests/system/zonechecks/tests.sh index fb3b4660523..92da5b48242 100644 --- a/bin/tests/system/zonechecks/tests.sh +++ b/bin/tests/system/zonechecks/tests.sh @@ -220,7 +220,7 @@ checkfor "files: reload.db, soa.db$" rndc.out.postreload sleep 1 echo "@ 0 SOA . . 3 0 0 0 0" > ns1/reload.db echo "@ 0 NS ." >> ns1/reload.db -$RNDCCMD 10.53.0.1 reload reload.example | sed 's/^/ns1 /' | cat_i +rndc_reload ns1 10.53.0.1 reload.example for i in 0 1 2 3 4 5 6 7 8 9 do $DIG $DIGOPTS reload.example SOA @10.53.0.1 > dig.out