mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-03 16:15:27 +00:00
Simplify start/stop helper func in system tests
The system test should never attempt to start or stop any other server than those that belong to that system test. Therefore, it is not necessary to specify the system test name in function calls. Additionally, this makes it possible to run the test inside a differently named directory, as its name is automatically detected with the $SYSTESTDIR variable. This enables running the system tests inside a temporary directory. Direct use of stop.pl was replaced with a more systematic approach to use stop_servers helper function.
This commit is contained in:
@@ -725,8 +725,8 @@ $RNDCCMD 10.53.0.3 addzone '"test\".baz"' '{ type primary; check-names ignore; f
|
|||||||
$RNDCCMD 10.53.0.3 addzone '"test\\.baz"' '{ type primary; check-names ignore; file "e.db"; };' > /dev/null 2>&1 || ret=1
|
$RNDCCMD 10.53.0.3 addzone '"test\\.baz"' '{ type primary; check-names ignore; file "e.db"; };' > /dev/null 2>&1 || ret=1
|
||||||
$RNDCCMD 10.53.0.3 addzone '"test\032.baz"' '{ type primary; check-names ignore; file "e.db"; };' > /dev/null 2>&1 || ret=1
|
$RNDCCMD 10.53.0.3 addzone '"test\032.baz"' '{ type primary; check-names ignore; file "e.db"; };' > /dev/null 2>&1 || ret=1
|
||||||
$RNDCCMD 10.53.0.3 addzone '"test\010.baz"' '{ type primary; check-names ignore; file "e.db"; };' > /dev/null 2>&1 || ret=1
|
$RNDCCMD 10.53.0.3 addzone '"test\010.baz"' '{ type primary; check-names ignore; file "e.db"; };' > /dev/null 2>&1 || ret=1
|
||||||
stop_server addzone ns3
|
stop_server ns3
|
||||||
start_server --noclean --restart --port ${PORT} addzone ns3 || ret=1
|
start_server --noclean --restart --port ${PORT} ns3 || ret=1
|
||||||
retry_quiet 10 _check_version_bind || ret=1
|
retry_quiet 10 _check_version_bind || ret=1
|
||||||
$DIG $DIGOPTS @10.53.0.3 SOA "test4.baz" > dig.out.1.test$n || ret=1
|
$DIG $DIGOPTS @10.53.0.3 SOA "test4.baz" > dig.out.1.test$n || ret=1
|
||||||
grep "status: NOERROR" dig.out.1.test$n > /dev/null || ret=1
|
grep "status: NOERROR" dig.out.1.test$n > /dev/null || ret=1
|
||||||
|
@@ -247,11 +247,11 @@ digcomp() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
start_server() {
|
start_server() {
|
||||||
$PERL "$TOP_SRCDIR/bin/tests/system/start.pl" "$@"
|
$PERL "$TOP_SRCDIR/bin/tests/system/start.pl" "$SYSTESTDIR" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
stop_server() {
|
stop_server() {
|
||||||
$PERL "$TOP_SRCDIR/bin/tests/system/stop.pl" "$@"
|
$PERL "$TOP_SRCDIR/bin/tests/system/stop.pl" "$SYSTESTDIR" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
send() {
|
send() {
|
||||||
|
@@ -2179,7 +2179,7 @@ echo_i "waiting till 14s have passed since NTAs were added before restarting ns4
|
|||||||
$PERL -e 'my $delay = '"$start"' + 14 - time(); select(undef, undef, undef, $delay) if ($delay > 0);'
|
$PERL -e 'my $delay = '"$start"' + 14 - time(); select(undef, undef, undef, $delay) if ($delay > 0);'
|
||||||
|
|
||||||
if
|
if
|
||||||
start_server --noclean --restart --port "$PORT" dnssec ns4
|
start_server --noclean --restart --port "$PORT" ns4
|
||||||
then
|
then
|
||||||
echo_i "restarted server ns4"
|
echo_i "restarted server ns4"
|
||||||
else
|
else
|
||||||
@@ -2245,7 +2245,7 @@ echo "secure.example. regular $future" > ns4/_default.nta
|
|||||||
start=$($PERL -e 'print time()."\n";')
|
start=$($PERL -e 'print time()."\n";')
|
||||||
|
|
||||||
if
|
if
|
||||||
start_server --noclean --restart --port "$PORT" dnssec ns4
|
start_server --noclean --restart --port "$PORT" ns4
|
||||||
then
|
then
|
||||||
echo_i "restarted server ns4"
|
echo_i "restarted server ns4"
|
||||||
else
|
else
|
||||||
@@ -2301,7 +2301,7 @@ echo "secure.example. forced $future" > ns4/_default.nta
|
|||||||
start=$($PERL -e 'print time()."\n";')
|
start=$($PERL -e 'print time()."\n";')
|
||||||
|
|
||||||
if
|
if
|
||||||
start_server --noclean --restart --port "$PORT" dnssec ns4
|
start_server --noclean --restart --port "$PORT" ns4
|
||||||
then
|
then
|
||||||
echo_i "restarted server ns4"
|
echo_i "restarted server ns4"
|
||||||
else
|
else
|
||||||
@@ -2349,7 +2349,7 @@ echo "secure.example. forced $future" > ns4/_default.nta
|
|||||||
added=$($PERL -e 'print time()."\n";')
|
added=$($PERL -e 'print time()."\n";')
|
||||||
|
|
||||||
if
|
if
|
||||||
start_server --noclean --restart --port "$PORT" dnssec ns4
|
start_server --noclean --restart --port "$PORT" ns4
|
||||||
then
|
then
|
||||||
echo_i "restarted server ns4"
|
echo_i "restarted server ns4"
|
||||||
else
|
else
|
||||||
@@ -3842,9 +3842,9 @@ ret=0
|
|||||||
dig_with_opts . dnskey +ednsopt=KEY-TAG:fffe +ednsopt=KEY-TAG:fffd @10.53.0.1 > dig.out.ns1.test$n || ret=1
|
dig_with_opts . dnskey +ednsopt=KEY-TAG:fffe +ednsopt=KEY-TAG:fffd @10.53.0.1 > dig.out.ns1.test$n || ret=1
|
||||||
grep "trust-anchor-telemetry './IN' from .* 65534" ns1/named.run > /dev/null || ret=1
|
grep "trust-anchor-telemetry './IN' from .* 65534" ns1/named.run > /dev/null || ret=1
|
||||||
grep "trust-anchor-telemetry './IN' from .* 65533" ns1/named.run > /dev/null && ret=1
|
grep "trust-anchor-telemetry './IN' from .* 65533" ns1/named.run > /dev/null && ret=1
|
||||||
$PERL ../stop.pl dnssec ns1 || ret=1
|
stop_server ns1 || ret=1
|
||||||
nextpart ns1/named.run > /dev/null
|
nextpart ns1/named.run > /dev/null
|
||||||
start_server --noclean --restart --port ${PORT} dnssec ns1 || ret=1
|
start_server --noclean --restart --port ${PORT} ns1 || ret=1
|
||||||
n=$(($n+1))
|
n=$(($n+1))
|
||||||
test "$ret" -eq 0 || echo_i "failed"
|
test "$ret" -eq 0 || echo_i "failed"
|
||||||
status=$((status+ret))
|
status=$((status+ret))
|
||||||
|
@@ -797,14 +797,14 @@ test_dnstap_roll() (
|
|||||||
|
|
||||||
echo_i "checking 'rndc -roll <value>' (no versions)"
|
echo_i "checking 'rndc -roll <value>' (no versions)"
|
||||||
ret=0
|
ret=0
|
||||||
start_server --noclean --restart --port "${PORT}" dnstap ns3
|
start_server --noclean --restart --port "${PORT}" ns3
|
||||||
_repeat 5 test_dnstap_roll 10.53.0.3 ns3 3 || ret=1
|
_repeat 5 test_dnstap_roll 10.53.0.3 ns3 3 || ret=1
|
||||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||||
status=$((status+ret))
|
status=$((status+ret))
|
||||||
|
|
||||||
echo_i "checking 'rndc -roll <value>' (versions)"
|
echo_i "checking 'rndc -roll <value>' (versions)"
|
||||||
ret=0
|
ret=0
|
||||||
start_server --noclean --restart --port "${PORT}" dnstap ns2
|
start_server --noclean --restart --port "${PORT}" ns2
|
||||||
_repeat 5 test_dnstap_roll 10.53.0.2 ns2 3 || ret=1
|
_repeat 5 test_dnstap_roll 10.53.0.2 ns2 3 || ret=1
|
||||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||||
status=$((status+ret))
|
status=$((status+ret))
|
||||||
|
@@ -112,10 +112,10 @@ echo_i "checking for negative caching of forwarder response ($n)"
|
|||||||
ret=0
|
ret=0
|
||||||
dig_with_opts nonexist. txt @10.53.0.5 > dig.out.$n.f2 || ret=1
|
dig_with_opts nonexist. txt @10.53.0.5 > dig.out.$n.f2 || ret=1
|
||||||
grep "status: NXDOMAIN" dig.out.$n.f2 > /dev/null || ret=1
|
grep "status: NXDOMAIN" dig.out.$n.f2 > /dev/null || ret=1
|
||||||
stop_server forward ns4 || ret=1
|
stop_server ns4 || ret=1
|
||||||
dig_with_opts nonexist. txt @10.53.0.5 > dig.out.$n.f2 || ret=1
|
dig_with_opts nonexist. txt @10.53.0.5 > dig.out.$n.f2 || ret=1
|
||||||
grep "status: NXDOMAIN" dig.out.$n.f2 > /dev/null || ret=1
|
grep "status: NXDOMAIN" dig.out.$n.f2 > /dev/null || ret=1
|
||||||
start_server --restart --noclean --port "${PORT}" forward ns4 || ret=1
|
start_server --restart --noclean --port "${PORT}" ns4 || ret=1
|
||||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||||
status=$((status+ret))
|
status=$((status+ret))
|
||||||
|
|
||||||
|
@@ -478,14 +478,14 @@ status=$((status + ret))
|
|||||||
n=$((n + 1))
|
n=$((n + 1))
|
||||||
echo_i "stop bump in the wire signer server ($n)"
|
echo_i "stop bump in the wire signer server ($n)"
|
||||||
ret=0
|
ret=0
|
||||||
stop_server inline ns3 || ret=1
|
stop_server ns3 || ret=1
|
||||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||||
status=$((status + ret))
|
status=$((status + ret))
|
||||||
|
|
||||||
n=$((n + 1))
|
n=$((n + 1))
|
||||||
echo_i "restart bump in the wire signer server ($n)"
|
echo_i "restart bump in the wire signer server ($n)"
|
||||||
ret=0
|
ret=0
|
||||||
start_server --noclean --restart --port ${PORT} inline ns3 || ret=1
|
start_server --noclean --restart --port ${PORT} ns3 || ret=1
|
||||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||||
status=$((status + ret))
|
status=$((status + ret))
|
||||||
|
|
||||||
@@ -886,7 +886,7 @@ status=$((status + ret))
|
|||||||
n=$((n + 1))
|
n=$((n + 1))
|
||||||
echo_i "stop bump in the wire signer server ($n)"
|
echo_i "stop bump in the wire signer server ($n)"
|
||||||
ret=0
|
ret=0
|
||||||
stop_server inline ns3 || ret=1
|
stop_server ns3 || ret=1
|
||||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||||
status=$((status + ret))
|
status=$((status + ret))
|
||||||
|
|
||||||
@@ -897,7 +897,7 @@ rm ns3/primary.db.jnl
|
|||||||
n=$((n + 1))
|
n=$((n + 1))
|
||||||
echo_i "restart bump in the wire signer server ($n)"
|
echo_i "restart bump in the wire signer server ($n)"
|
||||||
ret=0
|
ret=0
|
||||||
start_server --noclean --restart --port ${PORT} inline ns3 || ret=1
|
start_server --noclean --restart --port ${PORT} ns3 || ret=1
|
||||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||||
status=$((status + ret))
|
status=$((status + ret))
|
||||||
|
|
||||||
@@ -1369,19 +1369,19 @@ check_done_signing () (
|
|||||||
retry_quiet 10 check_done_signing || ret=1
|
retry_quiet 10 check_done_signing || ret=1
|
||||||
# Halt rather than stopping the server to prevent the file from being
|
# Halt rather than stopping the server to prevent the file from being
|
||||||
# flushed upon shutdown since we specifically want to avoid it.
|
# flushed upon shutdown since we specifically want to avoid it.
|
||||||
$PERL ../stop.pl --use-rndc --halt --port ${CONTROLPORT} inline ns3
|
stop_server --use-rndc --halt --port ${CONTROLPORT} ns3
|
||||||
ensure_sigs_only_in_journal delayedkeys ns3/delayedkeys.db.signed
|
ensure_sigs_only_in_journal delayedkeys ns3/delayedkeys.db.signed
|
||||||
start_server --noclean --restart --port ${PORT} inline ns3
|
start_server --noclean --restart --port ${PORT} ns3
|
||||||
# At this point, the raw zone journal will not have a source serial set. Upon
|
# At this point, the raw zone journal will not have a source serial set. Upon
|
||||||
# server startup, receive_secure_serial() will rectify that, update SOA, resign
|
# server startup, receive_secure_serial() will rectify that, update SOA, resign
|
||||||
# it, and schedule its future resign. This will cause "rndc zonestatus" to
|
# it, and schedule its future resign. This will cause "rndc zonestatus" to
|
||||||
# return delayedkeys/SOA as the next node to resign, so we restart the server
|
# return delayedkeys/SOA as the next node to resign, so we restart the server
|
||||||
# once again; with the raw zone journal now having a source serial set,
|
# once again; with the raw zone journal now having a source serial set,
|
||||||
# receive_secure_serial() should refrain from introducing any zone changes.
|
# receive_secure_serial() should refrain from introducing any zone changes.
|
||||||
$PERL ../stop.pl --use-rndc --halt --port ${CONTROLPORT} inline ns3
|
stop_server --use-rndc --halt --port ${CONTROLPORT} ns3
|
||||||
ensure_sigs_only_in_journal delayedkeys ns3/delayedkeys.db.signed
|
ensure_sigs_only_in_journal delayedkeys ns3/delayedkeys.db.signed
|
||||||
nextpart ns3/named.run > /dev/null
|
nextpart ns3/named.run > /dev/null
|
||||||
start_server --noclean --restart --port ${PORT} inline ns3
|
start_server --noclean --restart --port ${PORT} ns3
|
||||||
# We can now test whether the secure zone journal was correctly processed:
|
# We can now test whether the secure zone journal was correctly processed:
|
||||||
# unless the records contained in it were scheduled for resigning, no resigning
|
# unless the records contained in it were scheduled for resigning, no resigning
|
||||||
# event will be scheduled at all since the secure zone file contains no
|
# event will be scheduled at all since the secure zone file contains no
|
||||||
@@ -1464,12 +1464,12 @@ echo_i "Check that restart with zone changes and deleted journal works ($n)"
|
|||||||
TSIG=
|
TSIG=
|
||||||
ret=0
|
ret=0
|
||||||
dig_with_opts @10.53.0.8 example SOA > dig.out.ns8.test$n.soa1 || ret=1
|
dig_with_opts @10.53.0.8 example SOA > dig.out.ns8.test$n.soa1 || ret=1
|
||||||
stop_server --use-rndc --port ${CONTROLPORT} inline ns8
|
stop_server --use-rndc --port ${CONTROLPORT} ns8
|
||||||
# TTL of all records change from 300 to 400
|
# TTL of all records change from 300 to 400
|
||||||
cp ns8/example3.db.in ns8/example.db || ret=1
|
cp ns8/example3.db.in ns8/example.db || ret=1
|
||||||
rm ns8/example.db.jnl
|
rm ns8/example.db.jnl
|
||||||
nextpart ns8/named.run > /dev/null
|
nextpart ns8/named.run > /dev/null
|
||||||
start_server --noclean --restart --port ${PORT} inline ns8
|
start_server --noclean --restart --port ${PORT} ns8
|
||||||
wait_for_log 3 "all zones loaded" ns8/named.run
|
wait_for_log 3 "all zones loaded" ns8/named.run
|
||||||
sleep 1
|
sleep 1
|
||||||
dig_with_opts @10.53.0.8 example SOA > dig.out.ns8.test$n.soa2 || ret=1
|
dig_with_opts @10.53.0.8 example SOA > dig.out.ns8.test$n.soa2 || ret=1
|
||||||
|
@@ -4785,12 +4785,12 @@ echo_i "Check that restart with zone changes and deleted journal works ($n)"
|
|||||||
TSIG=
|
TSIG=
|
||||||
ret=0
|
ret=0
|
||||||
dig_with_opts @10.53.0.6 example SOA > dig.out.ns6.test$n.soa1 || ret=1
|
dig_with_opts @10.53.0.6 example SOA > dig.out.ns6.test$n.soa1 || ret=1
|
||||||
stop_server --use-rndc --port ${CONTROLPORT} kasp ns6
|
stop_server --use-rndc --port ${CONTROLPORT} ns6
|
||||||
# TTL of all records change from 300 to 400
|
# TTL of all records change from 300 to 400
|
||||||
cp ns6/example3.db.in ns6/example.db || ret=1
|
cp ns6/example3.db.in ns6/example.db || ret=1
|
||||||
rm ns6/example.db.jnl
|
rm ns6/example.db.jnl
|
||||||
nextpart ns6/named.run > /dev/null
|
nextpart ns6/named.run > /dev/null
|
||||||
start_server --noclean --restart --port ${PORT} kasp ns6
|
start_server --noclean --restart --port ${PORT} ns6
|
||||||
wait_for_log 3 "all zones loaded" ns6/named.run
|
wait_for_log 3 "all zones loaded" ns6/named.run
|
||||||
# Check that the SOA SERIAL increases and check the TTLs (should be changed
|
# Check that the SOA SERIAL increases and check the TTLs (should be changed
|
||||||
# from 300 to 400 as defined in ns6/example3.db.in).
|
# from 300 to 400 as defined in ns6/example3.db.in).
|
||||||
|
@@ -247,9 +247,9 @@ fi
|
|||||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||||
status=`expr $status + $ret`
|
status=`expr $status + $ret`
|
||||||
|
|
||||||
$PERL ../stop.pl --use-rndc --port ${CONTROLPORT} legacy ns1
|
stop_server --use-rndc --port ${CONTROLPORT} ns1
|
||||||
copy_setports ns1/named2.conf.in ns1/named.conf
|
copy_setports ns1/named2.conf.in ns1/named.conf
|
||||||
start_server --noclean --restart --port ${PORT} legacy ns1
|
start_server --noclean --restart --port ${PORT} ns1
|
||||||
|
|
||||||
n=`expr $n + 1`
|
n=`expr $n + 1`
|
||||||
echo_i "checking recursive lookup to edns 512 + no tcp + trust anchor fails ($n)"
|
echo_i "checking recursive lookup to edns 512 + no tcp + trust anchor fails ($n)"
|
||||||
|
@@ -87,9 +87,9 @@ fi
|
|||||||
|
|
||||||
echo_i "repeat previous tests without named -g"
|
echo_i "repeat previous tests without named -g"
|
||||||
copy_setports ns1/named.plain.in ns1/named.conf
|
copy_setports ns1/named.plain.in ns1/named.conf
|
||||||
$PERL ../stop.pl --use-rndc --port ${CONTROLPORT} logfileconfig ns1
|
stop_server --use-rndc --port ${CONTROLPORT} ns1
|
||||||
cp named1.args ns1/named.args
|
cp named1.args ns1/named.args
|
||||||
start_server --noclean --restart --port ${PORT} logfileconfig ns1
|
start_server --noclean --restart --port ${PORT} ns1
|
||||||
|
|
||||||
n=$((n+1))
|
n=$((n+1))
|
||||||
echo_i "testing log file validity (only plain files allowed) ($n)"
|
echo_i "testing log file validity (only plain files allowed) ($n)"
|
||||||
@@ -225,12 +225,12 @@ status=$((status+ret))
|
|||||||
n=$((n+1))
|
n=$((n+1))
|
||||||
echo_i "testing default logfile using named -L file ($n)"
|
echo_i "testing default logfile using named -L file ($n)"
|
||||||
ret=0
|
ret=0
|
||||||
$PERL ../stop.pl logfileconfig ns1
|
stop_server ns1
|
||||||
cp named2.args ns1/named.args
|
cp named2.args ns1/named.args
|
||||||
test -f ns1/named.pid && ret=1
|
test -f ns1/named.pid && ret=1
|
||||||
rm -f ns1/named_deflog
|
rm -f ns1/named_deflog
|
||||||
copy_setports ns1/named.plainconf.in ns1/named.conf
|
copy_setports ns1/named.plainconf.in ns1/named.conf
|
||||||
start_server --noclean --restart --port ${PORT} logfileconfig ns1
|
start_server --noclean --restart --port ${PORT} ns1
|
||||||
[ -f "ns1/named_deflog" ] || ret=1
|
[ -f "ns1/named_deflog" ] || ret=1
|
||||||
if [ "$ret" -ne 0 ]; then echo_i "failed"; fi
|
if [ "$ret" -ne 0 ]; then echo_i "failed"; fi
|
||||||
status=$((status+ret))
|
status=$((status+ret))
|
||||||
|
@@ -73,7 +73,7 @@ stomp () {
|
|||||||
|
|
||||||
restart () {
|
restart () {
|
||||||
sleep 1
|
sleep 1
|
||||||
start_server --noclean --restart --port "${PORT}" masterformat ns3
|
start_server --noclean --restart --port "${PORT}" ns3
|
||||||
}
|
}
|
||||||
|
|
||||||
dig_with_opts() {
|
dig_with_opts() {
|
||||||
@@ -214,7 +214,7 @@ grep "added text" "dig.out.dynamic1.ns3.test$n" > /dev/null 2>&1 || ret=1
|
|||||||
dig_with_opts +comm @10.53.0.3 added.dynamic txt > "dig.out.dynamic2.ns3.test$n"
|
dig_with_opts +comm @10.53.0.3 added.dynamic txt > "dig.out.dynamic2.ns3.test$n"
|
||||||
grep "NXDOMAIN" "dig.out.dynamic2.ns3.test$n" > /dev/null 2>&1 || ret=1
|
grep "NXDOMAIN" "dig.out.dynamic2.ns3.test$n" > /dev/null 2>&1 || ret=1
|
||||||
# using "rndc halt" ensures that we don't dump the zone file
|
# using "rndc halt" ensures that we don't dump the zone file
|
||||||
$PERL ../stop.pl --use-rndc --halt --port ${CONTROLPORT} masterformat ns3
|
stop_server --use-rndc --halt --port ${CONTROLPORT} ns3
|
||||||
restart
|
restart
|
||||||
check_added_text() {
|
check_added_text() {
|
||||||
dig_with_opts @10.53.0.3 newtext.dynamic txt > "dig.out.dynamic3.ns3.test$n" || return 1
|
dig_with_opts @10.53.0.3 newtext.dynamic txt > "dig.out.dynamic3.ns3.test$n" || return 1
|
||||||
@@ -239,7 +239,7 @@ END
|
|||||||
dig_with_opts @10.53.0.3 moretext.dynamic txt > "dig.out.dynamic1.ns3.test$n"
|
dig_with_opts @10.53.0.3 moretext.dynamic txt > "dig.out.dynamic1.ns3.test$n"
|
||||||
grep "more text" "dig.out.dynamic1.ns3.test$n" > /dev/null 2>&1 || ret=1
|
grep "more text" "dig.out.dynamic1.ns3.test$n" > /dev/null 2>&1 || ret=1
|
||||||
# using "rndc stop" will cause the zone file to flush before shutdown
|
# using "rndc stop" will cause the zone file to flush before shutdown
|
||||||
$PERL ../stop.pl --use-rndc --port ${CONTROLPORT} masterformat ns3
|
stop_server --use-rndc --port ${CONTROLPORT} ns3
|
||||||
rm ns3/*.jnl
|
rm ns3/*.jnl
|
||||||
restart
|
restart
|
||||||
#shellcheck disable=SC2034
|
#shellcheck disable=SC2034
|
||||||
|
@@ -225,10 +225,10 @@ status=$((status + ret))
|
|||||||
n=$((n + 1))
|
n=$((n + 1))
|
||||||
echo_i "checking that loading a correctly signed mirror zone from disk succeeds ($n)"
|
echo_i "checking that loading a correctly signed mirror zone from disk succeeds ($n)"
|
||||||
ret=0
|
ret=0
|
||||||
stop_server --use-rndc --port ${CONTROLPORT} mirror ns3
|
stop_server --use-rndc --port ${CONTROLPORT} ns3
|
||||||
cat ns2/verify-load.db.good.signed > ns3/verify-load.db.mirror
|
cat ns2/verify-load.db.good.signed > ns3/verify-load.db.mirror
|
||||||
nextpart ns3/named.run > /dev/null
|
nextpart ns3/named.run > /dev/null
|
||||||
start_server --noclean --restart --port ${PORT} mirror ns3
|
start_server --noclean --restart --port ${PORT} ns3
|
||||||
wait_for_load verify-load ${UPDATED_SERIAL_GOOD} ns3/named.run
|
wait_for_load verify-load ${UPDATED_SERIAL_GOOD} ns3/named.run
|
||||||
$DIG $DIGOPTS @10.53.0.3 +norec verify-load SOA > dig.out.ns3.test$n 2>&1 || ret=1
|
$DIG $DIGOPTS @10.53.0.3 +norec verify-load SOA > dig.out.ns3.test$n 2>&1 || ret=1
|
||||||
grep "ANSWER: 0" dig.out.ns3.test$n > /dev/null && ret=1
|
grep "ANSWER: 0" dig.out.ns3.test$n > /dev/null && ret=1
|
||||||
@@ -240,7 +240,7 @@ status=$((status + ret))
|
|||||||
n=$((n + 1))
|
n=$((n + 1))
|
||||||
echo_i "checking that loading a journal for an incorrectly signed mirror zone fails ($n)"
|
echo_i "checking that loading a journal for an incorrectly signed mirror zone fails ($n)"
|
||||||
ret=0
|
ret=0
|
||||||
stop_server --use-rndc --port ${CONTROLPORT} mirror ns3
|
stop_server --use-rndc --port ${CONTROLPORT} ns3
|
||||||
cp ns3/verify-journal.db.mirror ns3/verify-ixfr.db.mirror
|
cp ns3/verify-journal.db.mirror ns3/verify-ixfr.db.mirror
|
||||||
cp ns3/verify-journal.db.bad.mirror.jnl ns3/verify-ixfr.db.mirror.jnl
|
cp ns3/verify-journal.db.bad.mirror.jnl ns3/verify-ixfr.db.mirror.jnl
|
||||||
# Temporarily disable transfers of the "verify-ixfr" zone on ns2. This is
|
# Temporarily disable transfers of the "verify-ixfr" zone on ns2. This is
|
||||||
@@ -255,7 +255,7 @@ sed '/^zone "verify-ixfr" {$/,/^};$/ {
|
|||||||
mv ns2/named.conf.modified ns2/named.conf
|
mv ns2/named.conf.modified ns2/named.conf
|
||||||
rndc_reconfig ns2 10.53.0.2
|
rndc_reconfig ns2 10.53.0.2
|
||||||
nextpart ns3/named.run > /dev/null
|
nextpart ns3/named.run > /dev/null
|
||||||
start_server --noclean --restart --port ${PORT} mirror ns3
|
start_server --noclean --restart --port ${PORT} ns3
|
||||||
wait_for_load verify-ixfr ${UPDATED_SERIAL_BAD} ns3/named.run
|
wait_for_load verify-ixfr ${UPDATED_SERIAL_BAD} ns3/named.run
|
||||||
$DIG $DIGOPTS @10.53.0.3 +norec verify-ixfr SOA > dig.out.ns3.test$n 2>&1 || ret=1
|
$DIG $DIGOPTS @10.53.0.3 +norec verify-ixfr SOA > dig.out.ns3.test$n 2>&1 || ret=1
|
||||||
grep "ANSWER: 0" dig.out.ns3.test$n > /dev/null || ret=1
|
grep "ANSWER: 0" dig.out.ns3.test$n > /dev/null || ret=1
|
||||||
@@ -275,11 +275,11 @@ status=$((status + ret))
|
|||||||
n=$((n + 1))
|
n=$((n + 1))
|
||||||
echo_i "checking that loading a journal for a correctly signed mirror zone succeeds ($n)"
|
echo_i "checking that loading a journal for a correctly signed mirror zone succeeds ($n)"
|
||||||
ret=0
|
ret=0
|
||||||
stop_server --use-rndc --port ${CONTROLPORT} mirror ns3
|
stop_server --use-rndc --port ${CONTROLPORT} ns3
|
||||||
cp ns3/verify-journal.db.mirror ns3/verify-ixfr.db.mirror
|
cp ns3/verify-journal.db.mirror ns3/verify-ixfr.db.mirror
|
||||||
cp ns3/verify-journal.db.good.mirror.jnl ns3/verify-ixfr.db.mirror.jnl
|
cp ns3/verify-journal.db.good.mirror.jnl ns3/verify-ixfr.db.mirror.jnl
|
||||||
nextpart ns3/named.run > /dev/null
|
nextpart ns3/named.run > /dev/null
|
||||||
start_server --noclean --restart --port ${PORT} mirror ns3
|
start_server --noclean --restart --port ${PORT} ns3
|
||||||
wait_for_load verify-ixfr ${UPDATED_SERIAL_GOOD} ns3/named.run
|
wait_for_load verify-ixfr ${UPDATED_SERIAL_GOOD} ns3/named.run
|
||||||
$DIG $DIGOPTS @10.53.0.3 +norec verify-ixfr SOA > dig.out.ns3.test$n 2>&1 || ret=1
|
$DIG $DIGOPTS @10.53.0.3 +norec verify-ixfr SOA > dig.out.ns3.test$n 2>&1 || ret=1
|
||||||
grep "ANSWER: 0" dig.out.ns3.test$n > /dev/null && ret=1
|
grep "ANSWER: 0" dig.out.ns3.test$n > /dev/null && ret=1
|
||||||
@@ -417,10 +417,10 @@ mv ns2/named.conf.modified ns2/named.conf
|
|||||||
rndc_reconfig ns2 10.53.0.2
|
rndc_reconfig ns2 10.53.0.2
|
||||||
# Stop ns3, update the timestamp of the zone file to one far in the past, then
|
# Stop ns3, update the timestamp of the zone file to one far in the past, then
|
||||||
# restart ns3.
|
# restart ns3.
|
||||||
stop_server --use-rndc --port ${CONTROLPORT} mirror ns3
|
stop_server --use-rndc --port ${CONTROLPORT} ns3
|
||||||
touch -t 200001010000 ns3/initially-unavailable.db.mirror
|
touch -t 200001010000 ns3/initially-unavailable.db.mirror
|
||||||
nextpart ns3/named.run > /dev/null
|
nextpart ns3/named.run > /dev/null
|
||||||
start_server --noclean --restart --port ${PORT} mirror ns3
|
start_server --noclean --restart --port ${PORT} ns3
|
||||||
# Ensure named attempts to retransfer the zone due to its expiry.
|
# Ensure named attempts to retransfer the zone due to its expiry.
|
||||||
wait_for_transfer initially-unavailable
|
wait_for_transfer initially-unavailable
|
||||||
# Ensure the expected messages were logged.
|
# Ensure the expected messages were logged.
|
||||||
|
@@ -301,11 +301,11 @@ if [ $ret != 0 ]; then echo_i "failed"; fi
|
|||||||
status=$((status+ret))
|
status=$((status+ret))
|
||||||
|
|
||||||
echo_i "reinitialize trust anchors, add second key to bind.keys"
|
echo_i "reinitialize trust anchors, add second key to bind.keys"
|
||||||
stop_server --use-rndc --port "${CONTROLPORT}" mkeys ns2
|
stop_server --use-rndc --port "${CONTROLPORT}" ns2
|
||||||
rm -f ns2/managed-keys.bind*
|
rm -f ns2/managed-keys.bind*
|
||||||
keyfile_to_initial_ds ns1/"$original" ns1/"$standby1" > ns2/managed.conf
|
keyfile_to_initial_ds ns1/"$original" ns1/"$standby1" > ns2/managed.conf
|
||||||
nextpart ns2/named.run > /dev/null
|
nextpart ns2/named.run > /dev/null
|
||||||
start_server --noclean --restart --port "${PORT}" mkeys ns2
|
start_server --noclean --restart --port "${PORT}" ns2
|
||||||
|
|
||||||
n=$((n+1))
|
n=$((n+1))
|
||||||
echo_i "check that no key from bind.keys is marked as an initializing key ($n)"
|
echo_i "check that no key from bind.keys is marked as an initializing key ($n)"
|
||||||
@@ -317,11 +317,11 @@ if [ $ret != 0 ]; then echo_i "failed"; fi
|
|||||||
status=$((status+ret))
|
status=$((status+ret))
|
||||||
|
|
||||||
echo_i "reinitialize trust anchors, revert to one key in bind.keys"
|
echo_i "reinitialize trust anchors, revert to one key in bind.keys"
|
||||||
stop_server --use-rndc --port "${CONTROLPORT}" mkeys ns2
|
stop_server --use-rndc --port "${CONTROLPORT}" ns2
|
||||||
rm -f ns2/managed-keys.bind*
|
rm -f ns2/managed-keys.bind*
|
||||||
mv ns2/managed1.conf ns2/managed.conf
|
mv ns2/managed1.conf ns2/managed.conf
|
||||||
nextpart ns2/named.run > /dev/null
|
nextpart ns2/named.run > /dev/null
|
||||||
start_server --noclean --restart --port "${PORT}" mkeys ns2
|
start_server --noclean --restart --port "${PORT}" ns2
|
||||||
|
|
||||||
n=$((n+1))
|
n=$((n+1))
|
||||||
echo_i "check that standby key is now trusted ($n)"
|
echo_i "check that standby key is now trusted ($n)"
|
||||||
@@ -480,10 +480,10 @@ if [ $ret != 0 ]; then echo_i "failed"; fi
|
|||||||
status=$((status+ret))
|
status=$((status+ret))
|
||||||
|
|
||||||
echo_i "reinitialize trust anchors"
|
echo_i "reinitialize trust anchors"
|
||||||
stop_server --use-rndc --port "${CONTROLPORT}" mkeys ns2
|
stop_server --use-rndc --port "${CONTROLPORT}" ns2
|
||||||
rm -f ns2/managed-keys.bind*
|
rm -f ns2/managed-keys.bind*
|
||||||
nextpart ns2/named.run > /dev/null
|
nextpart ns2/named.run > /dev/null
|
||||||
start_server --noclean --restart --port "${PORT}" mkeys ns2
|
start_server --noclean --restart --port "${PORT}" ns2
|
||||||
|
|
||||||
n=$((n+1))
|
n=$((n+1))
|
||||||
echo_i "check positive validation ($n)"
|
echo_i "check positive validation ($n)"
|
||||||
@@ -579,11 +579,11 @@ ret=0
|
|||||||
mkeys_refresh_on 2 || ret=1
|
mkeys_refresh_on 2 || ret=1
|
||||||
mkeys_status_on 2 > rndc.out.1.$n 2>&1 || ret=1
|
mkeys_status_on 2 > rndc.out.1.$n 2>&1 || ret=1
|
||||||
t1=$(grep 'next refresh:' rndc.out.1.$n) || true
|
t1=$(grep 'next refresh:' rndc.out.1.$n) || true
|
||||||
stop_server --use-rndc --port "${CONTROLPORT}" mkeys ns1
|
stop_server --use-rndc --port "${CONTROLPORT}" ns1
|
||||||
rm -f ns1/root.db.signed.jnl
|
rm -f ns1/root.db.signed.jnl
|
||||||
cp ns1/root.db ns1/root.db.signed
|
cp ns1/root.db ns1/root.db.signed
|
||||||
nextpart ns1/named.run > /dev/null
|
nextpart ns1/named.run > /dev/null
|
||||||
start_server --noclean --restart --port "${PORT}" mkeys ns1
|
start_server --noclean --restart --port "${PORT}" ns1
|
||||||
wait_for_log 20 "all zones loaded" ns1/named.run || ret=1
|
wait_for_log 20 "all zones loaded" ns1/named.run || ret=1
|
||||||
mkeys_refresh_on 2 || ret=1
|
mkeys_refresh_on 2 || ret=1
|
||||||
mkeys_status_on 2 > rndc.out.2.$n 2>&1 || ret=1
|
mkeys_status_on 2 > rndc.out.2.$n 2>&1 || ret=1
|
||||||
@@ -613,11 +613,11 @@ ret=0
|
|||||||
mkeys_refresh_on 2 || ret=1
|
mkeys_refresh_on 2 || ret=1
|
||||||
mkeys_status_on 2 > rndc.out.1.$n 2>&1 || ret=1
|
mkeys_status_on 2 > rndc.out.1.$n 2>&1 || ret=1
|
||||||
t1=$(grep 'next refresh:' rndc.out.1.$n) || true
|
t1=$(grep 'next refresh:' rndc.out.1.$n) || true
|
||||||
stop_server --use-rndc --port "${CONTROLPORT}" mkeys ns1
|
stop_server --use-rndc --port "${CONTROLPORT}" ns1
|
||||||
rm -f ns1/root.db.signed.jnl
|
rm -f ns1/root.db.signed.jnl
|
||||||
cat ns1/K*.key >> ns1/root.db.signed
|
cat ns1/K*.key >> ns1/root.db.signed
|
||||||
nextpart ns1/named.run > /dev/null
|
nextpart ns1/named.run > /dev/null
|
||||||
start_server --noclean --restart --port "${PORT}" mkeys ns1
|
start_server --noclean --restart --port "${PORT}" ns1
|
||||||
wait_for_log 20 "all zones loaded" ns1/named.run || ret=1
|
wait_for_log 20 "all zones loaded" ns1/named.run || ret=1
|
||||||
# Less than a second may have passed since the last time ns2 received a
|
# Less than a second may have passed since the last time ns2 received a
|
||||||
# ./DNSKEY response from ns1. Ensure keys are refreshed at a different
|
# ./DNSKEY response from ns1. Ensure keys are refreshed at a different
|
||||||
@@ -715,9 +715,9 @@ ret=0
|
|||||||
# ensure key refresh retry will be scheduled to one actual hour after the first
|
# ensure key refresh retry will be scheduled to one actual hour after the first
|
||||||
# key refresh failure instead of just a few seconds, in order to prevent races
|
# key refresh failure instead of just a few seconds, in order to prevent races
|
||||||
# between the next scheduled key refresh time and startup time of restarted ns5.
|
# between the next scheduled key refresh time and startup time of restarted ns5.
|
||||||
stop_server --use-rndc --port "${CONTROLPORT}" mkeys ns5
|
stop_server --use-rndc --port "${CONTROLPORT}" ns5
|
||||||
nextpart ns5/named.run > /dev/null
|
nextpart ns5/named.run > /dev/null
|
||||||
start_server --noclean --restart --port "${PORT}" mkeys ns5
|
start_server --noclean --restart --port "${PORT}" ns5
|
||||||
wait_for_log 20 "Returned from key fetch in keyfetch_done()" ns5/named.run || ret=1
|
wait_for_log 20 "Returned from key fetch in keyfetch_done()" ns5/named.run || ret=1
|
||||||
# ns5/named.run will contain logs from both the old instance and the new
|
# ns5/named.run will contain logs from both the old instance and the new
|
||||||
# instance. In order for the test to pass, both must attempt a fetch.
|
# instance. In order for the test to pass, both must attempt a fetch.
|
||||||
@@ -729,14 +729,14 @@ status=$((status+ret))
|
|||||||
n=$((n+1))
|
n=$((n+1))
|
||||||
echo_i "check key refreshes are resumed after root servers become available ($n)"
|
echo_i "check key refreshes are resumed after root servers become available ($n)"
|
||||||
ret=0
|
ret=0
|
||||||
stop_server --use-rndc --port "${CONTROLPORT}" mkeys ns5
|
stop_server --use-rndc --port "${CONTROLPORT}" ns5
|
||||||
# Prevent previous check from affecting this one
|
# Prevent previous check from affecting this one
|
||||||
rm -f ns5/managed-keys.bind*
|
rm -f ns5/managed-keys.bind*
|
||||||
# named2.args adds "-T mkeytimers=2/20/40" to named1.args as we need to wait for
|
# named2.args adds "-T mkeytimers=2/20/40" to named1.args as we need to wait for
|
||||||
# an "hour" until keys are refreshed again after initial failure
|
# an "hour" until keys are refreshed again after initial failure
|
||||||
cp ns5/named2.args ns5/named.args
|
cp ns5/named2.args ns5/named.args
|
||||||
nextpart ns5/named.run > /dev/null
|
nextpart ns5/named.run > /dev/null
|
||||||
start_server --noclean --restart --port "${PORT}" mkeys ns5
|
start_server --noclean --restart --port "${PORT}" ns5
|
||||||
wait_for_log 20 "Returned from key fetch in keyfetch_done() for '.': failure" ns5/named.run || ret=1
|
wait_for_log 20 "Returned from key fetch in keyfetch_done() for '.': failure" ns5/named.run || ret=1
|
||||||
mkeys_secroots_on 5 || ret=1
|
mkeys_secroots_on 5 || ret=1
|
||||||
grep '; initializing managed' ns5/named.secroots > /dev/null 2>&1 || ret=1
|
grep '; initializing managed' ns5/named.secroots > /dev/null 2>&1 || ret=1
|
||||||
@@ -765,10 +765,10 @@ status=$((status+ret))
|
|||||||
n=$((n+1))
|
n=$((n+1))
|
||||||
echo_i "reinitialize trust anchors, add unsupported algorithm ($n)"
|
echo_i "reinitialize trust anchors, add unsupported algorithm ($n)"
|
||||||
ret=0
|
ret=0
|
||||||
stop_server --use-rndc --port "${CONTROLPORT}" mkeys ns6
|
stop_server --use-rndc --port "${CONTROLPORT}" ns6
|
||||||
rm -f ns6/managed-keys.bind*
|
rm -f ns6/managed-keys.bind*
|
||||||
nextpart ns6/named.run > /dev/null
|
nextpart ns6/named.run > /dev/null
|
||||||
start_server --noclean --restart --port "${PORT}" mkeys ns6
|
start_server --noclean --restart --port "${PORT}" ns6
|
||||||
# log when an unsupported algorithm is encountered during startup
|
# log when an unsupported algorithm is encountered during startup
|
||||||
wait_for_log 20 "ignoring initial-key for 'unsupported.': algorithm is unsupported" ns6/named.run || ret=1
|
wait_for_log 20 "ignoring initial-key for 'unsupported.': algorithm is unsupported" ns6/named.run || ret=1
|
||||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||||
|
@@ -129,12 +129,12 @@ digcomp dig.out.ns2.test$n dig.out.ns3.test$n || ret=1
|
|||||||
test_end
|
test_end
|
||||||
|
|
||||||
echo_i "stopping primary and restarting with example4 then waiting up to 45 seconds"
|
echo_i "stopping primary and restarting with example4 then waiting up to 45 seconds"
|
||||||
stop_server notify ns2
|
stop_server ns2
|
||||||
|
|
||||||
rm -f ns2/example.db
|
rm -f ns2/example.db
|
||||||
cp -f ns2/example4.db ns2/example.db
|
cp -f ns2/example4.db ns2/example.db
|
||||||
|
|
||||||
start_server --noclean --restart --port "${PORT}" notify ns2
|
start_server --noclean --restart --port "${PORT}" ns2
|
||||||
wait_for_log_re 45 "transfer of 'example/IN' from 10.53.0.2#.*success" ns3/named.run
|
wait_for_log_re 45 "transfer of 'example/IN' from 10.53.0.2#.*success" ns3/named.run
|
||||||
|
|
||||||
test_start "checking notify message was logged"
|
test_start "checking notify message was logged"
|
||||||
|
@@ -553,13 +553,13 @@ check_nsec3
|
|||||||
# Restart named, NSEC3 should stay the same.
|
# Restart named, NSEC3 should stay the same.
|
||||||
ret=0
|
ret=0
|
||||||
echo "stop ns3"
|
echo "stop ns3"
|
||||||
$PERL ../stop.pl --use-rndc --port ${CONTROLPORT} nsec3 ${DIR} || ret=1
|
stop_server --use-rndc --port ${CONTROLPORT} ${DIR} || ret=1
|
||||||
test "$ret" -eq 0 || echo_i "failed"
|
test "$ret" -eq 0 || echo_i "failed"
|
||||||
status=$((status+ret))
|
status=$((status+ret))
|
||||||
|
|
||||||
ret=0
|
ret=0
|
||||||
echo "start ns3"
|
echo "start ns3"
|
||||||
start_server --noclean --restart --port ${PORT} nsec3 ${DIR}
|
start_server --noclean --restart --port ${PORT} ${DIR}
|
||||||
test "$ret" -eq 0 || echo_i "failed"
|
test "$ret" -eq 0 || echo_i "failed"
|
||||||
status=$((status+ret))
|
status=$((status+ret))
|
||||||
|
|
||||||
|
@@ -388,7 +388,7 @@ rm named.pid
|
|||||||
cd ..
|
cd ..
|
||||||
sleep 10
|
sleep 10
|
||||||
if
|
if
|
||||||
start_server --noclean --restart --port ${PORT} nsupdate ns1
|
start_server --noclean --restart --port ${PORT} ns1
|
||||||
then
|
then
|
||||||
echo_i "restarted server ns1"
|
echo_i "restarted server ns1"
|
||||||
else
|
else
|
||||||
@@ -501,13 +501,13 @@ update add updated4.example.nil. 600 A 10.10.10.3
|
|||||||
send
|
send
|
||||||
END
|
END
|
||||||
sleep 3
|
sleep 3
|
||||||
$PERL ../stop.pl --use-rndc --port ${CONTROLPORT} nsupdate ns1
|
stop_server --use-rndc --port ${CONTROLPORT} ns1
|
||||||
sleep 3
|
sleep 3
|
||||||
# Removing the journal file and restarting the server means
|
# Removing the journal file and restarting the server means
|
||||||
# that the data served by the new server process are exactly
|
# that the data served by the new server process are exactly
|
||||||
# those dumped to the file by "rndc stop".
|
# those dumped to the file by "rndc stop".
|
||||||
rm -f ns1/*jnl
|
rm -f ns1/*jnl
|
||||||
start_server --noclean --restart --port ${PORT} nsupdate ns1
|
start_server --noclean --restart --port ${PORT} ns1
|
||||||
for try in 0 1 2 3 4 5 6 7 8 9; do
|
for try in 0 1 2 3 4 5 6 7 8 9; do
|
||||||
iret=0
|
iret=0
|
||||||
$DIG $DIGOPTS +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \
|
$DIG $DIGOPTS +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \
|
||||||
|
@@ -46,7 +46,7 @@ if [ $ret != 0 ]; then echo_i "failed"; fi
|
|||||||
status=$((status+ret))
|
status=$((status+ret))
|
||||||
|
|
||||||
echo_i "stopping ns1"
|
echo_i "stopping ns1"
|
||||||
$PERL ../stop.pl nzd2nzf ns1
|
stop_server ns1
|
||||||
|
|
||||||
n=$((n+1))
|
n=$((n+1))
|
||||||
echo_i "dumping _default.nzd to _default.nzf ($n)"
|
echo_i "dumping _default.nzd to _default.nzf ($n)"
|
||||||
@@ -64,7 +64,7 @@ echo_i "deleting _default.nzd database"
|
|||||||
rm -f ns1/_default.nzd
|
rm -f ns1/_default.nzd
|
||||||
|
|
||||||
echo_i "starting ns1 which should migrate the .nzf to .nzd"
|
echo_i "starting ns1 which should migrate the .nzf to .nzd"
|
||||||
start_server --noclean --restart --port ${PORT} nzd2nzf ns1
|
start_server --noclean --restart --port ${PORT} ns1
|
||||||
|
|
||||||
n=$((n+1))
|
n=$((n+1))
|
||||||
echo_i "querying for zone data from migrated zone config ($n)"
|
echo_i "querying for zone data from migrated zone config ($n)"
|
||||||
|
@@ -219,7 +219,7 @@ restart () {
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
start_server --noclean --restart --port ${PORT} rpz ns$1
|
start_server --noclean --restart --port ${PORT} ns$1
|
||||||
load_db
|
load_db
|
||||||
dnsrps_loaded
|
dnsrps_loaded
|
||||||
sleep 1
|
sleep 1
|
||||||
@@ -484,7 +484,7 @@ for mode in native dnsrps; do
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
echo_i "attempting to configure servers with DNSRPS..."
|
echo_i "attempting to configure servers with DNSRPS..."
|
||||||
$PERL ../stop.pl --use-rndc --port ${CONTROLPORT} rpz
|
stop_server --use-rndc --port ${CONTROLPORT}
|
||||||
$SHELL ./setup.sh -N -D $DEBUG
|
$SHELL ./setup.sh -N -D $DEBUG
|
||||||
for server in ns*; do
|
for server in ns*; do
|
||||||
resetstats $server
|
resetstats $server
|
||||||
@@ -499,7 +499,7 @@ for mode in native dnsrps; do
|
|||||||
continue
|
continue
|
||||||
else
|
else
|
||||||
echo_i "running DNSRPS sub-test"
|
echo_i "running DNSRPS sub-test"
|
||||||
start_server --noclean --restart --port ${PORT} rpz
|
start_server --noclean --restart --port ${PORT}
|
||||||
sleep 3
|
sleep 3
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
@@ -821,7 +821,7 @@ EOF
|
|||||||
|
|
||||||
# restart the main test RPZ server to see if that creates a core file
|
# restart the main test RPZ server to see if that creates a core file
|
||||||
if test -z "$HAVE_CORE"; then
|
if test -z "$HAVE_CORE"; then
|
||||||
$PERL ../stop.pl --use-rndc --port ${CONTROLPORT} rpz ns3
|
stop_server --use-rndc --port ${CONTROLPORT} ns3
|
||||||
restart 3 "rebuild-bl-rpz"
|
restart 3 "rebuild-bl-rpz"
|
||||||
HAVE_CORE=`find ns* -name '*core*' -print`
|
HAVE_CORE=`find ns* -name '*core*' -print`
|
||||||
test -z "$HAVE_CORE" || setret "found $HAVE_CORE; memory leak?"
|
test -z "$HAVE_CORE" || setret "found $HAVE_CORE; memory leak?"
|
||||||
@@ -841,11 +841,11 @@ EOF
|
|||||||
# restart the main test RPZ server with a bad zone.
|
# restart the main test RPZ server with a bad zone.
|
||||||
t=`expr $t + 1`
|
t=`expr $t + 1`
|
||||||
echo_i "checking that ns3 with broken rpz does not crash (${t})"
|
echo_i "checking that ns3 with broken rpz does not crash (${t})"
|
||||||
$PERL ../stop.pl --use-rndc --port ${CONTROLPORT} rpz ns3
|
stop_server --use-rndc --port ${CONTROLPORT} ns3
|
||||||
cp ns3/broken.db.in ns3/bl.db
|
cp ns3/broken.db.in ns3/bl.db
|
||||||
restart 3 # do not rebuild rpz zones
|
restart 3 # do not rebuild rpz zones
|
||||||
nocrash a3-1.tld2 -tA
|
nocrash a3-1.tld2 -tA
|
||||||
$PERL ../stop.pl --use-rndc --port ${CONTROLPORT} rpz ns3
|
stop_server --use-rndc --port ${CONTROLPORT} ns3
|
||||||
restart 3 "rebuild-bl-rpz"
|
restart 3 "rebuild-bl-rpz"
|
||||||
|
|
||||||
t=`expr $t + 1`
|
t=`expr $t + 1`
|
||||||
|
@@ -47,13 +47,13 @@ run_server() {
|
|||||||
TESTNAME=$1
|
TESTNAME=$1
|
||||||
|
|
||||||
echo_i "stopping resolver"
|
echo_i "stopping resolver"
|
||||||
$PERL ../stop.pl --use-rndc --port ${CONTROLPORT} rpzrecurse ns2
|
stop_server --use-rndc --port ${CONTROLPORT} ns2
|
||||||
|
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
echo_i "starting resolver using named.$TESTNAME.conf"
|
echo_i "starting resolver using named.$TESTNAME.conf"
|
||||||
cp -f ns2/named.$TESTNAME.conf ns2/named.conf
|
cp -f ns2/named.$TESTNAME.conf ns2/named.conf
|
||||||
start_server --noclean --restart --port ${PORT} rpzrecurse ns2
|
start_server --noclean --restart --port ${PORT} ns2
|
||||||
sleep 3
|
sleep 3
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ for mode in native dnsrps; do
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
echo_i "attempting to configure servers with DNSRPS..."
|
echo_i "attempting to configure servers with DNSRPS..."
|
||||||
$PERL ../stop.pl --use-rndc --port ${CONTROLPORT} rpzrecurse
|
stop_server --use-rndc --port ${CONTROLPORT}
|
||||||
$SHELL ./setup.sh -N -D $DEBUG
|
$SHELL ./setup.sh -N -D $DEBUG
|
||||||
sed -n 's/^## //p' dnsrps.conf | cat_i
|
sed -n 's/^## //p' dnsrps.conf | cat_i
|
||||||
if grep '^#fail' dnsrps.conf >/dev/null; then
|
if grep '^#fail' dnsrps.conf >/dev/null; then
|
||||||
@@ -135,7 +135,7 @@ for mode in native dnsrps; do
|
|||||||
continue
|
continue
|
||||||
else
|
else
|
||||||
echo_i "running DNSRPS sub-test"
|
echo_i "running DNSRPS sub-test"
|
||||||
start_server --noclean --restart --port ${PORT} rpzrecurse
|
start_server --noclean --restart --port ${PORT}
|
||||||
sleep 3
|
sleep 3
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
@@ -274,7 +274,7 @@ status=$((status + ret))
|
|||||||
|
|
||||||
echo_i "Shutting down secondary"
|
echo_i "Shutting down secondary"
|
||||||
|
|
||||||
stop_server rrsetorder ns2
|
stop_server ns2
|
||||||
|
|
||||||
echo_i "Checking for secondary's on disk copy of zone"
|
echo_i "Checking for secondary's on disk copy of zone"
|
||||||
|
|
||||||
@@ -286,7 +286,7 @@ fi
|
|||||||
|
|
||||||
echo_i "Re-starting secondary"
|
echo_i "Re-starting secondary"
|
||||||
|
|
||||||
start_server --noclean --restart --port ${PORT} rrsetorder ns2
|
start_server --noclean --restart --port ${PORT} ns2
|
||||||
|
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
@@ -1368,7 +1368,7 @@ if [ $ret != 0 ]; then echo_i "failed"; fi
|
|||||||
status=$((status+ret))
|
status=$((status+ret))
|
||||||
|
|
||||||
echo_i "stop ns4"
|
echo_i "stop ns4"
|
||||||
$PERL ../stop.pl --use-rndc --port ${CONTROLPORT} serve-stale ns4
|
stop_server --use-rndc --port ${CONTROLPORT} ns4
|
||||||
|
|
||||||
# Load the cache as if it was five minutes (RBTDB_VIRTUAL) older. Since
|
# Load the cache as if it was five minutes (RBTDB_VIRTUAL) older. Since
|
||||||
# max-stale-ttl defaults to a week, we need to adjust the date by one week and
|
# max-stale-ttl defaults to a week, we need to adjust the date by one week and
|
||||||
@@ -1387,7 +1387,7 @@ if [ $ret != 0 ]; then echo_i "failed"; fi
|
|||||||
status=$((status+ret))
|
status=$((status+ret))
|
||||||
|
|
||||||
echo_i "start ns4"
|
echo_i "start ns4"
|
||||||
start_server --noclean --restart --port ${PORT} serve-stale ns4
|
start_server --noclean --restart --port ${PORT} ns4
|
||||||
|
|
||||||
n=$((n+1))
|
n=$((n+1))
|
||||||
echo_i "verify ancient cache statistics (serve-stale answers disabled) ($n)"
|
echo_i "verify ancient cache statistics (serve-stale answers disabled) ($n)"
|
||||||
@@ -1606,7 +1606,7 @@ if [ $ret != 0 ]; then echo_i "failed"; fi
|
|||||||
status=$((status+ret))
|
status=$((status+ret))
|
||||||
|
|
||||||
echo_i "stop ns5"
|
echo_i "stop ns5"
|
||||||
$PERL ../stop.pl --use-rndc --port ${CONTROLPORT} serve-stale ns5
|
stop_server --use-rndc --port ${CONTROLPORT} ns5
|
||||||
|
|
||||||
# Load the cache as if it was five minutes (RBTDB_VIRTUAL) older.
|
# Load the cache as if it was five minutes (RBTDB_VIRTUAL) older.
|
||||||
cp ns5/named_dump.db.test$n ns5/named_dump.db
|
cp ns5/named_dump.db.test$n ns5/named_dump.db
|
||||||
@@ -1624,7 +1624,7 @@ if [ $ret != 0 ]; then echo_i "failed"; fi
|
|||||||
status=$((status+ret))
|
status=$((status+ret))
|
||||||
|
|
||||||
echo_i "start ns5"
|
echo_i "start ns5"
|
||||||
start_server --noclean --restart --port ${PORT} serve-stale ns5
|
start_server --noclean --restart --port ${PORT} ns5
|
||||||
|
|
||||||
n=$((n+1))
|
n=$((n+1))
|
||||||
echo_i "verify ancient cache statistics (serve-stale cache disabled) ($n)"
|
echo_i "verify ancient cache statistics (serve-stale cache disabled) ($n)"
|
||||||
@@ -1655,8 +1655,8 @@ if [ $ret != 0 ]; then echo_i "failed"; fi
|
|||||||
status=$((status+ret))
|
status=$((status+ret))
|
||||||
|
|
||||||
echo_i "restart ns3"
|
echo_i "restart ns3"
|
||||||
$PERL ../stop.pl --use-rndc --port ${CONTROLPORT} serve-stale ns3
|
stop_server --use-rndc --port ${CONTROLPORT} ns3
|
||||||
start_server --noclean --restart --port ${PORT} serve-stale ns3
|
start_server --noclean --restart --port ${PORT} ns3
|
||||||
|
|
||||||
n=$((n+1))
|
n=$((n+1))
|
||||||
echo_i "check 'rndc serve-stale status' ($n)"
|
echo_i "check 'rndc serve-stale status' ($n)"
|
||||||
@@ -1842,8 +1842,8 @@ if [ $ret != 0 ]; then echo_i "failed"; fi
|
|||||||
status=$((status+ret))
|
status=$((status+ret))
|
||||||
|
|
||||||
echo_i "restart ns3"
|
echo_i "restart ns3"
|
||||||
$PERL ../stop.pl --use-rndc --port ${CONTROLPORT} serve-stale ns3
|
stop_server --use-rndc --port ${CONTROLPORT} ns3
|
||||||
start_server --noclean --restart --port ${PORT} serve-stale ns3
|
start_server --noclean --restart --port ${PORT} ns3
|
||||||
|
|
||||||
n=$((n+1))
|
n=$((n+1))
|
||||||
echo_i "prime cache data.example (stale-answer-client-timeout 0)"
|
echo_i "prime cache data.example (stale-answer-client-timeout 0)"
|
||||||
@@ -1985,7 +1985,7 @@ $RNDCCMD 10.53.0.3 status > rndc.out.test$n 2>&1 || ret=1
|
|||||||
if [ $ret != 0 ]; then
|
if [ $ret != 0 ]; then
|
||||||
echo_i "failed"
|
echo_i "failed"
|
||||||
echo_i "restart ns3"
|
echo_i "restart ns3"
|
||||||
start_server --noclean --restart --port ${PORT} serve-stale ns3
|
start_server --noclean --restart --port ${PORT} ns3
|
||||||
fi
|
fi
|
||||||
status=$((status+ret))
|
status=$((status+ret))
|
||||||
|
|
||||||
@@ -2025,7 +2025,7 @@ $RNDCCMD 10.53.0.3 status > rndc.out.test$n 2>&1 || ret=1
|
|||||||
if [ $ret != 0 ]; then
|
if [ $ret != 0 ]; then
|
||||||
echo_i "failed"
|
echo_i "failed"
|
||||||
echo_i "restart ns3"
|
echo_i "restart ns3"
|
||||||
start_server --noclean --restart --port ${PORT} serve-stale ns3
|
start_server --noclean --restart --port ${PORT} ns3
|
||||||
fi
|
fi
|
||||||
status=$((status+ret))
|
status=$((status+ret))
|
||||||
|
|
||||||
|
@@ -54,10 +54,10 @@ digcomp knowngood.dig.out.rec dig.out.ns3 || ret=1
|
|||||||
|
|
||||||
[ $pass = 1 ] && {
|
[ $pass = 1 ] && {
|
||||||
echo_i "stopping stub server"
|
echo_i "stopping stub server"
|
||||||
$PERL ../stop.pl stub ns3
|
stop_server ns3
|
||||||
|
|
||||||
echo_i "re-starting stub server"
|
echo_i "re-starting stub server"
|
||||||
start_server --noclean --restart --port ${PORT} stub ns3
|
start_server --noclean --restart --port ${PORT} ns3
|
||||||
}
|
}
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@@ -157,8 +157,8 @@ done
|
|||||||
status=`expr $status + $ret`
|
status=`expr $status + $ret`
|
||||||
|
|
||||||
echo_i "stop and restart secondary"
|
echo_i "stop and restart secondary"
|
||||||
$PERL ../stop.pl unknown ns2
|
stop_server ns2
|
||||||
start_server --noclean --restart --port ${PORT} unknown ns2
|
start_server --noclean --restart --port ${PORT} ns2
|
||||||
|
|
||||||
# server may be answering queries before zones are loaded,
|
# server may be answering queries before zones are loaded,
|
||||||
# so retry a few times if this query fails
|
# so retry a few times if this query fails
|
||||||
@@ -183,8 +183,8 @@ diff large.out dig.out.test$n > /dev/null || { ret=1 ; echo_i "diff failed"; }
|
|||||||
status=`expr $status + $ret`
|
status=`expr $status + $ret`
|
||||||
|
|
||||||
echo_i "stop and restart inline secondary"
|
echo_i "stop and restart inline secondary"
|
||||||
$PERL ../stop.pl unknown ns3
|
stop_server ns3
|
||||||
start_server --noclean --restart --port ${PORT} unknown ns3
|
start_server --noclean --restart --port ${PORT} ns3
|
||||||
|
|
||||||
# server may be answering queries before zones are loaded,
|
# server may be answering queries before zones are loaded,
|
||||||
# so retry a few times if this query fails
|
# so retry a few times if this query fails
|
||||||
|
@@ -495,8 +495,8 @@ echo_i "test mapped zone with out of zone data ($n)"
|
|||||||
tmp=0
|
tmp=0
|
||||||
$DIG -p ${PORT} txt mapped @10.53.0.3 > dig.out.1.test$n
|
$DIG -p ${PORT} txt mapped @10.53.0.3 > dig.out.1.test$n
|
||||||
grep "status: NOERROR," dig.out.1.test$n > /dev/null || tmp=1
|
grep "status: NOERROR," dig.out.1.test$n > /dev/null || tmp=1
|
||||||
$PERL ../stop.pl xfer ns3
|
stop_server ns3
|
||||||
start_server --noclean --restart --port ${PORT} xfer ns3
|
start_server --noclean --restart --port ${PORT} ns3
|
||||||
check_mapped () {
|
check_mapped () {
|
||||||
$DIG -p ${PORT} txt mapped @10.53.0.3 > dig.out.2.test$n
|
$DIG -p ${PORT} txt mapped @10.53.0.3 > dig.out.2.test$n
|
||||||
grep "status: NOERROR," dig.out.2.test$n > /dev/null || return 1
|
grep "status: NOERROR," dig.out.2.test$n > /dev/null || return 1
|
||||||
|
Reference in New Issue
Block a user