diff options
author | Ali Polatel <alip@exherbo.org> | 2010-10-15 17:15:34 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-10-15 17:38:47 -0700 |
commit | 04093f69db5aa7a5af5452eaf78dee1f9bc64b21 (patch) | |
tree | f4c9f2d246a2469bed251e7e5055cec00f00240d /dist/IO | |
parent | ad6ab6c50584b455ffb6a48d18fb6409bea8a3c1 (diff) | |
download | perl-04093f69db5aa7a5af5452eaf78dee1f9bc64b21.tar.gz |
dist/IO: Always bind to localhost in tests.
This is necessary on Exherbo, at least, because of the network
sandboxing that is done by 'sydbox'. And, in general, tests shouldn't be
listening on all interfaces.
Diffstat (limited to 'dist/IO')
-rw-r--r-- | dist/IO/t/io_multihomed.t | 3 | ||||
-rw-r--r-- | dist/IO/t/io_sock.t | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/dist/IO/t/io_multihomed.t b/dist/IO/t/io_multihomed.t index f1bd5b9df9..f2a8e11f1c 100644 --- a/dist/IO/t/io_multihomed.t +++ b/dist/IO/t/io_multihomed.t @@ -74,7 +74,8 @@ package main; use IO::Socket; -$listen = IO::Socket::INET->new(Listen => 2, +$listen = IO::Socket::INET->new(LocalAddr => 'localhost', + Listen => 2, Proto => 'tcp', Timeout => 5, ) or die "$!"; diff --git a/dist/IO/t/io_sock.t b/dist/IO/t/io_sock.t index 38aefeeb53..9c964f0cdc 100644 --- a/dist/IO/t/io_sock.t +++ b/dist/IO/t/io_sock.t @@ -36,7 +36,8 @@ eval { use IO::Socket; -$listen = IO::Socket::INET->new(Listen => 2, +$listen = IO::Socket::INET->new(LocalAddr => 'localhost', + Listen => 2, Proto => 'tcp', # some systems seem to need as much as 10, # so be generous with the timeout @@ -97,7 +98,7 @@ if($pid = fork()) { # Test various other ways to create INET sockets that should # also work. -$listen = IO::Socket::INET->new(Listen => '', Timeout => 15) or die "$!"; +$listen = IO::Socket::INET->new(LocalAddr => 'localhost', Listen => '', Timeout => 15) or die "$!"; $port = $listen->sockport; if($pid = fork()) { @@ -224,7 +225,7 @@ if( !open( SRC, "< $0")) { ### TEST 16 ### Start the server # -my $listen = IO::Socket::INET->new( Listen => 2, Proto => 'tcp', Timeout => 15) || +my $listen = IO::Socket::INET->new(LocalAddr => 'localhost', Listen => 2, Proto => 'tcp', Timeout => 15) || print "not "; print "ok 16\n"; die if( !defined( $listen)); |