#!./perl -w
BEGIN {
chdir 't' if -d 't';
}
if (!eval "require Socket") {
print "1..0 # no Socket\n"; exit 0;
}
print "1..0 # EBCDIC but no Convert::EBCDIC\n"; exit 0;
}
}
}
my $fail = 0;
my %names;
sub set_fail {
$fail = shift;
}
sub inet_aton {
return if $fail;
return $num;
}
sub inet_ntoa {
return if $fail;
return $names{$_[0]};
}
(my $libnet_t = __FILE__) =~ s/config.t/libnet_t.pl/;
require $libnet_t;
print "1..10\n";
'requires_firewall() should return 0 without ftp_firewall defined' );
'... should return -1 without a valid hostname' );
'... should return 0 without local_netmask defined' );
'... should return false if host is within netmask' );
'... should return true if host is outside netmask' );
# now try more netmasks
'... should find success with mutiple local netmasks' );
'... should handle failure with multiple local netmasks' );
is( \&Net::Config::is_external, \&Net::Config::requires_firewall,
'is_external() should be an alias for requires_firewall()' );