From c55537cdff4baaf55c119fbfb99795d0fc158957 Mon Sep 17 00:00:00 2001 From: Sauci Date: Thu, 26 Nov 2020 02:48:05 -0800 Subject: [PATCH] handle EPERM error returned on AF_CAN --- unix/syscall_internal_linux_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/unix/syscall_internal_linux_test.go b/unix/syscall_internal_linux_test.go index a7b53162..7d888172 100644 --- a/unix/syscall_internal_linux_test.go +++ b/unix/syscall_internal_linux_test.go @@ -232,6 +232,10 @@ func Test_anyToSockaddr(t *testing.T) { t.Skip("socket family/protocol not supported by kernel") } else if err == EAFNOSUPPORT { t.Skip("socket address family not supported by kernel") + } else if err == EPERM { + // Some platforms might require elevated privileges to perform + // actions on sockets. Skip the test in this situation. + t.Skip("socket operation not permitted") } else if err != nil { t.Fatalf("socket(%v): %v", tt.skt, err) }