dist/Net-Ping - Inhibit sudo code in tests, as it was before recent upgrade to 2.75

This commit is contained in:
Thibault DUPONCHELLE 2025-09-23 04:33:38 +02:00
parent 765f0a6432
commit 83f67871ad
2 changed files with 3 additions and 3 deletions

View File

@ -26,7 +26,7 @@ $ENV{TEST_PING_HOST} = "127.0.0.1" if $ENV{NO_NETWORK_TESTING};
# Problem is that ping_icmp needs root perms, and previous bugs were
# never caught. So I rather execute it via sudo in the core test suite
# and on devel CPAN dirs, than not at all and risk further bitrot of this API.
if (!Net::Ping::_isroot()) {
if (0 && !Net::Ping::_isroot()) {
my $file = __FILE__;
my $lib = $ENV{PERL_CORE} ? '-I../../lib' : '-Mblib';
if ($is_devel and $Config{ccflags} =~ /fsanitize=address/ and $^O eq 'linux') {
@ -55,7 +55,7 @@ if (!Net::Ping::_isroot()) {
SKIP: {
skip "icmp ping requires root privileges.", 2
if ($^O ne 'Linux' and !Net::Ping::_isroot()) or $^O eq 'MSWin32';
if !Net::Ping::_isroot() or $^O eq 'MSWin32';
my $p = new Net::Ping "icmp";
is($p->message_type(), 'echo', "default icmp message type is 'echo'");
# message_type fails on wrong message type

View File

@ -20,7 +20,7 @@ BEGIN {
my $is_devel = $ENV{PERL_CORE} || -d ".git" ? 1 : 0;
$ENV{TEST_PING6_HOST} = "::1" if $ENV{NO_NETWORK_TESTING};
if (!Net::Ping::_isroot()) {
if (0 && !Net::Ping::_isroot()) {
my $file = __FILE__;
my $lib = $ENV{PERL_CORE} ? '-I../../lib' : '-Mblib';
# -n prevents from asking for a password. rather fail then