Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

Commit

Permalink
Test CNF pod namespace
Browse files Browse the repository at this point in the history
Must not begin with 'openshift-' and can not be equal to 'default'

https://issues.redhat.com/browse/CTONET-780
Signed-off-by: Yaron Dayagi <[email protected]>
  • Loading branch information
ydayagi authored and ryandgoulding committed Mar 22, 2021
1 parent 9ec80ce commit 4c2f48d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test-network-function/generic/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ var _ = ginkgo.Describe(testsKey, func() {
testIsRedHatRelease(containersUnderTest.oc)
}
testIsRedHatRelease(testOrchestrator.oc)

for _, containersUnderTest := range containersUnderTest {
testNamespace(containersUnderTest.oc)
}
}
})

Expand Down Expand Up @@ -242,3 +246,14 @@ func GetTestConfiguration() *tnfConfig.TestConfiguration {
gomega.Expect(config).ToNot(gomega.BeNil())
return config
}

func testNamespace(oc *interactive.Oc) {
pod := oc.GetPodName()
container := oc.GetPodContainerName()
ginkgo.When(fmt.Sprintf("Reading namespace of %s/%s", pod, container), func() {
ginkgo.It("Should not be 'default' and should not begin with 'openshift-'", func() {
gomega.Expect(oc.GetPodNamespace()).To(gomega.Not(gomega.Equal("default")))
gomega.Expect(oc.GetPodNamespace()).To(gomega.Not(gomega.HavePrefix("openshift-")))
})
})
}

0 comments on commit 4c2f48d

Please sign in to comment.