Commit 6d501384 authored by Witold Krecicki's avatar Witold Krecicki

Use rndc_reload in tests, make sure that reload is complete before continuing

parent 517449e0
......@@ -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
......
......@@ -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)"
......
......@@ -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
......
......@@ -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
......
......@@ -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`
......
......@@ -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
......
......@@ -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
#
......
......@@ -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
......
......@@ -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
......
......@@ -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`
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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"
......
......@@ -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
......
......@@ -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
......
......@@ -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))
......
......@@ -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
......
......@@ -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
}
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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"
......
......@@ -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"
......
......@@ -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`
......
......@@ -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
......
......@@ -46,6 +46,7 @@ fi
gettraffic() {
sleep 1
echo_i "... using $1"
case $1 in
xml) path='xml/v3/traffic' ;;
......
......@@ -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