tests: fix http servers to run with a dynamic log directory

Ref: #10818
This commit is contained in:
Dan Fandrich 2023-03-29 08:54:57 -07:00
parent c753418d8b
commit 8a298119f1
4 changed files with 37 additions and 4 deletions

View file

@ -49,6 +49,7 @@ my $proto = 'http'; # protocol the http server speaks
my $pidfile; # pid file
my $portfile; # port number file
my $logfile; # log file
my $cmdfile; # command file
my $connect; # IP to connect to on CONNECT
my $srcdir;
my $gopher = 0;
@ -70,12 +71,24 @@ while(@ARGV) {
shift @ARGV;
}
}
elsif($ARGV[0] eq '--config') {
if($ARGV[1]) {
$cmdfile = $ARGV[1];
shift @ARGV;
}
}
elsif($ARGV[0] eq '--logfile') {
if($ARGV[1]) {
$logfile = $ARGV[1];
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];
@ -139,7 +152,9 @@ if(!$logfile) {
}
$flags .= "--pidfile \"$pidfile\" ".
"--cmdfile \"$cmdfile\" ".
"--logfile \"$logfile\" ".
"--logdir \"$logdir\" ".
"--portfile \"$portfile\" ";
$flags .= "--gopher " if($gopher);
$flags .= "--connect $connect " if($connect);