handle EPERM error returned on AF_CAN

This commit is contained in:
Sauci
2020-11-26 02:48:05 -08:00
parent cd2e4ae801
commit c55537cdff

View File

@@ -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)
}