]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add a new check in "addzone" system test
authorAram Sargsyan <aram@isc.org>
Mon, 13 Apr 2026 17:00:49 +0000 (17:00 +0000)
committerAram Sargsyan <aram@isc.org>
Tue, 14 Apr 2026 08:57:12 +0000 (08:57 +0000)
Check that named handles requests to modify non-existing zones
without issues.

bin/tests/system/addzone/tests.sh

index a26368828df6b95d0e2bf06cc82577a60420716c..0888695de8bfcbd06ba6c0c1cb68298de7c935e6 100755 (executable)
@@ -45,7 +45,17 @@ expected='zone "normal.example" { type primary; file "normal.db"; };'
 n=$((n + 1))
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=$((status + ret))
-# modzone
+
+# modzone (non-existing)
+echo_i "modzone non-existing zone ($n)"
+ret=0
+$RNDCCMD 10.53.0.2 modzone non-existing.example '{ type primary; file "non-existing.db"; };' >rndc.out.ns2.$n 2>&1 && ret=1
+grep "rndc: 'modzone' failed: not found" rndc.out.ns2.$n >/dev/null || ret=1
+n=$((n + 1))
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=$((status + ret))
+
+# modzone (normal)
 echo_i "modzone normally loaded zone ($n)"
 ret=0
 $RNDCCMD 10.53.0.2 modzone normal.example '{ type primary; file "normal.db"; };' >rndc.out.ns2.$n