mirror of
https://github.com/mirror/wget.git
synced 2025-02-16 06:40:48 +08:00
Check for test server name resolution in tests
* tests/Test-https-*.px: Skip if test server name resolution fails
This commit is contained in:
parent
f68d001626
commit
466afc62b0
@ -3,7 +3,8 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use POSIX;
|
||||
|
||||
use Socket;
|
||||
use WgetFeature qw(https ssl/openssl);
|
||||
use SSLTest;
|
||||
|
||||
###############################################################################
|
||||
@ -33,6 +34,14 @@ my $cdir = $ENV{'PWD'};
|
||||
my $testhostname = "WgetTestingServer";
|
||||
$ENV{'HOSTALIASES'} = "$cdir/certs/wgethosts";
|
||||
|
||||
my $addr = gethostbyname($testhostname) or
|
||||
exit 77;
|
||||
unless (inet_ntoa($addr) =~ "127.0.0.1")
|
||||
{
|
||||
warn "Failed to resolve $testhostname";
|
||||
exit 77;
|
||||
}
|
||||
|
||||
# Create certindex
|
||||
open CERTID, ">", "$cdir/certs/certindex" or
|
||||
warn "Cannot overwrite file $cdir/certs/certindex";
|
||||
|
@ -2,7 +2,8 @@
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Socket;
|
||||
use WgetFeature qw(https);
|
||||
use SSLTest;
|
||||
|
||||
###############################################################################
|
||||
@ -32,6 +33,14 @@ my $cdir = $ENV{'PWD'};
|
||||
my $testhostname = "WgetTestingServer";
|
||||
$ENV{'HOSTALIASES'} = "$cdir/certs/wgethosts";
|
||||
|
||||
my $addr = gethostbyname($testhostname) or
|
||||
exit 77;
|
||||
unless (inet_ntoa($addr) =~ "127.0.0.1")
|
||||
{
|
||||
warn "Failed to resolve $testhostname";
|
||||
exit 77;
|
||||
}
|
||||
|
||||
# Create certindex
|
||||
open CERTID, ">", "$cdir/certs/certindex" or
|
||||
warn "Cannot overwrite file $cdir/certs/certindex";
|
||||
|
@ -2,7 +2,8 @@
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Socket;
|
||||
use WgetFeature qw(https);
|
||||
use SSLTest;
|
||||
|
||||
###############################################################################
|
||||
@ -30,11 +31,15 @@ my $cdir = $ENV{'PWD'};
|
||||
|
||||
# HOSTALIASES env variable allows us to create hosts file alias.
|
||||
my $testhostname = "WgetTestingServer";
|
||||
my $testhostfile = "$cdir/wgethosts";
|
||||
open(my $fh, '>', $testhostfile);
|
||||
print $fh "$testhostname 127.0.0.1\n";
|
||||
close $fh;
|
||||
$ENV{'HOSTALIASES'} = "$cdir/wgethosts";
|
||||
$ENV{'HOSTALIASES'} = "$cdir/certs/wgethosts";
|
||||
|
||||
my $addr = gethostbyname($testhostname) or
|
||||
exit 77;
|
||||
unless (inet_ntoa($addr) =~ "127.0.0.1")
|
||||
{
|
||||
warn "Failed to resolve $testhostname";
|
||||
exit 77;
|
||||
}
|
||||
|
||||
# Create certindex
|
||||
open CERTID, ">", "$cdir/certs/certindex" or
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Socket;
|
||||
use WgetFeature qw(https);
|
||||
use SSLTest;
|
||||
|
||||
###############################################################################
|
||||
@ -30,6 +32,14 @@ my $cdir = $ENV{'PWD'};
|
||||
my $testhostname = "WgetTestingServer";
|
||||
$ENV{'HOSTALIASES'} = "$cdir/certs/wgethosts";
|
||||
|
||||
my $addr = gethostbyname($testhostname) or
|
||||
exit 77;
|
||||
unless (inet_ntoa($addr) =~ "127.0.0.1")
|
||||
{
|
||||
warn "Failed to resolve $testhostname";
|
||||
exit 77;
|
||||
}
|
||||
|
||||
my $port = 24443;
|
||||
my $cmdline = $WgetTest::WGETPATH . " --secure-protocol=PFS".
|
||||
" --ca-certificate=$cdir/certs/test-ca-cert.pem".
|
||||
|
@ -2,7 +2,8 @@
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Socket;
|
||||
use WgetFeature qw(https);
|
||||
use SSLTest;
|
||||
|
||||
###############################################################################
|
||||
@ -32,6 +33,14 @@ my $cdir = $ENV{'PWD'};
|
||||
my $testhostname = "WgetTestingServer";
|
||||
$ENV{'HOSTALIASES'} = "$cdir/certs/wgethosts";
|
||||
|
||||
my $addr = gethostbyname($testhostname) or
|
||||
exit 77;
|
||||
unless (inet_ntoa($addr) =~ "127.0.0.1")
|
||||
{
|
||||
warn "Failed to resolve $testhostname";
|
||||
exit 77;
|
||||
}
|
||||
|
||||
# Prepare self-signed certificates
|
||||
my $certfile="tmpsscert.pem";
|
||||
my $keyfile="tmpsskey.pem";
|
||||
|
@ -2,7 +2,8 @@
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Socket;
|
||||
use WgetFeature qw(https);
|
||||
use SSLTest;
|
||||
|
||||
###############################################################################
|
||||
@ -31,6 +32,14 @@ my $cdir = $ENV{'PWD'};
|
||||
my $testhostname = "WgetTestingServer";
|
||||
$ENV{'HOSTALIASES'} = "$cdir/certs/wgethosts";
|
||||
|
||||
my $addr = gethostbyname($testhostname) or
|
||||
exit 77;
|
||||
unless (inet_ntoa($addr) =~ "127.0.0.1")
|
||||
{
|
||||
warn "Failed to resolve $testhostname";
|
||||
exit 77;
|
||||
}
|
||||
|
||||
my $port = 28443;
|
||||
my $cmdline = $WgetTest::WGETPATH . " --secure-protocol=TLSv1".
|
||||
" --ca-certificate=$cdir/certs/test-ca-cert.pem".
|
||||
|
@ -2,7 +2,8 @@
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Socket;
|
||||
use WgetFeature qw(https);
|
||||
use SSLTest;
|
||||
|
||||
###############################################################################
|
||||
@ -31,6 +32,14 @@ my $cdir = $ENV{'PWD'};
|
||||
my $testhostname = "WgetTestingServer";
|
||||
$ENV{'HOSTALIASES'} = "$cdir/certs/wgethosts";
|
||||
|
||||
my $addr = gethostbyname($testhostname) or
|
||||
exit 77;
|
||||
unless (inet_ntoa($addr) =~ "127.0.0.1")
|
||||
{
|
||||
warn "Failed to resolve $testhostname";
|
||||
exit 77;
|
||||
}
|
||||
|
||||
my $port = 29443;
|
||||
my $cmdline = $WgetTest::WGETPATH . " --secure-protocol=TLSv1_1".
|
||||
" --ca-certificate=$cdir/certs/test-ca-cert.pem".
|
||||
|
@ -2,7 +2,8 @@
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Socket;
|
||||
use WgetFeature qw(https);
|
||||
use SSLTest;
|
||||
|
||||
###############################################################################
|
||||
@ -32,6 +33,14 @@ my $cdir = $ENV{'PWD'};
|
||||
my $testhostname = "WgetTestingServer";
|
||||
$ENV{'HOSTALIASES'} = "$cdir/certs/wgethosts";
|
||||
|
||||
my $addr = gethostbyname($testhostname) or
|
||||
exit 77;
|
||||
unless (inet_ntoa($addr) =~ "127.0.0.1")
|
||||
{
|
||||
warn "Failed to resolve $testhostname";
|
||||
exit 77;
|
||||
}
|
||||
|
||||
# Create certindex
|
||||
open CERTID, ">", "$cdir/certs/certindex" or
|
||||
warn "Cannot overwrite file $cdir/certs/certindex";
|
||||
|
Loading…
Reference in New Issue
Block a user