]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add an "rpz" system test check for a failed reconfiguration
authorAram Sargsyan <aram@isc.org>
Fri, 17 Feb 2023 12:38:40 +0000 (12:38 +0000)
committerAram Sargsyan <aram@isc.org>
Tue, 21 Feb 2023 08:23:13 +0000 (08:23 +0000)
The faulty "DLZ" configuration triggers a reconfiguration failure
in such a place where view reverting code is covered.

bin/tests/system/rpz/ns3/named.conf.in
bin/tests/system/rpz/tests.sh

index b0f6804bd29aacae5a6eab15fd41f4b3a4f030dd..80a9d832f03d3bfdbfbf09ee1bb1b255fafe6606 100644 (file)
@@ -148,3 +148,13 @@ zone "static-stub-nomatch." {
        type static-stub;
        server-addresses { 10.53.0.10; };
 };
+
+# A faulty dlz configuration to check if named with response policy zones
+# survives a certain class of failed configuration attempts (see GL #3880).
+# "dlz" is used because the dlz processing code is located in an ideal place in
+# the view configuration function for the test to cover the view reverting code.
+# The "BAD" comments below are necessary, because they will be removed using
+# 'sed' by tests.sh in order to activate the faulty configuration.
+#BAD   dlz "bad-dlz" {
+#BAD           database "dlopen bad-dlz.so example.org";
+#BAD   };
index 1cfafbe813c7898164db1bd29073b781185d1543..4e83a6b7021f63dbf4870659676081dbaac745d0 100644 (file)
@@ -848,6 +848,16 @@ EOF
     stop_server --use-rndc --port ${CONTROLPORT} ns3
     restart 3 "rebuild-bl-rpz"
 
+    t=`expr $t + 1`
+    echo_i "checking if rpz survives a certain class of failed reconfiguration attempts (${t})"
+    sed -e "s/^#BAD//" < ns3/named.conf.in > ns3/named.conf.tmp
+    copy_setports ns3/named.conf.tmp ns3/named.conf
+    rm ns3/named.conf.tmp
+    $RNDCCMD $ns3 reconfig > /dev/null 2>&1 && setret "failed"
+    sleep 1
+    copy_setports ns3/named.conf.in ns3/named.conf
+    $RNDCCMD $ns3 reconfig || setret "failed"
+
     t=`expr $t + 1`
     echo_i "checking the configured extended DNS error code (EDE) (${t})"
     $DIG -p ${PORT} @$ns3 walled.tld2 > dig.out.$t