]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Test restart works after rndc modzone
authorMatthijs Mekking <matthijs@isc.org>
Tue, 31 Mar 2026 12:46:19 +0000 (14:46 +0200)
committerMatthijs Mekking <matthijs@isc.org>
Thu, 2 Apr 2026 12:35:54 +0000 (12:35 +0000)
When a zone that is configured in named.conf is modified with
'rndc modzone', the new zone configuration is now also stored in the
NZD. Add a test to ensure that after a restart, the old zone
configuration is used.

bin/tests/system/addzone/tests.sh

index 9634bd5777f1e23f9e9c33de491cc90e0f493ea1..a26368828df6b95d0e2bf06cc82577a60420716c 100755 (executable)
@@ -474,6 +474,18 @@ n=$((n + 1))
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=$((status + ret))
 
+echo_i "check that named restarts with previously deleted normal.example zone ($n)"
+ret=0
+stop_server ns2
+start_server --noclean --restart --port ${PORT} ns2 || ret=1
+ret=0
+$RNDCCMD 10.53.0.2 showzone normal.example >rndc.out.ns2.$n
+expected='zone "normal.example" { type primary; file "normal.db"; };'
+[ "$(cat rndc.out.ns2.$n)" = "$expected" ] || ret=1
+n=$((n + 1))
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=$((status + ret))
+
 echo_i "reconfiguring server with multiple views"
 cp ns2/named2.conf ns2/named.conf
 rndc_reconfig ns2 10.53.0.2