aboutsummaryrefslogtreecommitdiff
path: root/ipv4/unicast_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'ipv4/unicast_test.go')
-rw-r--r--ipv4/unicast_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/ipv4/unicast_test.go b/ipv4/unicast_test.go
index dfe8b72..05f7902 100644
--- a/ipv4/unicast_test.go
+++ b/ipv4/unicast_test.go
@@ -79,8 +79,8 @@ func TestPacketConnReadWriteUnicastICMP(t *testing.T) {
case "nacl", "plan9", "solaris", "windows":
t.Skipf("not supported on %q", runtime.GOOS)
}
- if os.Getuid() != 0 {
- t.Skip("must be root")
+ if m, ok := nettest.SupportsRawIPSocket(); !ok {
+ t.Skip(m)
}
ifi := nettest.RoutedInterface("ip4", net.FlagUp|net.FlagLoopback)
if ifi == nil {
@@ -162,8 +162,8 @@ func TestRawConnReadWriteUnicastICMP(t *testing.T) {
case "nacl", "plan9", "solaris", "windows":
t.Skipf("not supported on %q", runtime.GOOS)
}
- if os.Getuid() != 0 {
- t.Skip("must be root")
+ if m, ok := nettest.SupportsRawIPSocket(); !ok {
+ t.Skip(m)
}
ifi := nettest.RoutedInterface("ip4", net.FlagUp|net.FlagLoopback)
if ifi == nil {