mirror of
https://github.com/curl/curl.git
synced 2026-04-15 03:21:41 +03:00
tests: run the sws server on "any port"
Makes the test servers for HTTP and Gopher pop up on a currently unused port and runtests adapts to that! Closes #5247
This commit is contained in:
parent
e917492048
commit
80d6515415
3 changed files with 101 additions and 29 deletions
|
|
@ -44,8 +44,9 @@ my $unix_socket; # location to place a listening Unix socket
|
|||
my $ipvnum = 4; # default IP version of http server
|
||||
my $idnum = 1; # default http server instance number
|
||||
my $proto = 'http'; # protocol the http server speaks
|
||||
my $pidfile; # http server pid file
|
||||
my $logfile; # http server log file
|
||||
my $pidfile; # pid file
|
||||
my $portfile; # port number file
|
||||
my $logfile; # log file
|
||||
my $connect; # IP to connect to on CONNECT
|
||||
my $srcdir;
|
||||
my $gopher = 0;
|
||||
|
|
@ -61,6 +62,12 @@ while(@ARGV) {
|
|||
shift @ARGV;
|
||||
}
|
||||
}
|
||||
elsif($ARGV[0] eq '--portfile') {
|
||||
if($ARGV[1]) {
|
||||
$portfile = $ARGV[1];
|
||||
shift @ARGV;
|
||||
}
|
||||
}
|
||||
elsif($ARGV[0] eq '--logfile') {
|
||||
if($ARGV[1]) {
|
||||
$logfile = $ARGV[1];
|
||||
|
|
@ -122,11 +129,16 @@ if(!$srcdir) {
|
|||
if(!$pidfile) {
|
||||
$pidfile = "$path/". server_pidfilename($proto, $ipvnum, $idnum);
|
||||
}
|
||||
if(!$portfile) {
|
||||
$portfile = "$path/". server_portfilename($proto, $ipvnum, $idnum);
|
||||
}
|
||||
if(!$logfile) {
|
||||
$logfile = server_logfilename($logdir, $proto, $ipvnum, $idnum);
|
||||
}
|
||||
|
||||
$flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
|
||||
$flags .= "--pidfile \"$pidfile\" ".
|
||||
"--logfile \"$logfile\" ".
|
||||
"--portfile \"$portfile\" ";
|
||||
$flags .= "--gopher " if($gopher);
|
||||
$flags .= "--connect $connect " if($connect);
|
||||
if($ipvnum eq 'unix') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue