Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't fail on Win32 if we're not superuser

  • Loading branch information...
commit 0c6400aad70000e4b94929f5af56a045b30465ff 1 parent b61b516
@cosimo authored
Showing with 14 additions and 3 deletions.
  1. +2 −1  dist.ini
  2. +1 −1  lib/Net/Prober.pm
  3. +11 −1 t/icmp.t
View
3  dist.ini
@@ -4,7 +4,7 @@ license = Perl_5
copyright_holder = Cosimo Streppone
copyright_year = 2012
-version = 0.06
+version = 0.07
[@Basic]
[PkgVersion]
@@ -26,6 +26,7 @@ repository.type = git
;[CheckChangeLog]
[Prereqs]
+perl = 5.010
Carp = 0
Data::Dumper = 0
Digest::MD5 = 0
View
2  lib/Net/Prober.pm
@@ -109,7 +109,7 @@ the Varnish probe config block:
=cut
-use 5.006;
+use 5.010;
use strict;
use warnings;
View
12 t/icmp.t
@@ -15,7 +15,17 @@ use warnings;
use Test::More;
-if (my $running_as_root = ! ($< | $>)) {
+my $running_as_root = ! ($< | $>);
+
+# Apparently on Windows, as on *nix, you can't ICMP unless you're superuser
+# http://www.cpantesters.org/cpan/report/606fe1d8-7078-1014-aabe-a80e3373d4b5
+if ($^O =~ m{MSWin32}) {
+ require Win32; # not sure it's needed
+ $running_as_root = Win32::IsAdminUser();
+}
+
+my $can_icmp = $running_as_root;
+if ($can_icmp) {
plan tests => 8;
} else {
plan skip_all => "icmp ping requires superuser privileges";
Please sign in to comment.
Something went wrong with that request. Please try again.