aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2009-12-21 14:53:07 +0000
committerYang Tse <yangsita@gmail.com>2009-12-21 14:53:07 +0000
commite9a993b9e923387bc93000cafa599703df337499 (patch)
tree899b484787b773a686952b1da4e0178cf51f1759
parent982fe339245b2e3973462d5ad6039b202870c88a (diff)
Move stopping of servers instructed by test definition, after the removal of
server logs advisor read lock and before test results verifications are done. When stopping a pingpong server, stop server before its slaves.
-rwxr-xr-xtests/runtests.pl44
1 files changed, 21 insertions, 23 deletions
diff --git a/tests/runtests.pl b/tests/runtests.pl
index 6650cca5f..e44241e31 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -2272,6 +2272,27 @@ sub singletest {
# timestamp removal of server logs advisor read lock
$timesrvrlog{$testnum} = Time::HiRes::time() if($timestats);
+ # test definition might instruct to stop some servers
+ my @killservers = getpart("client", "killserver");
+ foreach my $serv (@killservers) {
+ chomp $serv;
+ if($run{$serv}) {
+ stopserver($run{$serv}); # the pid file is in the hash table
+ $run{$serv}=0; # clear pid
+ }
+ else {
+ logmsg "RUN: The $serv server is not running\n";
+ }
+ if($serv =~ /^ftp(\d*)(-ipv6|)/) {
+ my ($id, $ext) = ($1, $2);
+ #print STDERR "SERV $serv $id $ext\n";
+ ftpkillslave($id, $ext, $verbose);
+ }
+ }
+
+ # remove the test server commands file after each test
+ unlink($FTPDCMD);
+
# run the postcheck command
my @postcheck= getpart("client", "postcheck");
$cmd = $postcheck[0];
@@ -2290,9 +2311,6 @@ sub singletest {
}
}
- # remove the special FTP command file after each test!
- unlink($FTPDCMD);
-
my $e;
for $e (@envs) {
$ENV{$e}=""; # clean up
@@ -2508,24 +2526,6 @@ sub singletest {
return 1;
}
- @what = getpart("client", "killserver");
- for(@what) {
- my $serv = $_;
- chomp $serv;
- if($serv =~ /^ftp(\d*)(-ipv6|)/) {
- my ($id, $ext) = ($1, $2);
- #print STDERR "SERV $serv $id $ext\n";
- ftpkillslave($id, $ext, $verbose);
- }
- if($run{$serv}) {
- stopserver($run{$serv}); # the pid file is in the hash table
- $run{$serv}=0; # clear pid
- }
- else {
- logmsg "RUN: The $serv server is not running\n";
- }
- }
-
if($curl_debug) {
if(! -f $memdump) {
logmsg "\n** ALERT! memory debugging with no output file?\n";
@@ -2615,8 +2615,6 @@ sub singletest {
cleardir($LOGDIR);
}
- unlink($FTPDCMD); # remove the instructions for this test
-
# timestamp test result verification end
$timevrfyend{$testnum} = Time::HiRes::time() if($timestats);