From aa91c1c8ebf99294b08559e0b4f8780d51a97e9c Mon Sep 17 00:00:00 2001 From: Lucas Kanashiro Date: Fri, 30 Dec 2022 14:25:29 +0800 Subject: [PATCH] Skip tests which require a certain level of privilege Forwarded: not-needed Last-Updated: 2021-05-20 During build we cannot bindmount sysfs and cgroupfs in a chroot which leads to failures. Gbp-Pq: Name skip-tests-with-privilege.patch --- pkg/cri/server/container_create_linux_test.go | 13 +++++++++++++ pkg/cri/server/container_create_test.go | 3 +++ .../server/container_update_resources_linux_test.go | 1 + 3 files changed, 17 insertions(+) diff --git a/pkg/cri/server/container_create_linux_test.go b/pkg/cri/server/container_create_linux_test.go index 881c8ec..80c0890 100644 --- a/pkg/cri/server/container_create_linux_test.go +++ b/pkg/cri/server/container_create_linux_test.go @@ -187,6 +187,7 @@ func getCreateContainerTestData() (*runtime.ContainerConfig, *runtime.PodSandbox } func TestContainerCapabilities(t *testing.T) { + t.Skip("It requires HugeTLB controller enabled which requires mounting cgroupfs. Not achievable during the build.") testID := "test-id" testSandboxID := "sandbox-id" testContainerName := "container-name" @@ -267,6 +268,7 @@ func TestContainerCapabilities(t *testing.T) { } func TestContainerSpecTty(t *testing.T) { + t.Skip("It requires HugeTLB controller enabled which requires mounting cgroupfs. Not achievable during the build.") testID := "test-id" testSandboxID := "sandbox-id" testContainerName := "container-name" @@ -289,6 +291,7 @@ func TestContainerSpecTty(t *testing.T) { } func TestContainerSpecDefaultPath(t *testing.T) { + t.Skip("It requires HugeTLB controller enabled which requires mounting cgroupfs. Not achievable during the build.") testID := "test-id" testSandboxID := "sandbox-id" testContainerName := "container-name" @@ -311,6 +314,7 @@ func TestContainerSpecDefaultPath(t *testing.T) { } func TestContainerSpecReadonlyRootfs(t *testing.T) { + t.Skip("It requires HugeTLB controller enabled which requires mounting cgroupfs. Not achievable during the build.") testID := "test-id" testSandboxID := "sandbox-id" testContainerName := "container-name" @@ -328,6 +332,7 @@ func TestContainerSpecReadonlyRootfs(t *testing.T) { } func TestContainerSpecWithExtraMounts(t *testing.T) { + t.Skip("It requires HugeTLB controller enabled which requires mounting cgroupfs. Not achievable during the build.") testID := "test-id" testSandboxID := "sandbox-id" testContainerName := "container-name" @@ -389,6 +394,7 @@ func TestContainerSpecWithExtraMounts(t *testing.T) { } func TestContainerAndSandboxPrivileged(t *testing.T) { + t.Skip("It requires HugeTLB controller enabled which requires mounting cgroupfs. Not achievable during the build.") testID := "test-id" testSandboxID := "sandbox-id" testContainerName := "container-name" @@ -602,6 +608,7 @@ func TestContainerMounts(t *testing.T) { } func TestPrivilegedBindMount(t *testing.T) { + t.Skip("It requires privilege to mount sysfs and cgroupfs. Not achievable during the build.") testPid := uint32(1234) c := newTestCRIService() testSandboxID := "sandbox-id" @@ -752,6 +759,7 @@ func TestMountPropagation(t *testing.T) { } func TestPidNamespace(t *testing.T) { + t.Skip("It requires HugeTLB controller enabled which requires mounting cgroupfs. Not achievable during the build.") testID := "test-id" testPid := uint32(1234) testSandboxID := "sandbox-id" @@ -793,6 +801,7 @@ func TestPidNamespace(t *testing.T) { } func TestNoDefaultRunMount(t *testing.T) { + t.Skip("It requires HugeTLB controller enabled which requires mounting cgroupfs. Not achievable during the build.") testID := "test-id" testPid := uint32(1234) testSandboxID := "sandbox-id" @@ -1097,6 +1106,7 @@ func TestGenerateApparmorSpecOpts(t *testing.T) { } func TestMaskedAndReadonlyPaths(t *testing.T) { + t.Skip("It requires HugeTLB controller enabled which requires mounting cgroupfs. Not achievable during the build.") testID := "test-id" testSandboxID := "sandbox-id" testContainerName := "container-name" @@ -1185,6 +1195,7 @@ func TestMaskedAndReadonlyPaths(t *testing.T) { } func TestHostname(t *testing.T) { + t.Skip("It requires HugeTLB controller enabled which requires mounting cgroupfs. Not achievable during the build.") testID := "test-id" testSandboxID := "sandbox-id" testContainerName := "container-name" @@ -1316,6 +1327,7 @@ func TestGenerateUserString(t *testing.T) { } func TestPrivilegedDevices(t *testing.T) { + t.Skip("It requires privilege to test devices. Not achievable during the build.") testPid := uint32(1234) c := newTestCRIService() testSandboxID := "sandbox-id" @@ -1378,6 +1390,7 @@ func TestPrivilegedDevices(t *testing.T) { } func TestBaseOCISpec(t *testing.T) { + t.Skip("It requires HugeTLB controller enabled which requires mounting cgroupfs. Not achievable during the build.") c := newTestCRIService() baseLimit := int64(100) c.baseOCISpecs = map[string]*oci.Spec{ diff --git a/pkg/cri/server/container_create_test.go b/pkg/cri/server/container_create_test.go index 8f3a39c..8bff1ea 100644 --- a/pkg/cri/server/container_create_test.go +++ b/pkg/cri/server/container_create_test.go @@ -56,6 +56,7 @@ func checkMount(t *testing.T, mounts []runtimespec.Mount, src, dest, typ string, const testImageName = "container-image-name" func TestGeneralContainerSpec(t *testing.T) { + t.Skip("It requires HugeTLB controller enabled which requires mounting cgroupfs. Not achievable during the build.") testID := "test-id" testPid := uint32(1234) containerConfig, sandboxConfig, imageConfig, specCheck := getCreateContainerTestData() @@ -69,6 +70,7 @@ func TestGeneralContainerSpec(t *testing.T) { } func TestPodAnnotationPassthroughContainerSpec(t *testing.T) { + t.Skip("It requires HugeTLB controller enabled which requires mounting cgroupfs. Not achievable during the build.") if goruntime.GOOS == "darwin" { t.Skip("not implemented on Darwin") } @@ -277,6 +279,7 @@ func TestVolumeMounts(t *testing.T) { } func TestContainerAnnotationPassthroughContainerSpec(t *testing.T) { + t.Skip("It requires HugeTLB controller enabled which requires mounting cgroupfs. Not achievable during the build.") if goruntime.GOOS == "darwin" { t.Skip("not implemented on Darwin") } diff --git a/pkg/cri/server/container_update_resources_linux_test.go b/pkg/cri/server/container_update_resources_linux_test.go index ffbc3f8..a98ae09 100644 --- a/pkg/cri/server/container_update_resources_linux_test.go +++ b/pkg/cri/server/container_update_resources_linux_test.go @@ -27,6 +27,7 @@ import ( ) func TestUpdateOCILinuxResource(t *testing.T) { + t.Skip("It requires some privileges not achievable during the build.") oomscoreadj := new(int) *oomscoreadj = -500 for desc, test := range map[string]struct {