Skip to content

Commit

Permalink
OCM-11730 | ci: fix id:75534
Browse files Browse the repository at this point in the history
  • Loading branch information
aaraj7 committed Oct 11, 2024
1 parent 2208c2b commit 7f0c37a
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions tests/e2e/test_rosacli_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -3503,7 +3503,7 @@ var _ = Describe("HCP cluster creation supplemental testing",
"-y",
)
Expect(err).To(BeNil())
} else {
} else if testingClusterName != "" {
// At least try to delete testing cluster
By("Delete cluster by name")
rosaClient.Runner.UnsetArgs()
Expand Down Expand Up @@ -3554,24 +3554,24 @@ var _ = Describe("HCP cluster creation supplemental testing",
flags, err := profilehandler.GenerateClusterCreateFlags(customProfile, rosaClient)
Expect(err).ToNot(HaveOccurred())

command := "rosa create cluster --cluster-name " + clusterName + " " + strings.Join(flags, " ")
command := "rosa create cluster --cluster-name " +
clusterName + " " + strings.Join(flags, " ") + " " + "--mode auto -y"
rosalCommand := config.GenerateCommand(command)

stdout, err := rosaClient.Runner.RunCMD(strings.Split(rosalCommand.GetFullCommand(), " "))
Expect(err).To(BeNil())
Expect(stdout.String()).To(ContainSubstring(fmt.Sprintf("Cluster '%s' has been created", clusterName)))

By("wait for 5 minutes to install logs show up")
time.Sleep(5 * time.Minute)

By("Check the install logs of the hypershift cluster")
output, err := clusterService.InstallLog(clusterName)
Expect(err).ToNot(HaveOccurred())
Expect(output.String()).Should(ContainSubstring("hostedclusters %s Version", clusterName))
Expect(output.String()).Should(ContainSubstring("hostedclusters %s Release image is valid", clusterName))
Eventually(func() (string, error) {
output, err := clusterService.InstallLog(clusterName)
return output.String(), err
}, time.Minute*5, time.Second*10).Should(And(
ContainSubstring("hostedclusters %s Version", clusterName),
ContainSubstring("hostedclusters %s Release image is valid", clusterName)))

By("Check the install logs of the hypershift cluster with flag --watch")
output, err = clusterService.InstallLog(clusterName, "--watch")
output, err := clusterService.InstallLog(clusterName, "--watch")
Expect(err).ToNot(HaveOccurred())
Expect(output.String()).Should(ContainSubstring("hostedclusters %s Version", clusterName))
Expect(output.String()).Should(ContainSubstring("hostedclusters %s Release image is valid", clusterName))
Expand All @@ -3582,14 +3582,13 @@ var _ = Describe("HCP cluster creation supplemental testing",
Expect(err).ToNot(HaveOccurred())
Expect(output.String()).Should(ContainSubstring("Cluster '%s' will start uninstalling now", clusterName))

By("wait for 2 minutes to uninstall logs show up")
time.Sleep(2 * time.Minute)

By("Check the uninstall log of the hosted cluster")
output, err = clusterService.UnInstallLog(clusterName)
Expect(err).ToNot(HaveOccurred())
Expect(output.String()).Should(ContainSubstring("hostedclusters %s Reconciliation completed successfully",
clusterName))
By("Check the uninstall logs of the hypershift cluster")
Eventually(func() (string, error) {
output, err := clusterService.UnInstallLog(clusterName)
return output.String(), err
}, time.Minute*2, time.Second*10).
Should(
ContainSubstring("hostedclusters %s Reconciliation completed successfully", clusterName))

By("Check the uninstall log of the hosted cluster with flag --watch")
output, err = clusterService.UnInstallLog(clusterName, "--watch")
Expand Down

0 comments on commit 7f0c37a

Please sign in to comment.