]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Retain all named.run files from each test run
authorMichał Kępień <michal@isc.org>
Wed, 26 Jan 2022 14:18:43 +0000 (15:18 +0100)
committerMichał Kępień <michal@isc.org>
Wed, 26 Jan 2022 14:18:43 +0000 (15:18 +0100)
The bin/tests/system/start.pl script truncates the named.run file for a
given named instance unless it is invoked with the --restart
command-line option.  Ever since Python-based tests were introduced,
bin/tests/system/run.sh may start named instances used by a given system
test multiple times within a single run, causing the
bin/tests/system/start.pl script to truncate some of the log files
written during the test.  This makes troubleshooting certain test
failures hard or even impossible.

Fix by calling bin/tests/system/start.pl with the --restart command-line
option for every start_servers() invocation except the first one.

bin/tests/system/run.sh.in

index ee4a9077b25f0be0ba42da7c2ca5b8547006ca3d..057cd1f87443a5c1df9092e21a36ec2bf084e62b 100644 (file)
@@ -117,9 +117,13 @@ fi
 # Determine which ports to use for this system test.
 eval "$(cd "${srcdir}" && ./get_ports.sh -p "$baseport" -t "$systest")"
 
+# Start all servers used by the system test.  Ensure all log files written
+# during a system test (tests.sh + potentially multiple *.py scripts) are
+# retained for each run by calling start.pl with the --restart command-line
+# option for all invocations except the first one.
 start_servers() {
     echoinfo "I:$systest:starting servers"
-    if $restart; then
+    if $restart || [ "$run" -gt 0 ]; then
         restart_opt="--restart"
     fi
     if ! $PERL start.pl ${restart_opt} --port "$PORT" "$systest"; then