mirror of
https://github.com/mirror/wget.git
synced 2026-08-23 03:13:28 +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:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user