Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions tests/nhc-operator/tests/post_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ var _ = Describe(
Expect(hasValidSubscription).To(BeTrue(),
"CSV should have operators.openshift.io/valid-subscription annotation")

By("Checking certified annotation")

_, hasCertified := annotations["operators.openshift.io/certified"]
Expect(hasCertified).To(BeTrue(),
"CSV should have operators.openshift.io/certified annotation")

By("Checking support annotation")

supportValue, hasSupport := annotations["support"]
Expand Down Expand Up @@ -205,13 +211,9 @@ var _ = Describe(
By("Checking replaces field when present")

replaces := nhcCSV.Object.Spec.Replaces
if replaces != "" {
Expect(replaces).To(ContainSubstring(nhcparams.CSVNamePattern),
"replaces field should contain %q, got %q", nhcparams.CSVNamePattern, replaces)
} else {
GinkgoWriter.Printf("CSV %q has empty spec.replaces (expected on first install)\n",
nhcCSV.Object.Name)
}
Expect(replaces).ToNot(BeEmpty(), "CSV spec.replaces should not be empty")
Expect(replaces).To(HavePrefix("node-healthcheck-operator.v99."),
"replaces field should reference v99 release, got %q", replaces)

By("Checking cluster topology for replica validation")

Expand Down Expand Up @@ -274,6 +276,11 @@ var _ = Describe(
runningPods := helpers.FilterRunningPods(nhcPods)
Expect(runningPods).ToNot(BeEmpty(), "No running NHC controller pods found")

By("Verifying NHC controller pod count matches expected minimum")

Expect(len(runningPods)).To(BeNumerically(">=", 5),
"Expected at least 5 running NHC controller pods, found %d", len(runningPods))

errorMessages := helpers.ValidateNonRootSecurityContext(
runningPods, nhcparams.ManagerContainerName, true)

Expand Down