]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Further improve the runtime tests to look for a specific instead of generic error
authorOndřej Surý <ondrej@sury.org>
Sat, 16 Nov 2019 05:30:58 +0000 (13:30 +0800)
committerOndřej Surý <ondrej@isc.org>
Tue, 26 Nov 2019 11:11:06 +0000 (12:11 +0100)
bin/tests/system/runtime/tests.sh

index e82f293099129aa4b0c7c92d60e96f227f3bc2c7..f6eb41fe8ebbf9eeb3c96248ce1a4d87de5ddb8f 100644 (file)
@@ -118,24 +118,22 @@ status=`expr $status + $ret`
 n=`expr $n + 1`
 echo_i "checking that named refuses to start if working directory is not writable ($n)"
 ret=0
-cd ns2
-$NAMED -c named-alt4.conf -D runtime-ns2-extra-4 -d 99 -g > named4.run 2>&1 &
+(cd ns2 && $NAMED -c named-alt4.conf -D runtime-ns2-extra-4 -d 99 -g > named4.run 2>&1 &)
 sleep 2
-grep "exiting (due to fatal error)" named4.run > /dev/null || ret=1
-kill_named named.pid && ret=1
-cd ..
+grep "[^-]directory './nope' is not writable" ns2/named4.run > /dev/null 2>&1 || ret=1
+grep "exiting (due to fatal error)" ns2/named4.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 refuses to start if managed-keys-directory is not writable ($n)"
 ret=0
-cd ns2
-$NAMED -c named-alt5.conf -D runtime-ns2-extra-5 -d 99 -g > named5.run 2>&1 &
+(cd ns2 && $NAMED -c named-alt5.conf -D runtime-ns2-extra-5 -d 99 -g > named5.run 2>&1 &)
 sleep 2
-grep "exiting (due to fatal error)" named5.run > /dev/null || ret=1
+grep "managed-keys-directory './nope' is not writable" ns2/named5.run > /dev/null 2>&1 || ret=1
+grep "exiting (due to fatal error)" ns2/named5.run > /dev/null || ret=1
 kill_named named.pid && ret=1
-cd ..
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
@@ -144,6 +142,7 @@ echo_i "checking that named refuses to start if new-zones-directory is not writa
 ret=0
 (cd ns2 && $NAMED -c named-alt6.conf -D runtime-ns2-extra-6 -d 99 -g > named6.run 2>&1 &)
 sleep 2
+grep "new-zones-directory './nope' is not writable" ns2/named6.run > /dev/null 2>&1 || ret=1
 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