Skip to content

Commit

Permalink
Use a valid compliance state in a test
Browse files Browse the repository at this point in the history
Previously, the CRD did not validate the status.compliance field on
ConfigurationPolicies, but now it does. The test will now use, and check
for, an allowed value on that field.

Signed-off-by: Justin Kulikauskas <jkulikau@redhat.com>
  • Loading branch information
JustinKuli authored and openshift-merge-bot[bot] committed Jun 18, 2024
1 parent e6933aa commit 1378b0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/e2e/case10_error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ var _ = Describe("Test error handling", func() {
1, true, defaultTimeoutSeconds)

By("Manually updating the status on the created configuration policy")
compliancePatch := []byte(`[{"op":"add","path":"/status","value":{"compliant":"testing"}}]`)
compliancePatch := []byte(`[{"op":"add","path":"/status","value":{"compliant":"Pending"}}]`)
// can't just use kubectl - status is a sub-resource
cfgInt := clientManagedDynamic.Resource(gvrConfigurationPolicy).Namespace(clusterNamespace)
_, err := cfgInt.Patch(context.TODO(), "case10-config-policy", types.JSONPatchType,
Expand Down Expand Up @@ -253,7 +253,7 @@ var _ = Describe("Test error handling", func() {
compState, found, err := unstructured.NestedString(cfgPolicy.Object, "status", "compliant")
Expect(err).ToNot(HaveOccurred())
Expect(found).To(BeTrue())
Expect(compState).To(Equal("testing"))
Expect(compState).To(Equal("Pending"))

By("Re-applying the working policy")
hubApplyPolicy("case10-test-policy",
Expand Down

0 comments on commit 1378b0e

Please sign in to comment.