From b4694e7551b0bd2b0380eb398dde167c89ac80f5 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 28 Aug 2023 11:40:46 +1000 Subject: [PATCH] Check that removal of nonexistent PTR and SRV records work There was a bug in rr_exists that caused it to fail when the name didn't exist in the zone. (cherry picked from commit 2b7192c5be69486fea8dd45b07edae39658eecde) --- bin/tests/system/nsupdate/tests.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/bin/tests/system/nsupdate/tests.sh b/bin/tests/system/nsupdate/tests.sh index 50dadce747..44830d4b25 100755 --- a/bin/tests/system/nsupdate/tests.sh +++ b/bin/tests/system/nsupdate/tests.sh @@ -462,6 +462,28 @@ fi echo_i "end RT #482 regression test" +n=$((n + 1)) +ret=0 +echo_i "remove nonexistent PTR record ($n)" +$NSUPDATE -k ns1/ddns.key -d << EOF > nsupdate.out.test$n 2>&1 || ret=1 +server 10.53.0.1 ${PORT} +zone example.nil. +update delete nonexistent.example.nil. 0 IN PTR foo. +send +EOF +[ $ret = 0 ] || { echo_i "failed"; status=1; } + +n=$((n + 1)) +ret=0 +echo_i "remove nonexistent SRV record ($n)" +$NSUPDATE -k ns1/ddns.key -d << EOF > nsupdate.out.test$n 2>&1 || ret=1 +server 10.53.0.1 ${PORT} +zone example.nil. +update delete nonexistent.example.nil. 0 IN SRV 0 0 0 foo. +send +EOF +[ $ret = 0 ] || { echo_i "failed"; status=1; } + n=$((n + 1)) ret=0 echo_i "start NSEC3PARAM changes via UPDATE on a unsigned zone test ($n)"