Check for test server name resolution in tests

* tests/Test-https-*.px: Skip if test server name resolution fails
This commit is contained in:
Tim Rühsen
2017-05-09 11:06:44 +02:00
parent f68d001626
commit 466afc62b0
8 changed files with 81 additions and 12 deletions

View File

@@ -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";