Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

siteconfig-operator: cnf: draft:adding recovery test cases #195

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions tests/cnf/ran/gitopsztp/internal/tsparams/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ const (
LabelMachineConfigTestCases = "ztp-machine-config"
// LabelSpokeCheckerTests is the label for a particular set of test cases.
LabelSpokeCheckerTests = "ztp-spoke-checker"
// LabelSiteconfigOperatorTestCases is the label for the Siteconfig operator test cases.
LabelSiteconfigOperatorTestCases = "ztp-siteconfig-operator"

// MultiClusterHubOperator is the name of the multi cluster hub operator.
MultiClusterHubOperator = "multiclusterhub-operator"
Expand Down
43 changes: 43 additions & 0 deletions tests/cnf/ran/gitopsztp/tests/ztp-siteconfig-operator.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package tests

import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/openshift-kni/eco-goinfra/pkg/reportxml"
"github.com/openshift-kni/eco-gotests/tests/cnf/ran/gitopsztp/internal/gitdetails"
"github.com/openshift-kni/eco-gotests/tests/cnf/ran/gitopsztp/internal/tsparams"
. "github.com/openshift-kni/eco-gotests/tests/cnf/ran/internal/raninittools"
"github.com/openshift-kni/eco-gotests/tests/cnf/ran/internal/version"
)

var _ = Describe("ZTP Siteconfig Operator Tests", Label(tsparams.LabelSiteconfigOperatorTestCases), func() {
BeforeEach(func() {
By("verifying that ZTP meets the minimum version")
versionInRange, err := version.IsVersionStringInRange(RANConfig.ZTPVersion, "4.17", "")
Expect(err).ToNot(HaveOccurred(), "Failed to compare ZTP version string")

if !versionInRange {
Skip("ZTP Siteconfig operator tests require ZTP 4.17 or later")
}

})

AfterEach(func() {
By("resetting the clusters app back to the original settings")
err := gitdetails.SetGitDetailsInArgoCd(
tsparams.ArgoCdClustersAppName, tsparams.ArgoCdAppDetails[tsparams.ArgoCdClustersAppName], true, false)
Expect(err).ToNot(HaveOccurred(), "Failed to reset clusters app git details")
})

// 75382 - Recovery test by referencing non-existent cluster template configmap.
It("Verify new siteconfig operator’s recovery mechanism by referencing non-existent "+
"cluster template configmap", reportxml.ID("75382"), func() {
// Test validation steps automation code implementation is in-progress.
})

// 75383 - Recovery test by referencing non-existent extra manifests configmap.
It("Verify new siteconfig operator’s recovery mechanism by referencing non-existent "+
"extra manifests configmap", reportxml.ID("75383"), func() {
// Test validation steps automation code implementation is in-progress.
})
})
Loading