While a response-policy zone is being (re)loaded it can briefly answer
with no SOA (SERVFAIL/REFUSED), which `dig +short` renders as empty
output. get_sn() aborted the whole tests.sh on the first such miss,
defeating the retry_quiet() loop in ck_soa() that is meant to wait for
the reload to settle. Return failure instead so the check is retried.
Assisted-by: Claude:claude-opus-4-8
$DIG -p "${PORT}" +short +norecurse soa "$1" "@$2" "-b$2" >$DIGNM
SN=$(awk '{ print $3 }' <$DIGNM)
[ -n "$SN" ] && return
+ # A policy zone being (re)loaded can briefly answer with no SOA
+ # (SERVFAIL/REFUSED), which +short renders as empty output. Return
+ # failure rather than aborting so the retry_quiet() in ck_soa() can
+ # probe again instead of dying on a single transient miss.
echo_i "no serial number from \`dig -p ${PORT} soa $1 @$2\`"
- exit 1
+ return 1
}
# check the serial number in an SOA to ensure that a policy zone has
# $2=domain
# $3=DNS server
test_soa() {
- get_sn "$2" "$3"
+ get_sn "$2" "$3" || return 1
test "$SN" -eq "$1"
}