From ee12e3ff423009516d25f535b7618e4658fe15ba Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Thu, 10 Nov 2022 10:17:16 +0100 Subject: [PATCH] Add [Feature:SELinux] to all tests that require SELinux Most CI jobs run an OS that does not support SELinux, therefore tests that need it should be skipped by default. * [Feature:SELinux] marks tests that need SELinux (for any feature) * [Feature:SELinuxMountReadWriteOncePod] marks tests that need SELinuxMountReadWriteOncePod alpha gate enabled. Currently, all SELinux tests have both, but it will change in the future. --- test/e2e/storage/csi_mock_volume.go | 2 +- test/e2e/storage/testsuites/disruptive.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/e2e/storage/csi_mock_volume.go b/test/e2e/storage/csi_mock_volume.go index 520e45d3e32..eee80be337d 100644 --- a/test/e2e/storage/csi_mock_volume.go +++ b/test/e2e/storage/csi_mock_volume.go @@ -2012,7 +2012,7 @@ var _ = utils.SIGDescribe("CSI mock volume", func() { } }) - ginkgo.Context("SELinuxMount [LinuxOnly][Feature:SELinuxMountReadWriteOncePod]", func() { + ginkgo.Context("SELinuxMount [LinuxOnly][Feature:SELinux][Feature:SELinuxMountReadWriteOncePod]", func() { // Make sure all options are set so system specific defaults are not used. seLinuxOpts := v1.SELinuxOptions{ User: "system_u", diff --git a/test/e2e/storage/testsuites/disruptive.go b/test/e2e/storage/testsuites/disruptive.go index 2ca3e3a72c5..e90191f846b 100644 --- a/test/e2e/storage/testsuites/disruptive.go +++ b/test/e2e/storage/testsuites/disruptive.go @@ -202,26 +202,26 @@ func (s *disruptiveTestSuite) DefineTests(driver storageframework.TestDriver, pa } multiplePodTests := []multiplePodTest{ { - testItStmt: "Should test that pv used in a pod that is deleted while the kubelet is down is usable by a new pod when kubelet returns [Feature:SELinuxMountReadWriteOncePod].", + testItStmt: "Should test that pv used in a pod that is deleted while the kubelet is down is usable by a new pod when kubelet returns [Feature:SELinux][Feature:SELinuxMountReadWriteOncePod].", runTestFile: func(c clientset.Interface, f *framework.Framework, pod1, pod2 *v1.Pod) { storageutils.TestVolumeUnmountsFromDeletedPodWithForceOption(c, f, pod1, false, false, pod2) }, }, { - testItStmt: "Should test that pv used in a pod that is force deleted while the kubelet is down is usable by a new pod when kubelet returns [Feature:SELinuxMountReadWriteOncePod].", + testItStmt: "Should test that pv used in a pod that is force deleted while the kubelet is down is usable by a new pod when kubelet returns [Feature:SELinux][Feature:SELinuxMountReadWriteOncePod].", runTestFile: func(c clientset.Interface, f *framework.Framework, pod1, pod2 *v1.Pod) { storageutils.TestVolumeUnmountsFromDeletedPodWithForceOption(c, f, pod1, true, false, pod2) }, }, { - testItStmt: "Should test that pv used in a pod that is deleted while the kubelet is down is usable by a new pod with a different SELinux context when kubelet returns [Feature:SELinuxMountReadWriteOncePod].", + testItStmt: "Should test that pv used in a pod that is deleted while the kubelet is down is usable by a new pod with a different SELinux context when kubelet returns [Feature:SELinux][Feature:SELinuxMountReadWriteOncePod].", changeSELinuxContexts: true, runTestFile: func(c clientset.Interface, f *framework.Framework, pod1, pod2 *v1.Pod) { storageutils.TestVolumeUnmountsFromDeletedPodWithForceOption(c, f, pod1, false, false, pod2) }, }, { - testItStmt: "Should test that pv used in a pod that is force deleted while the kubelet is down is usable by a new pod with a different SELinux context when kubelet returns [Feature:SELinuxMountReadWriteOncePod].", + testItStmt: "Should test that pv used in a pod that is force deleted while the kubelet is down is usable by a new pod with a different SELinux context when kubelet returns [Feature:SELinux][Feature:SELinuxMountReadWriteOncePod].", changeSELinuxContexts: true, runTestFile: func(c clientset.Interface, f *framework.Framework, pod1, pod2 *v1.Pod) { storageutils.TestVolumeUnmountsFromDeletedPodWithForceOption(c, f, pod1, true, false, pod2)