From 74ab7e46601e0eba31ec461729b785c36090c9f9 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 26 Oct 2023 15:07:58 +1100 Subject: [PATCH] Check that the lock file was not removed too early 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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/tests/system/runtime/tests.sh b/bin/tests/system/runtime/tests.sh index e4be62cf07..ed282ff1fb 100644 --- a/bin/tests/system/runtime/tests.sh +++ b/bin/tests/system/runtime/tests.sh @@ -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))