tests: Support custom arguments to test HTTP server
This makes it easier to debug complicated bugs like #791. For example, you can pass `port => 12345` to make it easier to use Wireshark to capture packets.
This commit is contained in:
parent
41170b9c08
commit
b733187da2
1 changed files with 3 additions and 3 deletions
|
@ -133,9 +133,8 @@ our $other_ca_file = "$certdir/other-ca-cert.pem";
|
||||||
my %daemons;
|
my %daemons;
|
||||||
|
|
||||||
sub httpd {
|
sub httpd {
|
||||||
my ($ipv, $ssl) = @_;
|
my $ipv = shift // '';
|
||||||
$ipv //= '';
|
my $ssl = !!shift;
|
||||||
$ssl = !!$ssl;
|
|
||||||
return undef if !$httpd_supported;
|
return undef if !$httpd_supported;
|
||||||
return undef if $ipv eq '6' && !$httpd_ipv6_supported;
|
return undef if $ipv eq '6' && !$httpd_ipv6_supported;
|
||||||
return undef if $ssl && !$httpd_ssl_supported;
|
return undef if $ssl && !$httpd_ssl_supported;
|
||||||
|
@ -153,6 +152,7 @@ sub httpd {
|
||||||
(SSL_cert_file => "$certdir/dummy-server-cert.pem",
|
(SSL_cert_file => "$certdir/dummy-server-cert.pem",
|
||||||
SSL_key_file => "$certdir/dummy-server-key.pem") x $ssl,
|
SSL_key_file => "$certdir/dummy-server-key.pem") x $ssl,
|
||||||
},
|
},
|
||||||
|
@_,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return $daemons{$ipv}{$ssl};
|
return $daemons{$ipv}{$ssl};
|
||||||
|
|
Loading…
Reference in a new issue