]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix couple of no-op tests to actually test something (configuration files were missing)
authorOndřej Surý <ondrej@sury.org>
Sat, 16 Nov 2019 05:15:56 +0000 (13:15 +0800)
committerMichał Kępień <michal@isc.org>
Wed, 8 Jan 2020 08:27:16 +0000 (09:27 +0100)
(cherry picked from commit b5a18ac43902e060f7c2145e0698f6054c2b0c63)

bin/tests/system/runtime/setup.sh
bin/tests/system/runtime/tests.sh

index 522a6e69d2bed65f50f80b263cfadd7db0c6d007..55bfd33655df50987015b8e11ee83e3b1d3d3b52 100644 (file)
@@ -19,6 +19,9 @@ copy_setports ns2/named1.conf.in ns2/named.conf
 copy_setports ns2/named-alt1.conf.in ns2/named-alt1.conf
 copy_setports ns2/named-alt2.conf.in ns2/named-alt2.conf
 copy_setports ns2/named-alt3.conf.in ns2/named-alt3.conf
+copy_setports ns2/named-alt4.conf.in ns2/named-alt4.conf
+copy_setports ns2/named-alt5.conf.in ns2/named-alt5.conf
+copy_setports ns2/named-alt6.conf.in ns2/named-alt6.conf
 
 mkdir ns2/nope
 
index e0137509e626c4a9e465e0d5b58c6c76beeca014..71c1197304b8e752869f8c84dfda7d864d5ed414 100644 (file)
@@ -102,6 +102,15 @@ $RNDCCMD 10.53.0.2 reconfig > rndc.out.$n 2>&1
 grep "failed: permission denied" rndc.out.$n > /dev/null 2>&1 || ret=1
 sleep 1
 grep "new-zones-directory './nope' is not writable" ns2/named.run > /dev/null 2>&1 || ret=1
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=`expr $status + $ret`
+
+n=`expr $n + 1`
+echo_i "checking that named recovers when configuration file is valid again ($n)"
+ret=0
+copy_setports ns2/named1.conf.in ns2/named.conf
+$RNDCCMD 10.53.0.2 reconfig > rndc.out.$n 2>&1 || ret=1
+[ -s ns2/named.pid ] || ret=1
 kill_named ns2/named.pid || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
@@ -130,6 +139,16 @@ cd ..
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
+n=`expr $n + 1`
+echo_i "checking that named refuses to start if new-zones-directory is not writable ($n)"
+ret=0
+(cd ns2 && $NAMED -c named-alt6.conf -D runtime-ns2-extra-6 -d 99 -g > named6.run 2>&1 &)
+sleep 2
+grep "exiting (due to fatal error)" ns2/named6.run > /dev/null || ret=1
+kill_named ns2/named.pid && ret=1
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=`expr $status + $ret`
+
 n=`expr $n + 1`
 echo_i "verifying that named switches UID ($n)"
 if [ "`id -u`" = 0 ] && [ ! "$CYGWIN" ]; then