Skip to content

Commit

Permalink
case20 case13
Browse files Browse the repository at this point in the history
Signed-off-by: Yi Rae Kim <yikim@redhat.com>
  • Loading branch information
yiraeChristineKim committed Jun 26, 2023
1 parent a205045 commit ab79ae3
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
15 changes: 9 additions & 6 deletions test/e2e/case13_templatization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,14 @@ var _ = Describe("Test templatization", Ordered, func() {
return utils.GetComplianceState(managedPlc)
}, defaultTimeoutSeconds, 1).Should(Equal("Compliant"))
})
AfterAll(func() {
utils.Kubectl("delete", "configurationpolicy", case13CfgPolCreatePod,
"-n", testNamespace, "--ignore-not-found")
utils.Kubectl("delete", "configurationpolicy", case13CfgPolVerifyPod,
"-n", testNamespace, "--ignore-not-found")
utils.Kubectl("delete", "configurationpolicy",
case13CfgPolVerifyPodWithConfigMap, "-n", testNamespace, "--ignore-not-found")
})
})
Describe("Use the generic lookup template to get the same resources from the previous tests", func() {
It("should match the values pulled by resource-specific functions", func() {
Expand All @@ -225,7 +233,7 @@ var _ = Describe("Test templatization", Ordered, func() {

return utils.GetStatusMessage(managedPlc)
}, defaultTimeoutSeconds, 1).Should(Equal(
"pods [testvalue] in namespace default found as specified, therefore this Object template is compliant",
"pods [c13-pod] in namespace default found as specified, therefore this Object template is compliant",
))

By("Clean up")
Expand Down Expand Up @@ -523,11 +531,6 @@ var _ = Describe("Test templatization", Ordered, func() {
"-n", "default", "--ignore-not-found")
utils.Kubectl("delete", "secret", case13Secret,
"-n", "default", "--ignore-not-found")

utils.Kubectl("delete", "configurationpolicy", case13CfgPolCreatePod, "-n", testNamespace)
utils.Kubectl("delete", "configurationpolicy", case13CfgPolVerifyPod, "-n", testNamespace)
utils.Kubectl("delete", "configurationpolicy",
case13CfgPolVerifyPodWithConfigMap, "-n", testNamespace)
})
})
})
2 changes: 1 addition & 1 deletion test/e2e/case20_delete_objects_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ var _ = Describe("Clean up old object when configurationpolicy is changed", Orde
const (
oldPodName string = "case20-name-changed-pod"
newPodName string = "case20-name-changed-new"
configplcName string = "case20-name-changed-c20"
configplcName string = "case20-name-changed"
case20ChangeConfigYaml string = "../resources/case20_delete_objects/case20_change_config_policy.yaml"
)
cleanup := func() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ kind: ClusterClaim
metadata:
name: testclaim.open-cluster-management.io
spec:
value: testvalue
value: c13-pod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
apiVersion: v1
kind: Pod
metadata:
name: testvalue
name: c13-pod
spec:
containers:
- image: nginx:1.7.9
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:
name: case20-name-changed-c20
name: case20-name-changed
namespace: managed
spec:
remediationAction: enforce
Expand Down

0 comments on commit ab79ae3

Please sign in to comment.