diff --git a/cerbos/grpc_linux_test.go b/cerbos/grpc_linux_test.go new file mode 100644 index 0000000..a933cb0 --- /dev/null +++ b/cerbos/grpc_linux_test.go @@ -0,0 +1,8 @@ +// Copyright 2021-2024 Zenauth Ltd. +// SPDX-License-Identifier: Apache-2.0 + +//go:build tests && linux + +package cerbos_test + +const osSupportsUDS = true diff --git a/cerbos/grpc_other_oses_test.go b/cerbos/grpc_other_oses_test.go new file mode 100644 index 0000000..8bf2be0 --- /dev/null +++ b/cerbos/grpc_other_oses_test.go @@ -0,0 +1,8 @@ +// Copyright 2021-2024 Zenauth Ltd. +// SPDX-License-Identifier: Apache-2.0 + +//go:build tests && !linux + +package cerbos_test + +const osSupportsUDS = false diff --git a/cerbos/grpc_test.go b/cerbos/grpc_test.go index d2d04cf..60573c8 100644 --- a/cerbos/grpc_test.go +++ b/cerbos/grpc_test.go @@ -93,6 +93,10 @@ func TestGRPCClient(t *testing.T) { }) t.Run("uds", func(t *testing.T) { + if !osSupportsUDS { + t.Skip("Sharing a Unix domain socket over a Docker bind mount is not supported on this operating system") + } + tempDir := t.TempDir() s, err := launcher.Launch(testutil.LaunchConf{ ConfFilePath: tc.confFilePath,