From: Ondřej Surý Date: Sat, 16 Nov 2019 05:15:56 +0000 (+0800) Subject: Fix couple of no-op tests to actually test something (configuration files were missing) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d319355b8a6fd569307d832e2b5e6c31d244fec;p=thirdparty%2Fbind9.git Fix couple of no-op tests to actually test something (configuration files were missing) --- diff --git a/bin/tests/system/runtime/setup.sh b/bin/tests/system/runtime/setup.sh index 522a6e69d2b..55bfd33655d 100644 --- a/bin/tests/system/runtime/setup.sh +++ b/bin/tests/system/runtime/setup.sh @@ -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 diff --git a/bin/tests/system/runtime/tests.sh b/bin/tests/system/runtime/tests.sh index 2f2c24a9fad..f2c59837231 100644 --- a/bin/tests/system/runtime/tests.sh +++ b/bin/tests/system/runtime/tests.sh @@ -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