return main::logmsg(@_);
}
-#######################################################################
-# Call main's displaylogs
-# TODO: this will eventually stop being called in this package
-sub displaylogs{
- return main::displaylogs(@_);
-}
-
#######################################################################
# Check for a command in the PATH of the machine running curl.
#
sub singletest_startservers {
my ($testnum, $testtimings) = @_;
- # remove test server commands file before servers are started/verified
- unlink($FTPDCMD) if(-f $FTPDCMD);
+ # remove old test server files before servers are started/verified
+ unlink($FTPDCMD);
+ unlink($SERVERIN);
+ unlink($SERVER2IN);
+ unlink($PROXYIN);
# timestamp required servers verification start
$$testtimings{"timesrvrini"} = Time::HiRes::time();
my $why;
+ my $error;
if (!$listonly) {
my @what = getpart("client", "server");
if(!$what[0]) {
warn "Test case $testnum has no server(s) specified";
$why = "no server specified";
+ $error = -1;
} else {
my $err;
($why, $err) = serverfortest(@what);
if($err == 1) {
- # Error indicates an actual problem starting the server, so
- # display the server logs
- displaylogs($testnum);
+ # Error indicates an actual problem starting the server
+ $error = -2;
+ } else {
+ $error = -1;
}
}
}
# timestamp required servers verification end
$$testtimings{"timesrvrend"} = Time::HiRes::time();
- # remove server output logfile after servers are started/verified
- unlink($SERVERIN);
- unlink($SERVER2IN);
- unlink($PROXYIN);
-
- return $why;
+ return ($why, $error);
}
}
unlink("core");
+ # remove server output logfiles after servers are started/verified
+ unlink($SERVERIN);
+ unlink($SERVER2IN);
+ unlink($PROXYIN);
+
# if this section exists, it might be FTP server instructions:
my @ftpservercmd = getpart("reply", "servercmd");
push @ftpservercmd, "Testnum $testnum\n";
###################################################################
# Start the servers needed to run this test case
- my $why = singletest_startservers($testnum, \%testtimings);
+ my ($why, $error) = singletest_startservers($testnum, \%testtimings);
if(!$why) {
# Check that the test environment is fine to run this test case
if (!$listonly) {
$why = singletest_precheck($testnum);
+ $error = -1;
}
}
- return ($why, \%testtimings);
+ return ($why, $error, \%testtimings);
}
# Register the test case with the CI environment
citest_starttest($testnum);
- my ($why, $testtimings) = runner_test_preprocess($testnum);
+ my ($why, $error, $testtimings) = runner_test_preprocess($testnum);
+ if($error == -2) {
+ if($postmortem) {
+ # Error indicates an actual problem starting the server, so
+ # display the server logs
+ displaylogs($testnum);
+ }
+ }
updatetesttimings($testnum, %$testtimings);
#######################################################################
# Print the test name and count tests
- my $error = singletest_count($testnum, $why);
+ $error = singletest_count($testnum, $why);
if($error) {
return $error;
}