]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Check that the lock file was not removed too early
authorMark Andrews <marka@isc.org>
Thu, 26 Oct 2023 04:07:58 +0000 (15:07 +1100)
committerMark Andrews <marka@isc.org>
Thu, 26 Oct 2023 04:41:46 +0000 (15:41 +1100)
When named fails to starts due to not being able to obtain
a lock on the lock file that lock file should remain.  Check
that the lock file exists before and after the attempt to
start a second instance of named.

bin/tests/system/runtime/tests.sh

index 058bf39c6e98509ba788cf960b5d397d691e0133..b9fd9ea4d0593c1e0287c28f082314aeec2ef3d2 100644 (file)
@@ -81,12 +81,14 @@ status=$((status+ret))
 n=$((n+1))
 echo_i "verifying that named checks for conflicting named processes ($n)"
 ret=0
+test -f ns2/named.lock || ret=1
 testpid=$(run_named ns2 named$n.run -c named-alt2.conf -D runtime-ns2-extra-2 -X named.lock)
 test -n "$testpid" || ret=1
 retry_quiet 10 check_named_log "another named process" ns2/named$n.run || ret=1
 test -n "$testpid" && retry_quiet 10 check_pid $testpid || ret=1
 test -n "$testpid" && kill -15 $testpid > kill$n.out 2>&1 && ret=1
 test -n "$testpid" && retry_quiet 10 check_pid $testpid || ret=1
+test -f ns2/named.lock || ret=1
 if [ $ret -ne 0 ]; then echo_i "failed"; fi
 status=$((status+ret))