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>
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: $!");
print "# " . $h->name . " " . join (",", @{$h->aliases}) . "\n";
}
}
+}