Merge branch 'michal/misc-test-framework-fixes-v9_18' into 'v9_18'

[v9_18] Miscellaneous test framework fixes

See merge request isc-projects/bind9!5763
This commit is contained in:
Michał Kępień 2022-01-26 14:40:46 +00:00
commit e82c8c6105
3 changed files with 15 additions and 11 deletions

View file

@ -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
}

View 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

View file

@ -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;
}