Commit | Line | Data |
505f3f16 |
1 | # Test to make sure object can be instantiated for icmp protocol. |
2 | # Root access is required to actually perform icmp testing. |
3 | |
a2a978ac |
4 | BEGIN { |
49afa5f6 |
5 | unless (eval "require Socket") { |
6 | print "1..0 \# Skip: no Socket\n"; |
7 | exit; |
8 | } |
a2a978ac |
9 | } |
10 | |
505f3f16 |
11 | use Test; |
12 | use Net::Ping; |
13 | plan tests => 2; |
14 | |
15 | # Everything loaded fine |
16 | ok 1; |
17 | |
b757f218 |
18 | if (($> and $^O ne 'VMS') |
0bd43963 |
19 | or ($^O eq 'MSWin32' |
20 | and Win32::IsWinNT()) |
b757f218 |
21 | or ($^O eq 'VMS' |
22 | and (`write sys\$output f\$privilege("SYSPRV")` =~ m/FALSE/))) { |
ddbbf559 |
23 | skip "icmp ping requires root privileges.", 1; |
e69a2255 |
24 | } elsif ($^O eq 'MacOS') { |
25 | skip "icmp protocol not supported.", 1; |
ddbbf559 |
26 | } else { |
27 | my $p = new Net::Ping "icmp"; |
28 | ok !!$p; |
29 | } |