fix: test: rndc test: second 'rndc reconfig' happens too soon

Rndc test "test 'rndc reconfig' with a broken config" was failing
intermittently.

Wait for 'running' to be logged rather than just using 'sleep 1' before
calling 'rndc reconfig' a second time to get the expected error message
rather than 'reconfig request ignored: already running'.

Closes #5408

Merge branch '5408-rndc-test-second-rndc-reconfig-happens-too-soon' into 'main'

See merge request isc-projects/bind9!10687
This commit is contained in:
Mark Andrews 2025-07-07 12:21:58 +10:00
commit a9575a4154

View file

@ -562,8 +562,9 @@ status=$((status + ret))
n=$((n + 1))
echo_i "test 'rndc reconfig' with a broken config ($n)"
ret=0
nextpart ns4/named.run >/dev/null
$RNDC -s 10.53.0.4 -p ${EXTRAPORT6} -c ns4/key6.conf reconfig >/dev/null || ret=1
sleep 1
wait_for_log 3 "running" ns4/named.run
mv ns4/named.conf ns4/named.conf.save
echo "error error error" >>ns4/named.conf
$RNDC -s 10.53.0.4 -p ${EXTRAPORT6} -c ns4/key6.conf reconfig >rndc.out.1.test$n 2>&1 && ret=1
@ -582,10 +583,11 @@ status=$((status + ret))
n=$((n + 1))
echo_i "restore working config ($n)"
ret=0
nextpart ns4/named.run >/dev/null
mv ns4/named.conf.save ns4/named.conf
sleep 1
$RNDC -s 10.53.0.4 -p ${EXTRAPORT6} -c ns4/key6.conf reconfig >/dev/null || ret=1
sleep 1
wait_for_log 3 "running" ns4/named.run
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))