summaryrefslogtreecommitdiff
path: root/lib/Net/hostent.t
diff options
context:
space:
mode:
authorDavid Cantrell <david@cantrell.org.uk>2009-04-08 14:49:14 +0200
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2009-04-08 14:49:14 +0200
commit932dfdf14c16835fc3ab6ba0cb0dab9254dfd017 (patch)
treee5208016d10154610ee0c0d82726571fa241a3ab /lib/Net/hostent.t
parenta8ba03fb2070c532259a5d9d434d5b61c757d31d (diff)
downloadperl-932dfdf14c16835fc3ab6ba0cb0dab9254dfd017.tar.gz
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>
Diffstat (limited to 'lib/Net/hostent.t')
-rw-r--r--lib/Net/hostent.t5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Net/hostent.t b/lib/Net/hostent.t
index 2616b56425..421f19dc35 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";
}
}
+}