]> 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)
committerOndřej Surý <ondrej@isc.org>
Tue, 26 Nov 2019 11:11:06 +0000 (12:11 +0100)
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 2f2c24a9fadd830fe2ff430b0a4a1a198922bad2..f2c5983723132ae93af0bbf266d29b844d9d64a0 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 "checking that named logs control characters in octal notation ($n)"
 ret=0