From: David Cantrell Date: Wed, 8 Apr 2009 12:49:14 +0000 (+0200) Subject: Net::hostent fails make test if can't resolve localhost X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=932dfdf14c16835fc3ab6ba0cb0dab9254dfd017;p=p5sagit%2Fp5-mst-13.2.git Net::hostent fails make test if can't resolve localhost This happens on boxes which otherwise work Just Fine and whose resolvers work Just Fine if they don't have /etc/hosts. This patch fixes the test file by making it skip if localhost can't be resolved and /etc/hosts doesn't exist. Message-ID: <20090330205715.GA29690@bytemark.barnyard.co.uk> --- diff --git a/lib/Net/hostent.t b/lib/Net/hostent.t index 2616b56..421f19d 100644 --- a/lib/Net/hostent.t +++ b/lib/Net/hostent.t @@ -33,6 +33,10 @@ sub DIE { use Socket; my $h = gethost('localhost'); +SKIP: { +skip "Can't resolve localhost and you don't have /etc/hosts", 6 + if (!defined($h) && !-e '/etc/hosts'); + ok(defined $h, "gethost('localhost')") || DIE("Can't continue without working gethost: $!"); @@ -89,3 +93,4 @@ SKIP: { print "# " . $h->name . " " . join (",", @{$h->aliases}) . "\n"; } } +}