Skip to content

Commit

Permalink
Merge pull request openshift#2172 from jameszwang/ocm-8776
Browse files Browse the repository at this point in the history
OCM-8776 | test: Automated case id:35420,74399 Create cluster with channel group
  • Loading branch information
openshift-merge-bot[bot] authored Jun 14, 2024
2 parents 894bbbe + 26e38ae commit 717d528
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/e2e/test_rosacli_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,20 @@ var _ = Describe("Classic cluster creation validation",
Expect(err).To(HaveOccurred())
Expect(output.String()).To(ContainSubstring("Duplicated label key '%s' used", key))
})

It("to validate to create the cluster with version not in the channel group - [id:74399]",
labels.Medium, labels.Runtime.Day1Negative,
func() {
clusterService := rosaClient.Cluster
clusterName := "ocp-74399"

By("Create cluster with version not in channel group")
errorOutput, err := clusterService.CreateDryRun(
clusterName, "--version=4.15.100",
)
Expect(err).NotTo(BeNil())
Expect(errorOutput.String()).To(ContainSubstring("Expected a valid OpenShift version: A valid version number must be specified"))
})
})

var _ = Describe("Classic cluster deletion validation",
Expand Down
42 changes: 42 additions & 0 deletions tests/e2e/test_rosacli_cluster_post.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/openshift/rosa/tests/utils/common/constants"
"github.com/openshift/rosa/tests/utils/config"
"github.com/openshift/rosa/tests/utils/exec/rosacli"
"github.com/openshift/rosa/tests/utils/profilehandler"
)

var _ = Describe("Healthy check",
Expand Down Expand Up @@ -237,3 +238,44 @@ var _ = Describe("Healthy check",
Expect(etcdEncryption).To(BeTrue())
})
})

var _ = Describe("Create cluster with the version in some channel group testing",
labels.Feature.Cluster,
func() {
defer GinkgoRecover()
var (
clusterID string
rosaClient *rosacli.Client
clusterService rosacli.ClusterService
)

BeforeEach(func() {
By("Get the cluster")
var clusterDetail *profilehandler.ClusterDetail
var err error
clusterDetail, err = profilehandler.ParserClusterDetail()
Expect(err).ToNot(HaveOccurred())
clusterID = clusterDetail.ClusterID
Expect(clusterID).ToNot(Equal(""), "ClusterID is required. Please export CLUSTER_ID")

By("Init the client")
rosaClient = rosacli.NewClient()
clusterService = rosaClient.Cluster
})

AfterEach(func() {
By("Clean remaining resources")
rosaClient.CleanResources(clusterID)
})

It("User can create cluster with channel group - [id:35420]",
labels.Critical, labels.Runtime.Day1Post,
func() {
profile := profilehandler.LoadProfileYamlFileByENV()

By("Check if the cluster using right channel group")
versionOutput, err := clusterService.GetClusterVersion(clusterID)
Expect(err).ToNot(HaveOccurred())
Expect(versionOutput.ChannelGroup).To(Equal(profile.ChannelGroup))
})
})

0 comments on commit 717d528

Please sign in to comment.