From 827bba05a090cf392b1c54a4d857b7808c6a067f Mon Sep 17 00:00:00 2001 From: Matthijs Mekking Date: Wed, 1 Jun 2022 11:49:20 +0200 Subject: [PATCH] Retry quiet to deal with kasp test timing issue In the cases where we test SOA serial updates and TTL updates, we check if for "all zones loaded" to ensure the new zone content is loaded. But this is the unsigned zone, the signed zone still needs to be produced. There is thus a timing issue where the dig request comes in before the signing process has finished. Add a retry quiet to mitigate against it. --- bin/tests/system/kasp/tests.sh | 35 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/bin/tests/system/kasp/tests.sh b/bin/tests/system/kasp/tests.sh index 650c961f4e..8856e2db7d 100644 --- a/bin/tests/system/kasp/tests.sh +++ b/bin/tests/system/kasp/tests.sh @@ -4660,6 +4660,17 @@ dnssec_verify # 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 @@ -4668,15 +4679,9 @@ cp ns6/example2.db.in ns6/example.db || ret=1 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)) @@ -4692,15 +4697,9 @@ rm ns6/example.db.jnl 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))