]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
runtests: always put test number in servercmd file
authorDaniel Stenberg <daniel@haxx.se>
Thu, 16 Apr 2020 12:16:22 +0000 (14:16 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 20 Apr 2020 06:09:33 +0000 (08:09 +0200)
tests/FILEFORMAT.md
tests/runtests.pl

index d01f3f17fffc637949716c1ce7020a6522cc755d..586b84b743616010a1bec8bd7781330cac7a4664 100644 (file)
@@ -130,6 +130,10 @@ For HTTP/HTTPS, these are supported:
 ### `<servercmd>`
 Special-commands for the server.
 
+The first line of this file will always be set to `Testnum [number]` by the
+test script, to allow servers to read that to know what test the client is
+about to issue.
+
 #### For FTP/SMTP/POP/IMAP
 
 - `REPLY [command] [return value] [response string]` - Changes how the server
index 82de7f7a8b89557d0fffa84516cff060699cdc27..5485b1519daa22210d666f2be99d5b257d7838d6 100755 (executable)
@@ -175,7 +175,7 @@ my $SERVERIN="$LOGDIR/server.input"; # what curl sent the server
 my $SERVER2IN="$LOGDIR/server2.input"; # what curl sent the second server
 my $PROXYIN="$LOGDIR/proxy.input"; # what curl sent the proxy
 my $CURLLOG="commands.log"; # all command lines run
-my $FTPDCMD="$LOGDIR/ftpserver.cmd"; # copy ftp server instructions here
+my $FTPDCMD="$LOGDIR/ftpserver.cmd"; # copy server instructions here
 my $SERVERLOGS_LOCK="$LOGDIR/serverlogs.lock"; # server logs advisor read lock
 my $CURLCONFIG="../curl-config"; # curl-config from current build
 
@@ -3675,10 +3675,9 @@ sub singletest {
     unlink($SERVER2IN);
     unlink($PROXYIN);
 
-    if(@ftpservercmd) {
-        # write the instructions to file
-        writearray($FTPDCMD, \@ftpservercmd);
-    }
+    push @ftpservercmd, "Testnum $testnum\n";
+    # write the instructions to file
+    writearray($FTPDCMD, \@ftpservercmd);
 
     # get the command line options to use
     my @blaha;
@@ -4029,9 +4028,6 @@ sub singletest {
         }
     }
 
-    # remove the test server commands file after each test
-    unlink($FTPDCMD) if(-f $FTPDCMD);
-
     # run the postcheck command
     my @postcheck= getpart("client", "postcheck");
     if(@postcheck) {