Integrate mainline
[p5sagit/p5-mst-13.2.git] / lib / Net / Ping / t / 110_icmp_inst.t
index c358dac..bf27289 100644 (file)
@@ -2,10 +2,10 @@
 # Root access is required to actually perform icmp testing.
 
 BEGIN {
-    unless (eval "require Socket") {
-       print "1..0 # Skip: no Socket\n";
-       exit;
-    }
+  unless (eval "require Socket") {
+    print "1..0 \# Skip: no Socket\n";
+    exit;
+  }
 }
 
 use Test;
@@ -15,5 +15,11 @@ plan tests => 2;
 # Everything loaded fine
 ok 1;
 
-my $p = new Net::Ping "tcp";
-ok !!$p;
+if (($> and $^O ne 'VMS')
+    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;
+}