Skip to content

Commit

Permalink
removed psp related hull test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
vardhaman22 committed Mar 18, 2024
1 parent c2314ba commit 3ce6d47
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 133 deletions.
66 changes: 0 additions & 66 deletions tests/common/global_psp_checks.go

This file was deleted.

20 changes: 0 additions & 20 deletions tests/rancher-cis-benchmark/rancher_cis_benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,6 @@ var suite = test.Suite{
TemplateOptions: chart.NewTemplateOptions(DefaultReleaseName, DefaultNamespace).
Set("nodeSelector", testNodeSelector),
},
{
Name: "Set .Values.global.cattle.psp.enabled to true",

TemplateOptions: chart.NewTemplateOptions(DefaultReleaseName, DefaultNamespace).
Set("global.cattle.psp.enabled", true),
},
{
Name: "Set .Values.global.cattle.psp.enabled to false",

TemplateOptions: chart.NewTemplateOptions(DefaultReleaseName, DefaultNamespace).
Set("global.cattle.psp.enabled", false),
},
{
Name: "Set Values.global.cattle.clusterName",

Expand Down Expand Up @@ -323,14 +311,6 @@ var suite = test.Suite{
patchSaJobExistsCheck,
},
},
{

Name: "PSPs Are Created And Referenced As Per .Values.global.cattle.psp.enabled field",
Covers: []string{
".Values.global.cattle.psp.enabled",
},
Checks: common.EnsurePSPsExist(1),
},
{

Name: "Check cisoperator image repository and tag",
Expand Down
47 changes: 0 additions & 47 deletions tests/rancher-istio/rancher_istio.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,6 @@ var suite = test.Suite{
"global.cattle.systemDefaultRegistry", "testRegistry",
),
},

{
Name: "Set .Values.global.cattle.psp.enabled to true",

TemplateOptions: chart.NewTemplateOptions(DefaultReleaseName, DefaultNamespace).
Set("global.cattle.psp.enabled", true),
},
{
Name: "Set .Values.global.cattle.psp.enabled to false",

TemplateOptions: chart.NewTemplateOptions(DefaultReleaseName, DefaultNamespace).
Set("global.cattle.psp.enabled", false),
},

{
Name: "Set .Values.global.proxy",
TemplateOptions: chart.NewTemplateOptions(DefaultReleaseName, DefaultNamespace).
Expand Down Expand Up @@ -357,39 +343,6 @@ var suite = test.Suite{
},
},

{ //Set PSPs
Name: "Set PSPs",

Covers: []string{
".Values.global.cattle.psp.enabled",
},

Checks: test.Checks{
checker.PerResource(func(tc *checker.TestContext, cr *rbacv1.ClusterRole) {
pspsEnabled, _ := checker.RenderValue[bool](tc, ".Values.global.cattle.psp.enabled")
pspsFound := false
for _, rule := range cr.Rules {
for _, resource := range rule.Resources {
if resource == "podsecuritypolicies" {
pspsFound = true
}
}
}
if !pspsEnabled {
assert.False(tc.T, pspsFound, "ClusterRole %s has incorrect PSP configuration", cr.Name)
}
}),
checker.OnResources(func(tc *checker.TestContext, psps []*policyv1beta1.PodSecurityPolicy) {
pspsEnabled, _ := checker.RenderValue[bool](tc, ".Values.global.cattle.psp.enabled")
if pspsEnabled {
assert.Equal(tc.T, 5, len(psps), "Missing PSPs")
} else {
assert.Equal(tc.T, 0, len(psps), "Missing PSPs")
}
}),
},
},

{ // Setting forceInstall: true will remove the check for istio version < 1.6.x and will not analyze your install cluster prior to install
Name: "forceinstall",
Covers: []string{
Expand Down

0 comments on commit 3ce6d47

Please sign in to comment.