]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
add a regression test for record deletion
authorEvan Hunt <each@isc.org>
Sat, 21 Dec 2024 00:39:49 +0000 (16:39 -0800)
committerEvan Hunt <each@isc.org>
Fri, 10 Jan 2025 01:03:51 +0000 (17:03 -0800)
test that there's no crash when querying for a newly-deleted node.

(incidentally also renamed ns3/named.conf.in to ns3/named1.conf.in,
because named2.conf.in does exist, and they should match.)

bin/tests/system/nsec3/ns3/named1.conf.in [moved from bin/tests/system/nsec3/ns3/named.conf.in with 100% similarity]
bin/tests/system/nsec3/ns3/named2-fips.conf.in
bin/tests/system/nsec3/ns3/setup.sh
bin/tests/system/nsec3/setup.sh
bin/tests/system/nsec3/tests.sh

index 8b42abbccee4bf4f6c9c9b3283f0f070a1172650..6c7499d01f2726f6df10e1677a0e1593645d4f32 100644 (file)
@@ -145,3 +145,13 @@ zone "nsec3-inline-to-dynamic.kasp" {
        dnssec-policy "nsec3";
        allow-update { any; };
 };
+
+/*
+ * This zone will have a node deleted.
+ */
+zone "nsec3-ent.kasp" {
+       type primary;
+       file "nsec3-ent.kasp.db";
+       dnssec-policy "nsec3";
+       inline-signing yes;
+};
index 7db6d3910c44ea89b3dc5d2066193cc483cbf15d..32ddf5e9c59c7e8e5ce480ded9b50cd4f784fb7a 100644 (file)
@@ -20,14 +20,14 @@ setup() {
   zone="$1"
   echo_i "setting up zone: $zone"
   zonefile="${zone}.db"
-  infile="${zone}.db.infile"
   cp template.db.in "$zonefile"
 }
 
 for zn in nsec-to-nsec3 nsec3 nsec3-other nsec3-change nsec3-to-nsec \
   nsec3-to-optout nsec3-from-optout nsec3-dynamic \
   nsec3-dynamic-change nsec3-dynamic-to-inline \
-  nsec3-inline-to-dynamic nsec3-dynamic-update-inline; do
+  nsec3-inline-to-dynamic nsec3-dynamic-update-inline \
+  nsec3-ent; do
   setup "${zn}.kasp"
 done
 
index f995033e5f65202ce2e7d5a81208c63bfc725148..56c3ac2eef3de1a13d6a0e5dfb3970a8def152e2 100644 (file)
@@ -27,7 +27,7 @@ if [ $RSASHA1_SUPPORTED = 0 ]; then
 else
   copy_setports ns3/named-fips.conf.in ns3/named-fips.conf
   # includes named-fips.conf
-  cp ns3/named.conf.in ns3/named.conf
+  cp ns3/named1.conf.in ns3/named.conf
 fi
 (
   cd ns3
index bae2279aa41c28a44e497cffa19ec4b9d920bd8e..37a9faa849c469030cd7ccbf6c6b2d81e350486b 100644 (file)
@@ -584,5 +584,21 @@ set_key_default_values "KEY1"
 echo_i "check zone ${ZONE} after reload"
 check_nsec3
 
+# Zone: nsec3-ent.kasp (regression test for #5108)
+n=$((n + 1))
+echo_i "check queries for newly empty names do not crash ($n)"
+set_zone_policy "nsec3-ent.kasp"
+set_server "ns3" "10.53.0.3"
+# confirm the pre-existing name still exists
+dig_with_opts +noquestion "@${SERVER}" c.$ZONE >"dig.out.$ZONE.test$n.1" || ret=1
+grep "c\.nsec3-ent\.kasp\..*IN.*A.*10\.0\.0\.3" "dig.out.$ZONE.test$n.1" >/dev/null || ret=1
+# remove a name, bump the SOA, reload, and try the query again
+sed -e 's/1 *; serial/2/' -e '/^c/d' ns3/template.db.in >ns3/nsec3-ent.kasp.db
+rndc_reload ns3 10.53.0.3
+dig_with_opts +noquestion "@${SERVER}" c.$ZONE >"dig.out.$ZONE.test$n.2" || ret=1
+grep "status: NXDOMAIN" "dig.out.$ZONE.test$n.2" >/dev/null || ret=1
+if [ "$ret" -ne 0 ]; then echo_i "failed"; fi
+status=$((status + ret))
+
 echo_i "exit status: $status"
 [ $status -eq 0 ] || exit 1