]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests: fix remaining servers to run with a dynamic log directory
authorDan Fandrich <dan@coneharvesters.com>
Wed, 29 Mar 2023 18:27:53 +0000 (11:27 -0700)
committerDan Fandrich <dan@coneharvesters.com>
Thu, 30 Mar 2023 16:53:57 +0000 (09:53 -0700)
This final commit in the series is sufficient to allow the tests succeed
if $LOGDIR is changed in runtests.pl.

Ref: #10818
Closes #10866

tests/rtspserver.pl
tests/runtests.pl
tests/secureserver.pl
tests/sshserver.pl
tests/tftpserver.pl

index 376d67ea925849bfb741ea86c45bb679028e8533..a91f0a2536ea38f89b62ad22bc9ff0bf88beb175 100755 (executable)
@@ -73,6 +73,12 @@ while(@ARGV) {
             shift @ARGV;
         }
     }
+    elsif($ARGV[0] eq '--logdir') {
+        if($ARGV[1]) {
+            $logdir = $ARGV[1];
+            shift @ARGV;
+        }
+    }
     elsif($ARGV[0] eq '--srcdir') {
         if($ARGV[1]) {
             $srcdir = $ARGV[1];
@@ -118,7 +124,8 @@ if(!$logfile) {
 
 $flags .= "--pidfile \"$pidfile\" ".
     "--portfile \"$portfile\" ".
-    "--logfile \"$logfile\" ";
+    "--logfile \"$logfile\" ".
+    "--logdir \"$logdir\" ";
 $flags .= "--ipv$ipvnum --port $port --srcdir \"$srcdir\"";
 
 $| = 1;
index f0ac9e04b51a24d1a6f49a8eb77386889fe746b3..a727385a5707f59f0f367e4bf0a2f49d5d990ef9 100755 (executable)
@@ -1735,6 +1735,7 @@ sub runhttpsserver {
 
     $flags .= "--verbose " if($debugprotocol);
     $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
+    $flags .= "--logdir \"$LOGDIR\" ";
     $flags .= "--id $idnum " if($idnum > 1);
     $flags .= "--ipv$ipvnum --proto $proto ";
     $flags .= "--certfile \"$certfile\" " if($certfile ne 'stunnel.pem');
@@ -1979,6 +1980,7 @@ sub runsecureserver {
 
     $flags .= "--verbose " if($debugprotocol);
     $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
+    $flags .= "--logdir \"$LOGDIR\" ";
     $flags .= "--id $idnum " if($idnum > 1);
     $flags .= "--ipv$ipvnum --proto $proto ";
     $flags .= "--certfile \"$certfile\" " if($certfile ne 'stunnel.pem');
@@ -2063,7 +2065,8 @@ sub runtftpserver {
     $flags .= "--verbose " if($debugprotocol);
     $flags .= "--pidfile \"$pidfile\" ".
         "--portfile \"$portfile\" ".
-        "--logfile \"$logfile\" ";
+        "--logfile \"$logfile\" ".
+        "--logdir \"$LOGDIR\" ";
     $flags .= "--id $idnum " if($idnum > 1);
     $flags .= "--ipv$ipvnum --port 0 --srcdir \"$srcdir\"";
 
@@ -2145,7 +2148,8 @@ sub runrtspserver {
     $flags .= "--verbose " if($debugprotocol);
     $flags .= "--pidfile \"$pidfile\" ".
          "--portfile \"$portfile\" ".
-        "--logfile \"$logfile\" ";
+        "--logfile \"$logfile\" ".
+        "--logdir \"$LOGDIR\" ";
     $flags .= "--id $idnum " if($idnum > 1);
     $flags .= "--ipv$ipvnum --port 0 --srcdir \"$srcdir\"";
 
@@ -2231,6 +2235,7 @@ sub runsshserver {
     $flags .= "--verbose " if($verb);
     $flags .= "--debugprotocol " if($debugprotocol);
     $flags .= "--pidfile \"$pidfile\" ";
+    $flags .= "--logdir \"$LOGDIR\" ";
     $flags .= "--id $idnum " if($idnum > 1);
     $flags .= "--ipv$ipvnum --addr \"$ip\" ";
     $flags .= "--user \"$USER\"";
@@ -2368,7 +2373,9 @@ sub runmqttserver {
         " --port 0 ".
         " --pidfile $pidfile".
         " --portfile $portfile".
-        " --config $FTPDCMD";
+        " --config $FTPDCMD".
+        " --logfile $logfile".
+        " --logdir $LOGDIR";
     my ($sockspid, $pid2) = startnew($cmd, $pidfile, 30, 0);
 
     if($sockspid <= 0 || !pidexists($sockspid)) {
@@ -2429,6 +2436,8 @@ sub runsocksserver {
     if($is_unix) {
         $cmd="server/socksd".exe_ext('SRV').
             " --pidfile $pidfile".
+            " --reqfile $SOCKSIN".
+            " --logfile $logfile".
             " --unix-socket $SOCKSUNIXPATH".
             " --backend $HOSTIP".
             " --config $FTPDCMD";
@@ -2437,6 +2446,8 @@ sub runsocksserver {
             " --port 0 ".
             " --pidfile $pidfile".
             " --portfile $portfile".
+            " --reqfile $SOCKSIN".
+            " --logfile $logfile".
             " --backend $HOSTIP".
             " --config $FTPDCMD";
     }
index ec858e18f7d587544dffce2aeb0865e74dd55cce..e8c6045459bd7681f1e715d090111f48c794a1fb 100755 (executable)
@@ -167,6 +167,12 @@ while(@ARGV) {
             shift @ARGV;
         }
     }
+    elsif($ARGV[0] eq '--logdir') {
+        if($ARGV[1]) {
+            $logdir = "$path/". $ARGV[1];
+            shift @ARGV;
+        }
+    }
     else {
         print STDERR "\nWarning: secureserver.pl unknown parameter: $ARGV[0]\n";
     }
@@ -183,7 +189,7 @@ if(!$logfile) {
     $logfile = server_logfilename($logdir, $proto, $ipvnum, $idnum);
 }
 
-$conffile = "$path/${proto}_stunnel.conf";
+$conffile = "$logdir/${proto}_stunnel.conf";
 
 $capath = abs_path($path);
 $certfile = "$srcdir/". ($stuncert?"certs/$stuncert":"stunnel.pem");
index aaf50397231a02d629fbf860a48236733a7f21ac..ab15d9f7ecb7754e11996f64731670384d082c52 100755 (executable)
@@ -157,6 +157,12 @@ while(@ARGV) {
             shift @ARGV;
         }
     }
+    elsif($ARGV[0] eq '--logdir') {
+        if($ARGV[1]) {
+            $logdir = "$path/". $ARGV[1];
+            shift @ARGV;
+        }
+    }
     elsif($ARGV[0] eq '--sshport') {
         if($ARGV[1]) {
             if($ARGV[1] =~ /^(\d+)$/) {
index 23750b2dd6c4dc424cef0d4e0f6edcb921616f02..1143b9b42527b261ed4b2da42cff14e440bdc7cd 100755 (executable)
@@ -74,6 +74,12 @@ while(@ARGV) {
             shift @ARGV;
         }
     }
+    elsif($ARGV[0] eq '--logdir') {
+        if($ARGV[1]) {
+            $logdir = $ARGV[1];
+            shift @ARGV;
+        }
+    }
     elsif($ARGV[0] eq '--srcdir') {
         if($ARGV[1]) {
             $srcdir = $ARGV[1];
@@ -119,7 +125,8 @@ if(!$logfile) {
 
 $flags .= "--pidfile \"$pidfile\" ".
     "--portfile \"$portfile\" ".
-    "--logfile \"$logfile\" ";
+    "--logfile \"$logfile\" ".
+    "--logdir \"$logdir\" ";
 $flags .= "--ipv$ipvnum --port $port --srcdir \"$srcdir\"";
 
 $| = 1;