mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-02-21 22:57:15 +00:00
Added e2e tests with disabled SELinux
Added few tests with a CSI driver that does not support SELinux and has it disabled in its CSIDriver instance
This commit is contained in:
@@ -752,6 +752,50 @@ var _ = utils.SIGDescribe("CSI Mock selinux on mount metrics and SELinuxWarningC
|
||||
expectNodeIncreases: sets.New[string]("volume_manager_selinux_volumes_admitted_total"),
|
||||
testTags: []interface{}{framework.WithFeatureGate(features.SELinuxMount)},
|
||||
},
|
||||
{
|
||||
name: "warning is not bumped on RWO volume with CSIDriver.SELinuxMount disabled and mismatched labels",
|
||||
csiDriverSELinuxEnabled: false,
|
||||
firstPodSELinuxOpts: &seLinuxOpts1,
|
||||
secondPodSELinuxOpts: &seLinuxOpts2,
|
||||
volumeMode: v1.ReadWriteOnce,
|
||||
waitForSecondPodStart: true,
|
||||
expectNodeIncreases: sets.New[string]( /* no metric is increased, admitted_total was already increased when the first pod started */ ),
|
||||
testTags: []interface{}{framework.WithFeatureGate(features.SELinuxMount)},
|
||||
},
|
||||
{
|
||||
name: "warning is not bumped on RWX volume with CSIDriver.SELinuxMount disabled and mismatched labels",
|
||||
csiDriverSELinuxEnabled: false,
|
||||
firstPodSELinuxOpts: &seLinuxOpts1,
|
||||
secondPodSELinuxOpts: &seLinuxOpts2,
|
||||
volumeMode: v1.ReadWriteMany,
|
||||
waitForSecondPodStart: true,
|
||||
expectNodeIncreases: sets.New[string]( /* no metric is increased, admitted_total was already increased when the first pod started */ ),
|
||||
testTags: []interface{}{framework.WithFeatureGate(features.SELinuxMount)},
|
||||
},
|
||||
{
|
||||
name: "warning is not bumped on RWO volume with CSIDriver.SELinuxMount disabled and mismatched policies",
|
||||
csiDriverSELinuxEnabled: false,
|
||||
firstPodSELinuxOpts: &seLinuxOpts1,
|
||||
firstPodChangePolicy: &recursive,
|
||||
secondPodSELinuxOpts: &seLinuxOpts1,
|
||||
secondPodChangePolicy: &mount,
|
||||
volumeMode: v1.ReadWriteOnce,
|
||||
waitForSecondPodStart: true,
|
||||
expectNodeIncreases: sets.New[string]( /* no metric is increased, admitted_total was already increased when the first pod started */ ),
|
||||
testTags: []interface{}{framework.WithFeatureGate(features.SELinuxMount)},
|
||||
},
|
||||
{
|
||||
name: "warning is not bumped on RWX volume with CSIDriver.SELinuxMount disabled and mismatched policies",
|
||||
csiDriverSELinuxEnabled: false,
|
||||
firstPodSELinuxOpts: &seLinuxOpts1,
|
||||
firstPodChangePolicy: &recursive,
|
||||
secondPodSELinuxOpts: &seLinuxOpts1,
|
||||
secondPodChangePolicy: &mount,
|
||||
volumeMode: v1.ReadWriteMany,
|
||||
waitForSecondPodStart: true,
|
||||
expectNodeIncreases: sets.New[string]( /* no metric is increased, admitted_total was already increased when the first pod started */ ),
|
||||
testTags: []interface{}{framework.WithFeatureGate(features.SELinuxMount)},
|
||||
},
|
||||
}
|
||||
for _, t := range tests {
|
||||
t := t
|
||||
|
||||
Reference in New Issue
Block a user