summaryrefslogtreecommitdiff
path: root/lib/Net/Ping/t/110_icmp_inst.t
blob: 41f8e155e56ebfbba4d0df63ab34234bffbf8440 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Test to make sure object can be instantiated for icmp protocol.
# Root access is required to actually perform icmp testing.

BEGIN {
  unless (eval "require Socket") {
    print "1..0 \# Skip: no Socket\n";
    exit;
  }
}

use Test;
use Net::Ping;
plan tests => 2;

# Everything loaded fine
ok 1;

if (($> and $^O ne 'VMS')
    or ($^O eq 'MSWin32'
        and Win32::IsWinNT())
    or ($^O eq 'VMS'
        and (`write sys\$output f\$privilege("SYSPRV")` =~ m/FALSE/))) {
  skip "icmp ping requires root privileges.", 1;
} else {
  my $p = new Net::Ping "icmp";
  ok !!$p;
}