]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Move stopping of servers instructed by test definition, after the removal of
authorYang Tse <yangsita@gmail.com>
Mon, 21 Dec 2009 14:53:07 +0000 (14:53 +0000)
committerYang Tse <yangsita@gmail.com>
Mon, 21 Dec 2009 14:53:07 +0000 (14:53 +0000)
server logs advisor read lock and before test results verifications are done.

When stopping a pingpong server, stop server before its slaves.

tests/runtests.pl

index 6650cca5f7f70798c804b026c7fcf1533e9a58c2..e44241e31e35454ac31a73097842d878a3966c1b 100755 (executable)
@@ -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);