# an unlimited lifetime. Fallback to the default loadkeys interval.
check_next_key_event 3600
+_check_soa_ttl() {
+ dig_with_opts @10.53.0.6 example SOA > dig.out.ns6.test$n.soa2 || return 1
+ soa1=$(awk '$4 == "SOA" { print $7 }' dig.out.ns6.test$n.soa1)
+ soa2=$(awk '$4 == "SOA" { print $7 }' dig.out.ns6.test$n.soa2)
+ ttl1=$(awk '$4 == "SOA" { print $2 }' dig.out.ns6.test$n.soa1)
+ ttl2=$(awk '$4 == "SOA" { print $2 }' dig.out.ns6.test$n.soa2)
+ test ${soa1:-1000} -lt ${soa2:-0} || return 1
+ test ${ttl1:-0} -eq $1 || return 1
+ test ${ttl2:-0} -eq $2 || return 1
+}
+
echo_i "Check that 'rndc reload' of just the serial updates the signed instance ($n)"
TSIG=
ret=0
nextpart ns6/named.run > /dev/null
rndccmd 10.53.0.6 reload || ret=1
wait_for_log 3 "all zones loaded" ns6/named.run
-sleep 1
-dig_with_opts @10.53.0.6 example SOA > dig.out.ns6.test$n.soa2 || ret=1
-soa1=$(awk '$4 == "SOA" { print $7 }' dig.out.ns6.test$n.soa1)
-soa2=$(awk '$4 == "SOA" { print $7 }' dig.out.ns6.test$n.soa2)
-ttl1=$(awk '$4 == "SOA" { print $2 }' dig.out.ns6.test$n.soa1)
-ttl2=$(awk '$4 == "SOA" { print $2 }' dig.out.ns6.test$n.soa2)
-test ${soa1:-1000} -lt ${soa2:-0} || ret=1
-test ${ttl1:-0} -eq 300 || ret=1
-test ${ttl2:-0} -eq 300 || ret=1
+# Check that the SOA SERIAL increases and check the TTLs (should be 300 as
+# defined in ns6/example2.db.in).
+retry_quiet 10 _check_soa_ttl 300 300 || ret=1
test "$ret" -eq 0 || echo_i "failed"
status=$((status+ret))
n=$((n+1))
nextpart ns6/named.run > /dev/null
start_server --noclean --restart --port ${PORT} kasp ns6
wait_for_log 3 "all zones loaded" ns6/named.run
-sleep 1
-dig_with_opts @10.53.0.6 example SOA > dig.out.ns6.test$n.soa2 || ret=1
-soa1=$(awk '$4 == "SOA" { print $7 }' dig.out.ns6.test$n.soa1)
-soa2=$(awk '$4 == "SOA" { print $7 }' dig.out.ns6.test$n.soa2)
-ttl1=$(awk '$4 == "SOA" { print $2 }' dig.out.ns6.test$n.soa1)
-ttl2=$(awk '$4 == "SOA" { print $2 }' dig.out.ns6.test$n.soa2)
-test ${soa1:-1000} -lt ${soa2:-0} || ret=1
-test ${ttl1:-0} -eq 300 || ret=1
-test ${ttl2:-0} -eq 400 || ret=1
+# Check that the SOA SERIAL increases and check the TTLs (should be changed
+# from 300 to 400 as defined in ns6/example3.db.in).
+retry_quiet 10 _check_soa_ttl 300 400 || ret=1
test "$ret" -eq 0 || echo_i "failed"
status=$((status+ret))
n=$((n+1))