Skip to content

Commit

Permalink
adding test to make sure crd is explainable
Browse files Browse the repository at this point in the history
Signed-off-by: Ram Lavi <[email protected]>
  • Loading branch information
RamLavi committed Sep 8, 2020
1 parent 0c60d0a commit f917f7e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/check/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ func CheckComponentsDeployment(components []Component) {
}
}

func CheckCrdExplainable() {
By("Checking crd is explainable")
explain, err := Kubectl("explain", "networkaddonsconfigs")
Expect(err).NotTo(HaveOccurred(), "explain should not return error")

Expect(explain).ToNot(BeEmpty(), "explain output should not be empty")
Expect(explain).ToNot(ContainSubstring("<empty>"), "explain output should not contain <empty> fields")
}

func CheckComponentsRemoval(components []Component) {
for _, component := range components {
if component.ComponentName == MultusComponent.ComponentName && IsOnOKDCluster() {
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/lifecycle/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ var _ = Context("Cluster Network Addons Operator", func() {
Context(fmt.Sprintf("when operator in version %s is installed and supported spec configured", oldRelease.Version), func() {
BeforeEach(func() {
InstallRelease(oldRelease)
CheckCrdExplainable()
CheckOperatorIsReady(podsDeploymentTimeout)
CreateConfig(oldRelease.SupportedSpec)
CheckConfigCondition(ConditionAvailable, ConditionTrue, 15*time.Minute, CheckDoNotRepeat)
Expand All @@ -32,6 +33,7 @@ var _ = Context("Cluster Network Addons Operator", func() {
BeforeEach(func() {
UninstallRelease(oldRelease)
InstallRelease(newRelease)
CheckCrdExplainable()
UpdateConfig(newRelease.SupportedSpec)
CheckOperatorIsReady(podsDeploymentTimeout)

Expand Down

0 comments on commit f917f7e

Please sign in to comment.