From 42e019e6343a10725db02e4ca37ab0e03e6f1355 Mon Sep 17 00:00:00 2001 From: Samuel Karp Date: Wed, 8 Jun 2022 22:40:45 -0700 Subject: [PATCH] cri/server: Disable tests on FreeBSD The TestPodAnnotationPassthroughContainerSpec test and the TestContainerAnnotationPassthroughContainerSpec test both depend on a platform-specific implementation of criService.containerSpec, which is unimplemented on FreeBSD. The TestSandboxContainerSpec depends on a platform-specific implementation oc criService.sandboxContainerSpec, which is unimplemented on FreeBSD. Signed-off-by: Samuel Karp --- pkg/cri/server/container_create_test.go | 10 ++++++++-- pkg/cri/server/sandbox_run_test.go | 6 ++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pkg/cri/server/container_create_test.go b/pkg/cri/server/container_create_test.go index 48e2ed0ab..151751b5f 100644 --- a/pkg/cri/server/container_create_test.go +++ b/pkg/cri/server/container_create_test.go @@ -69,8 +69,11 @@ func TestGeneralContainerSpec(t *testing.T) { } func TestPodAnnotationPassthroughContainerSpec(t *testing.T) { - if goruntime.GOOS == "darwin" { + switch goruntime.GOOS { + case "darwin": t.Skip("not implemented on Darwin") + case "freebsd": + t.Skip("not implemented on FreeBSD") } testID := "test-id" @@ -279,8 +282,11 @@ func TestVolumeMounts(t *testing.T) { } func TestContainerAnnotationPassthroughContainerSpec(t *testing.T) { - if goruntime.GOOS == "darwin" { + switch goruntime.GOOS { + case "darwin": t.Skip("not implemented on Darwin") + case "freebsd": + t.Skip("not implemented on FreeBSD") } testID := "test-id" diff --git a/pkg/cri/server/sandbox_run_test.go b/pkg/cri/server/sandbox_run_test.go index d8159aabb..91a197783 100644 --- a/pkg/cri/server/sandbox_run_test.go +++ b/pkg/cri/server/sandbox_run_test.go @@ -35,10 +35,12 @@ import ( ) func TestSandboxContainerSpec(t *testing.T) { - if goruntime.GOOS == "darwin" { + switch goruntime.GOOS { + case "darwin": t.Skip("not implemented on Darwin") + case "freebsd": + t.Skip("not implemented on FreeBSD") } - testID := "test-id" nsPath := "test-cni" for desc, test := range map[string]struct {