]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Use rndc_reload in tests, make sure that reload is complete before continuing
authorWitold Kręcicki <wpk@isc.org>
Tue, 11 Dec 2018 11:59:11 +0000 (12:59 +0100)
committerWitold Kręcicki <wpk@isc.org>
Wed, 19 Dec 2018 10:33:37 +0000 (11:33 +0100)
32 files changed:
bin/tests/system/acl/tests.sh
bin/tests/system/additional/tests.sh
bin/tests/system/addzone/tests.sh
bin/tests/system/allow-query/tests.sh
bin/tests/system/autosign/tests.sh
bin/tests/system/builtin/tests.sh
bin/tests/system/conf.sh.common
bin/tests/system/dlzexternal/tests.sh
bin/tests/system/dnssec/tests.sh
bin/tests/system/dyndb/tests.sh
bin/tests/system/emptyzones/tests.sh
bin/tests/system/fetchlimit/tests.sh
bin/tests/system/filter-aaaa/tests.sh
bin/tests/system/geoip/tests.sh
bin/tests/system/inline/tests.sh
bin/tests/system/ixfr/tests.sh
bin/tests/system/masterformat/tests.sh
bin/tests/system/mirror/tests.sh
bin/tests/system/mkeys/tests.sh
bin/tests/system/notify/tests.sh
bin/tests/system/nsupdate/tests.sh
bin/tests/system/redirect/tests.sh
bin/tests/system/resolver/tests.sh
bin/tests/system/rpz/tests.sh
bin/tests/system/rpzrecurse/tests.sh
bin/tests/system/serve-stale/tests.sh
bin/tests/system/staticstub/tests.sh
bin/tests/system/statschannel/tests.sh
bin/tests/system/views/tests.sh
bin/tests/system/xfer/tests.sh
bin/tests/system/xferquota/tests.sh
bin/tests/system/zonechecks/tests.sh

index 93e5c72afd181595ee3e3af761315efcd50f7a4b..fe49a86a0e279d037181501f4d86b5dd537248d8 100644 (file)
@@ -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
 
index 692af541ff393b070cbcf808ae541c986c785366..6819ec62245dc37c24509ef1108bd75c5d2a3d71 100644 (file)
@@ -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)"
index b5ca0f782b1a15b889596e0ccb5f0f6cecadf6e7..21495c7ad92a2859c6fcb8eb3a5590ebe2b7ac2a 100755 (executable)
@@ -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
index a350c8433213a400df47d77b68e415079311e994..479910c8250f11eac6e039412084fca6619e8422 100644 (file)
@@ -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
 
index a01a3eaac20a35a70bcb415bc4eabe3acd2b7054..cf14a00de40b4e6c7985327f2eed01107160e6c8 100755 (executable)
@@ -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`
index 391c239b614ae412af2b9bfbbc9c19d27cf06c85..2a0e795acb1a9fe1b020549d4db18f17734d6e2d 100644 (file)
@@ -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
index aceb5596cbefbde19a82ee6f17e90982ef49f58c..a09968802f9eb184eadc6d4f11b68fa5f3330ab7 100644 (file)
@@ -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
 #
index 87dd13b10ec555759c92e42793b3df940e87de61..85f5705a62882b2443051f2dd28db18af3ec7a04 100644 (file)
@@ -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
index fc5e21e7e264a1f5ddcb2fcfb2f256d4597883a8..69fe4a84b71764237cdafd95b2f78da9727dbee8 100644 (file)
@@ -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
index 2bbff206b2168bbc2dae515fd9a4fe307aeffc6f..4215b1d40eccca6f3a990faffe0e6e5c1efc1c77 100644 (file)
@@ -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`
index 5872479211df22390059cdc2a719fd1f0fd1784c..cf53e0a2dd021b27243ae4d136727b1aa8d70569 100644 (file)
@@ -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
index d7fb00a4935afde6cb2360135d461b3d87cf12f0..f360a86bcd7a7c9b4adae9ca3bb22f4f5c05cda0 100644 (file)
@@ -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
index f9b4d882b9ea3fbeef02a1087f35f850139975e5..ee497b8d298b7783c21a61b0889bc48e481c6f96 100644 (file)
@@ -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
 
index 0722b420c6f1b31bd676fc6c8aa888d60d7c9837..a0c6d0640c582bd30f4ccd9c73be10e6899de47d 100644 (file)
@@ -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"
index 3dd2804e048044c26964aa96f9e89d1c86b5fbfd..15a2c012dcf28c24f7d580f0fce1fac9bf17716b 100755 (executable)
@@ -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
index 70c8103627eb4fc24598b8466bebce6e70594f6b..d023eef3024ab7dfc043a9f7b594212c864a42dc 100644 (file)
@@ -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
index 6d2fbc7783c01bcf0e31257cd6abd5fe878dca45..31f4164f5467dfe62a9b4ec1b2a5c46d6d9b6cc7 100755 (executable)
@@ -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))
index 4ffcd25698ac3e53970799f9c96c4bc4df4a3160..074e82a4514a028a63d7917d8dc22059f57bede4 100644 (file)
@@ -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
index e8c2923c20ebc694568e80a1e89306054c69db30..4b502ab82f5a5f6b9de8a186226ddd92f24fb336 100644 (file)
@@ -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
 }
 
index 1be2b4712e37aff42fd88503c1b21bab11aa9621..728c6c2af652ac82153318d84033738b610dc564 100644 (file)
@@ -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
index 9762a0f89160d5b77a3db42d22b5dd846c3a4194..dd0286fe48dc75f706d7b4c2e72689f6df9afb41 100755 (executable)
@@ -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
index 0e2adf77b83726d5dbbb6ff2edbacf685467623d..546e4b136f62de26b12ebf2890805852f5ca281f 100644 (file)
@@ -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
index 75ab5c066229f8a031299a63f04053af3435701d..89e74cd1d0dd4b7e389506b9ae73b46e542a7b96 100755 (executable)
@@ -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
index 84537e472def89e7836fcafe50285db670d2469c..89b8c1738f4dee2d65ec03ae5f8df35616f509b6 100644 (file)
@@ -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"
 
index 2e1813622de48755724ffa16e7d6f471ab1ae11e..dfc10b7ccf5b4698924b975865c7e22cbe108fbf 100644 (file)
@@ -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"
index c3460b8fe37e18d0e51a4a8ffaa9abbd5329ac99..b6dea112604dee1348a2e2eb92b0f4b063e16f64 100755 (executable)
@@ -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`
 
index 95cad164f43896172d4365ec35d4b12485161400..cda9fe5fcaf3aea34faf4dce520b1c85c12ec2ed 100755 (executable)
@@ -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
index 37146eafa36a451965c3d7393bb8f7ace4918fed..550a758ec6e7bd12427a82507d61f5ff0a1951d1 100644 (file)
@@ -46,6 +46,7 @@ fi
 
 
 gettraffic() {
+    sleep 1
     echo_i "... using $1"
     case $1 in
         xml) path='xml/v3/traffic' ;;
index 18e7fc19e1431ab62fc939fd81090de0484bd2f6..49c54994c399d28c87bf4d862eb8e8e5b102775e 100644 (file)
@@ -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
index 12e761f6a525cedfa9070d9271d678969a8a5ecf..d9286c40161557dac162eabeb3e652fdd8ff762d 100755 (executable)
@@ -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
index 0fbc1149f0141950594fab310d9f86a7452f3aca..919d7e25302961d26c85377b4b1fea5e5f4e190c 100755 (executable)
@@ -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
index fb3b4660523578d2085d76d130e954de2273f293..92da5b48242f88c7a98f1fedd6e196122fe08252 100644 (file)
@@ -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