]> 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 07:05:07 +0000 (18:05 +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.

(cherry picked from commit 811c9ee7d17927b534f9c83b20395389e2d145b2)

bin/tests/system/runtime/tests.sh

index e4be62cf07160b82ffffd0e4698729e2df6d913a..ed282ff1fb7e456c969b1ac7cd9673dfc06190e5 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))