In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/7bfdd8260c4e963865603619e956b96e0ad73646?hp=11288bb3e74d2953b4018f5548f558aa24f9888f>
- Log ----------------------------------------------------------------- commit 7bfdd8260c4e963865603619e956b96e0ad73646 Author: David Mitchell <[email protected]> Date: Thu Nov 3 11:06:25 2016 +0000 Net::Ping 500_ping_icmp.t: remove sudo code Rcently this test scipt had code added to it to attempt to re-run itself as root by invoking 'sudo' rather rather than just skipping the ICMP ping test. This can the side-effects of: * sudo sending a security alert email to the local root account; * a script being run as root when a non-root user invokes 'make test', which might be considered antisocial; * noise on stderr about sudo failing. See http://nntp.perl.org/group/perl.perl5.porters/240707. This commit just removes the sudo code and doesn't try to do anything clever. ----------------------------------------------------------------------- Summary of changes: Porting/Maintainers.pl | 2 +- dist/Net-Ping/t/500_ping_icmp.t | 13 ++----------- t/porting/customized.dat | 1 + 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index bfef42f..92e3179 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -898,7 +898,7 @@ use File::Glob qw(:case); qw(t/601_pod-coverage.t), ], 'CUSTOMIZED' => [ - qw( t/000_load.t t/001_new.t t/010_pingecho.t ), + qw( t/000_load.t t/001_new.t t/010_pingecho.t t/500_ping_icmp.t), ], }, diff --git a/dist/Net-Ping/t/500_ping_icmp.t b/dist/Net-Ping/t/500_ping_icmp.t index 77085a2..a9175ba 100644 --- a/dist/Net-Ping/t/500_ping_icmp.t +++ b/dist/Net-Ping/t/500_ping_icmp.t @@ -12,19 +12,10 @@ BEGIN { unless ($Config{d_getpbyname}) { plan skip_all => 'no getprotobyname'; } - require Net::Ping; - if (!Net::Ping::_isroot()) { - my $file = __FILE__; - my $lib = $ENV{PERL_CORE} ? '-I../../lib' : '-Mblib'; - # -n prevents from asking for a password. rather fail then - if (system("sudo -n \"$^X\" $lib $file") == 0) { - exit; - } else { - plan skip_all => 'no sudo/failed'; - } - } } +BEGIN {use_ok('Net::Ping')}; + SKIP: { skip "icmp ping requires root privileges.", 1 if !Net::Ping::_isroot() or $^O eq 'MSWin32'; diff --git a/t/porting/customized.dat b/t/porting/customized.dat index bd67e0c..a5d757a 100644 --- a/t/porting/customized.dat +++ b/t/porting/customized.dat @@ -49,6 +49,7 @@ Memoize cpan/Memoize/Memoize.pm 902092ff91cdec9c7b4bd06202eb179e1ce26ca2 Net::Ping dist/Net-Ping/t/000_load.t deff5dc2ca54dae28cb19d3631427db127279ac2 Net::Ping dist/Net-Ping/t/001_new.t 90c9d63509b3efc8941449fbd1ca8b807fa42040 Net::Ping dist/Net-Ping/t/010_pingecho.t 2e7340ee0e9f6119b889016fc8b89e6bcd4a8fe2 +Net::Ping dist/Net-Ping/t/500_ping_icmp.t a003daa5eaf215e58234786bb1fbfbebf669bf44 Pod::Checker cpan/Pod-Checker/t/pod/contains_bad_pod.xr 73538fd80dfe6e19ad561fe034009b44460208f6 Pod::Checker cpan/Pod-Checker/t/pod/selfcheck.t 8ce3cfd38e4b9bcf5bc7fe7f2a14195e49aed7d8 Pod::Checker cpan/Pod-Checker/t/pod/testcmp.pl a0cd5c8eca775c7753f4464eee96fa916e3d8a16 -- Perl5 Master Repository
