diff --git a/bin/tests/system/conf.sh.common b/bin/tests/system/conf.sh.common index 3809d74aa8..ce7b923b23 100644 --- a/bin/tests/system/conf.sh.common +++ b/bin/tests/system/conf.sh.common @@ -181,19 +181,19 @@ then printf "${COLOR_END}%s${COLOR_NONE}\n" "$*" } echo_i() { - printf '%s\n' "$*" | while read -r __LINE ; do + printf '%s\n' "$*" | while IFS= read -r __LINE ; do echoinfo "I:$SYSTESTDIR:$__LINE" done } echo_ic() { - printf '%s\n' "$*" | while read -r __LINE ; do + printf '%s\n' "$*" | while IFS= read -r __LINE ; do echoinfo "I:$SYSTESTDIR: $__LINE" done } echo_d() { - printf '%s\n' "$*" | while read -r __LINE ; do + printf '%s\n' "$*" | while IFS= read -r __LINE ; do echoinfo "D:$SYSTESTDIR:$__LINE" done } @@ -218,32 +218,32 @@ else } echo_i() { - echo "$@" | while read -r __LINE ; do + echo "$@" | while IFS= read -r __LINE ; do echoinfo "I:$SYSTESTDIR:$__LINE" done } echo_ic() { - echo "$@" | while read -r __LINE ; do + echo "$@" | while IFS= read -r __LINE ; do echoinfo "I:$SYSTESTDIR: $__LINE" done } echo_d() { - echo "$@" | while read -r __LINE ; do + echo "$@" | while IFS= read -r __LINE ; do echoinfo "D:$SYSTESTDIR:$__LINE" done } fi cat_i() { - while read -r __LINE ; do + while IFS= read -r __LINE ; do echoinfo "I:$SYSTESTDIR:$__LINE" done } cat_d() { - while read -r __LINE ; do + while IFS= read -r __LINE ; do echoinfo "D:$SYSTESTDIR:$__LINE" done } diff --git a/bin/tests/system/run.sh.in b/bin/tests/system/run.sh.in index ee4a9077b2..057cd1f874 100644 --- a/bin/tests/system/run.sh.in +++ b/bin/tests/system/run.sh.in @@ -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 diff --git a/bin/tests/system/stop.pl b/bin/tests/system/stop.pl index 4332ac83cc..57cb752343 100644 --- a/bin/tests/system/stop.pl +++ b/bin/tests/system/stop.pl @@ -134,7 +134,7 @@ exit($errors); sub server_lock_file { my ( $server ) = @_; - return if (defined($ENV{'CYGWIN'})); + return if (defined($ENV{'CYGWIN'}) && $ENV{'CYGWIN'}); return $testdir . "/" . $server . "/named.lock" if ($server =~ /^ns/); return if ($server =~ /^ans/); @@ -255,7 +255,7 @@ sub pid_file_exists { if (send_signal(0, $pid) == 0) { # XXX: on windows this is likely to result in a # false positive, so don't bother reporting the error. - if (!defined($ENV{'CYGWIN'})) { + if (!defined($ENV{'CYGWIN'}) || !$ENV{'CYGWIN'}) { print "I:$test:$server crashed on shutdown\n"; $errors = 1; }