Skip Menu |
Report information
Id: 132363
Status: open
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: mhasch-cpanbugs [at] cozap.com
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: (no value)
Severity: High
Type: library
Perl Version: 5.26.1
Fixed In: (no value)



To: perlbug [...] perl.org
Subject: Net::Ping 2.61 test failures
From: Martin Becker <mhasch-cpanbugs [...] cozap.com>
Date: Fri, 27 Oct 2017 11:45:37 +0200
Download (untitled) / with headers
text/plain 1.9k
This is a bug report for perl from mhasch-cpanbugs@cozap.com, generated with the help of perlbug 1.40 running under perl 5.26.1. ----------------------------------------------------------------- [Please describe your issue here] As of version 2.61, the Net::Ping test suite makes assumptions about the IPv4 address 172.29.249.249. This is an RFC 1918 address that may or may not be reachable in any local area network. Making tests fail based on its reachability is therefore non-portable and should be avoided. While replacing the RFC 1918 address by an RFC 5737 address might reduce the risk of it actually being connected there is no guarantee any address usage convention at all will be met within private networks. Therefore, in the test suite, (non-)reachability of a particular address should always be tolerated. Interestingly, some tests against "known" internet hosts are already skipped if an initial ping of "google.com" fails for some reason. Giving up this particular trigger and making all connectivity-related checks report skip reasons rather than failures could be a way to cope with most private and firewalled network situations. Even better though would be a test strategy aiming for code quality criteria independent of outside conditions. This might be achieved using mock-up interfaces or at most localhost. If nothing else, at least provide an opt-out configuration parameter for remote network-aware tests. Currently, PERL_CORE in the environment will have that effect. Unfortunately, this parameter usually is a MakeMaker constant not under control of the user (through distroprefs, say). But not only core may need to skip those tests. Regards, -Martin [Please do not change anything below this line] ----------------------------------------------------------------- --- Flags: category=library severity=high module=Net::Ping --- Site configuration information for perl 5.26.1: (stripped by reporter, considered irrelevant)
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 2.2k
On Fri, 27 Oct 2017 09:52:32 GMT, mhasch-cpanbugs@cozap.com wrote: Show quoted text
> > This is a bug report for perl from mhasch-cpanbugs@cozap.com, > generated with the help of perlbug 1.40 running under perl 5.26.1. > > > ----------------------------------------------------------------- > [Please describe your issue here] > > As of version 2.61, the Net::Ping test suite makes assumptions > about the IPv4 address 172.29.249.249. This is an RFC 1918 > address that may or may not be reachable in any local area > network. Making tests fail based on its reachability is > therefore non-portable and should be avoided. >
For the record, I note that Net::Ping tests using 172.29.249.249 were introduced long before 2.61. They date at least to commit f569508e in October 2002. Show quoted text
> While replacing the RFC 1918 address by an RFC 5737 address > might reduce the risk of it actually being connected there > is no guarantee any address usage convention at all will be > met within private networks. Therefore, in the test suite, > (non-)reachability of a particular address should always be > tolerated. > > Interestingly, some tests against "known" internet hosts are > already skipped if an initial ping of "google.com" fails for > some reason. Giving up this particular trigger and making all > connectivity-related checks report skip reasons rather than > failures could be a way to cope with most private and firewalled > network situations. > > Even better though would be a test strategy aiming for code > quality criteria independent of outside conditions. This might > be achieved using mock-up interfaces or at most localhost. > > If nothing else, at least provide an opt-out configuration > parameter for remote network-aware tests. Currently, PERL_CORE > in the environment will have that effect. Unfortunately, this > parameter usually is a MakeMaker constant not under control > of the user (through distroprefs, say). But not only core may > need to skip those tests. > > Regards, > -Martin > > [Please do not change anything below this line] > ----------------------------------------------------------------- > --- > Flags: > category=library > severity=high > module=Net::Ping > --- > Site configuration information for perl 5.26.1: > > (stripped by reporter, considered irrelevant)
-- James E Keenan (jkeenan@cpan.org)
Subject: [PATCH] Net::Ping 2.61 test failures
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 758b
On Fri, 27 Oct 2017 02:52:32 -0700, I wrote: Show quoted text
> If nothing else, at least provide an opt-out configuration > parameter for remote network-aware tests. Currently, PERL_CORE > in the environment will have that effect. Unfortunately, this > parameter usually is a MakeMaker constant not under control > of the user (through distroprefs, say). But not only core may > need to skip those tests.
Here is a patch introducing another environment variable, SKIP_NETWORK_TESTS, to skip the same tests that perl core would. It can be used as a workaround to avoid test failures in private or firewalled networks, where assumptions about "google.com" or "172.29.249.249" don't hold. I would still like to see a generally more portable test strategy though. -Martin
Subject: Net-Ping-2.61-MHASCH-01.patch
diff -Nrup Net-Ping-2.61.orig/t/190_alarm.t Net-Ping-2.61/t/190_alarm.t --- Net-Ping-2.61.orig/t/190_alarm.t 2016-09-15 10:57:50.000000000 +0200 +++ Net-Ping-2.61/t/190_alarm.t 2017-10-30 09:02:45.249094171 +0100 @@ -4,7 +4,7 @@ # Based on code written by radu@netsoft.ro (Radu Greab). BEGIN { - if ($ENV{PERL_CORE}) { + if ($ENV{PERL_CORE} || $ENV{SKIP_NETWORK_TESTS}) { unless ($ENV{PERL_TEST_Net_Ping}) { print "1..0 \# Skip: network dependent test\n"; exit; diff -Nrup Net-Ping-2.61.orig/t/200_ping_tcp.t Net-Ping-2.61/t/200_ping_tcp.t --- Net-Ping-2.61.orig/t/200_ping_tcp.t 2017-06-05 12:42:30.000000000 +0200 +++ Net-Ping-2.61/t/200_ping_tcp.t 2017-10-30 09:06:22.261097533 +0100 @@ -1,7 +1,7 @@ use strict; BEGIN { - if ($ENV{PERL_CORE}) { + if ($ENV{PERL_CORE} || $ENV{SKIP_NETWORK_TESTS}) { unless ($ENV{PERL_TEST_Net_Ping}) { print "1..0 # Skip: network dependent test\n"; exit; diff -Nrup Net-Ping-2.61.orig/t/250_ping_hires.t Net-Ping-2.61/t/250_ping_hires.t --- Net-Ping-2.61.orig/t/250_ping_hires.t 2016-09-15 10:57:50.000000000 +0200 +++ Net-Ping-2.61/t/250_ping_hires.t 2017-10-30 09:06:08.409097317 +0100 @@ -3,7 +3,7 @@ use strict; BEGIN { - if ($ENV{PERL_CORE}) { + if ($ENV{PERL_CORE} || $ENV{SKIP_NETWORK_TESTS}) { unless ($ENV{PERL_TEST_Net_Ping}) { print "1..0 # Skip: network dependent test\n"; exit; diff -Nrup Net-Ping-2.61.orig/t/300_ping_stream.t Net-Ping-2.61/t/300_ping_stream.t --- Net-Ping-2.61.orig/t/300_ping_stream.t 2016-09-15 10:57:50.000000000 +0200 +++ Net-Ping-2.61/t/300_ping_stream.t 2017-10-30 09:04:08.345095456 +0100 @@ -1,6 +1,6 @@ use strict; BEGIN { - if ($ENV{PERL_CORE}) { + if ($ENV{PERL_CORE} || $ENV{SKIP_NETWORK_TESTS}) { unless ($ENV{PERL_TEST_Net_Ping}) { print "1..0 # Skip: network dependent test\n"; exit; diff -Nrup Net-Ping-2.61.orig/t/400_ping_syn.t Net-Ping-2.61/t/400_ping_syn.t --- Net-Ping-2.61.orig/t/400_ping_syn.t 2017-06-08 07:51:22.000000000 +0200 +++ Net-Ping-2.61/t/400_ping_syn.t 2017-10-30 09:06:51.029097977 +0100 @@ -1,7 +1,7 @@ use strict; BEGIN { - if ($ENV{PERL_CORE}) { + if ($ENV{PERL_CORE} || $ENV{SKIP_NETWORK_TESTS}) { unless ($ENV{PERL_TEST_Net_Ping}) { print "1..0 # Skip: network dependent test\n"; exit; diff -Nrup Net-Ping-2.61.orig/t/410_syn_host.t Net-Ping-2.61/t/410_syn_host.t --- Net-Ping-2.61.orig/t/410_syn_host.t 2017-01-19 07:34:30.000000000 +0100 +++ Net-Ping-2.61/t/410_syn_host.t 2017-10-30 09:03:49.161095161 +0100 @@ -2,7 +2,7 @@ use strict; BEGIN { - if ($ENV{PERL_CORE}) { + if ($ENV{PERL_CORE} || $ENV{SKIP_NETWORK_TESTS}) { unless ($ENV{PERL_TEST_Net_Ping}) { print "1..0 # Skip: network dependent test\n"; exit;


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org