Skip Menu |

This queue is for tickets about the IO-Socket-INET6 CPAN distribution.

Report information
The Basics
Id: 72769
Status: resolved
Priority: 0/
Queue: IO-Socket-INET6

People
Owner: Nobody in particular
Requestors: dkg [...] fifthhorseman.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: reduce noise in t/io_multihome6.t
Date: Mon, 28 Nov 2011 03:59:14 -0500
To: submit [...] bugs.debian.org, bug-IO-Socket-INET6 [...] rt.cpan.org
From: Daniel Kahn Gillmor <dkg [...] fifthhorseman.net>
Package: libio-socket-inet6-perl Tags: patch Severity: wishlist During the build process under perl 5.14, the test suite shows some errors: t/blocking.t .......... ok t/configure6.t ........ ok t/host6.t ............. ok t/io_multihomed6.t .... Subroutine main::pack_sockaddr_in6 redefined at /usr/share/perl/5.14/Exporter.pm line 67. at t/io_multihomed6.t line 44 Subroutine main::unpack_sockaddr_in6 redefined at /usr/share/perl/5.14/Exporter.pm line 67. at t/io_multihomed6.t line 44 Subroutine main::sockaddr_in6 redefined at /usr/share/perl/5.14/Exporter.pm line 67. at t/io_multihomed6.t line 44 Subroutine main::pack_sockaddr_in6 redefined at t/io_multihomed6.t line 73 Subroutine main::unpack_sockaddr_in6 redefined at t/io_multihomed6.t line 73 Subroutine main::sockaddr_in6 redefined at t/io_multihomed6.t line 73 t/io_multihomed6.t .... ok t/io_sock6.t .......... ok These can be fixed with the attached patch to the test suite, which avoids exporting a bunch of symbols. Regards, --dkg
diff --git a/t/io_multihomed6.t b/t/io_multihomed6.t index 804c6dd..e911423 100644 --- a/t/io_multihomed6.t +++ b/t/io_multihomed6.t @@ -40,16 +40,15 @@ BEGIN { # check that localhost resolves to 127.0.0.1 and ::1 # otherwise the test will not work -use Socket; -use Socket6; +use Socket (); { my %resolved_addresses; - my @r = getaddrinfo('localhost',1); + my @r = Socket6::getaddrinfo('localhost',1); if (@r < 5) { - print "1..0 # SKIP getaddrinfo('localhost',1) failed: $r[0]\n"; + print "1..0 # SKIP Socket6::getaddrinfo('localhost',1) failed: $r[0]\n"; exit 0; } @@ -58,11 +57,11 @@ use Socket6; my ($fam,$addr) = @values[0,3]; $addr = ( - ($fam == AF_INET) - ? ( (unpack_sockaddr_in($addr))[1] ) - : ( (unpack_sockaddr_in6($addr))[1] ) + ($fam == Socket::AF_INET) + ? ( (Socket::unpack_sockaddr_in($addr))[1] ) + : ( (Socket::unpack_sockaddr_in6($addr))[1] ) ); - $resolved_addresses{inet_ntop($fam,$addr)}++; + $resolved_addresses{Socket::inet_ntop($fam,$addr)}++; } if (! $resolved_addresses{'127.0.0.1'} || ! $resolved_addresses{'::1'}) { print "1..0 # SKIP localhost does not resolve to both 127.0.0.1 and ::1\n"; @@ -109,7 +108,7 @@ if (my $pid = fork()) { close($first); # make sure established connection works - my $fam0 = ( $cl->sockdomain == AF_INET ) ? 'inet':'inet6'; + my $fam0 = ( $cl->sockdomain == Socket::AF_INET ) ? 'inet':'inet6'; print {$cl} "ok 2 # $fam0\n"; print $cl->getline(); # ok 3 # So we'll be sure ok 3 has already been printed. @@ -123,7 +122,7 @@ if (my $pid = fork()) { vec($vec,fileno($second),1) = 1; if ( select($vec,undef,undef,5)) { my $cl2 = $second->accept or die $!; - my $fam1 = ( $cl2->sockdomain == AF_INET ) ? 'inet':'inet6'; + my $fam1 = ( $cl2->sockdomain == Socket::AF_INET ) ? 'inet':'inet6'; print {$cl2} "ok 5 # $fam1\n"; print $cl2->getline(); # ok 6 close($cl2);
Download (untitled)
application/pgp-signature 965b

Message body not shown because it is not plain text.

Hi DKG, On Mon Nov 28 03:59:45 2011, dkg@fifthhorseman.net wrote: Show quoted text
> Package: libio-socket-inet6-perl > Tags: patch > Severity: wishlist > > During the build process under perl 5.14, the test suite shows some > errors: > > t/blocking.t .......... ok > t/configure6.t ........ ok > t/host6.t ............. ok > t/io_multihomed6.t .... Subroutine main::pack_sockaddr_in6 redefined > at /usr/share/perl/5.14/Exporter.pm line 67. > at t/io_multihomed6.t line 44 > Subroutine main::unpack_sockaddr_in6 redefined at > /usr/share/perl/5.14/Exporter.pm line 67. > at t/io_multihomed6.t line 44 > Subroutine main::sockaddr_in6 redefined at > /usr/share/perl/5.14/Exporter.pm line 67. > at t/io_multihomed6.t line 44 > Subroutine main::pack_sockaddr_in6 redefined at t/io_multihomed6.t > line 73 > Subroutine main::unpack_sockaddr_in6 redefined at t/io_multihomed6.t > line 73 > Subroutine main::sockaddr_in6 redefined at t/io_multihomed6.t line 73 > t/io_multihomed6.t .... ok > t/io_sock6.t .......... ok > > These can be fixed with the attached patch to the test suite, which > avoids exporting a bunch of symbols. >
Thanks for the report. I didn't use your patch and instead wrote a similar workaround for the problem as the one found in lib/IO/Socket/INET6.pm itself, which selectively imports symbols from both Socket and Socket6 to avoid duplicates. The modified fix is now in IO-Socket-IENT6-2.68. Regards, -- Shlomi Fish
Resolving as fixed (see previous comment)
From: paul [...] city-fan.org
On Mon Nov 28 05:18:04 2011, SHLOMIF wrote: Show quoted text
> Resolving as fixed (see previous comment)
Test fails for me, due I think to a typo - see attached patch that resolves it for me. $ make test TEST_VERBOSE=1 PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(1, 'blib/lib', 'blib/arch')" t/*.t t/blocking.t .......... 1..2 ok 1 - Non-blocking works on listeners ok 2 - Non-blocking works on outbound connections ok t/configure6.t ........ 1..1 ok 1 - Testing that "sub configure" does not fail ok t/host6.t ............. 1..4 ok 1 - Checking for sockhost() success ok 2 - Checking for peerhost() success ok 3 - Checking for sockflow() success ok 4 - Checking for peerflow() success ok Undefined subroutine &main::unpack_sockaddr_in6 called at t/io_multihomed6.t line 73. t/io_multihomed6.t .... Dubious, test returned 2 (wstat 512, 0x200) No subtests run t/io_sock6.t .......... 1..20 ok 1 ok 2 ok 3 ok 4 ok 5 ok 6 ok 7 ok 8 ok 9 ok 10 ok 11 ok 12 ok 13 ok 14 ok 15 ok 16 ok 17 ok 18 ok 19 ok 20 ok t/io_udp6.t ........... 1..7 ok 1 ok 2 ok 3 ok 4 ok 5 ok 6 ok 7 ok t/listen_port_only.t .. 1..1 ok 1 - Client was initialised - connected. ok t/pod-coverage.t ...... 1..1 ok 1 - Pod coverage on IO::Socket::INET6 ok t/pod.t ............... 1..1 ok 1 - POD test for blib/lib/IO/Socket/INET6.pm ok Test Summary Report ------------------- t/io_multihomed6.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output Files=9, Tests=37, 20 wallclock secs ( 0.05 usr 0.01 sys + 0.35 cusr 0.06 csys = 0.47 CPU) Result: FAIL Failed 1/9 test programs. 0/37 subtests failed.
Subject: IO-Socket-INET6-2.68-test-typo.patch
--- IO-Socket-INET6-2.68/t/io_multihomed6.t +++ IO-Socket-INET6-2.68/t/io_multihomed6.t @@ -52,7 +52,7 @@ # and PF_INET6 so selectively import things from Socket6. use Socket6 ( qw(AI_PASSIVE getaddrinfo - sockaddr_in6 unpack_sockaddr_in6_all pack_sockaddr_in6_all in6addr_any + sockaddr_in6 unpack_sockaddr_in6 pack_sockaddr_in6_all in6addr_any inet_ntop ) );
Thanks for the new report. Should be fixed in 2.69.