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.
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),
],
},
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';
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