-
Notifications
You must be signed in to change notification settings - Fork 221
OTA-1606: add test OCP-54887 #1349
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -99,4 +99,52 @@ var _ = g.Describe(`[Jira:"Cluster Version Operator"] cluster-version-operator`, | |
| sccAnnotation := cvoPod.Annotations["openshift.io/scc"] | ||
| o.Expect(sccAnnotation).To(o.Equal("hostaccess"), "Expected the annotation 'openshift.io/scc annotation' on pod %s to have the value 'hostaccess', but got %s", cvoPod.Name, sccAnnotation) | ||
| }) | ||
|
|
||
| /*// Migrated from case NonHyperShiftHOST-Author:dis-High-OCP-33876-Clusterversion status has metadata stored | ||
| g.It("Clusterversion status has metadata stored", func() { | ||
| ctx := context.Background() | ||
| err := util.SkipIfHypershift(ctx, restCfg) | ||
| o.Expect(err).NotTo(o.HaveOccurred(), "Failed to determine if cluster is HyperShift") | ||
| err = util.SkipIfMicroshift(ctx, restCfg) | ||
| o.Expect(err).NotTo(o.HaveOccurred(), "Failed to determine if cluster is MicroShift") | ||
|
|
||
| g.By("Checking that the Clusterversion status has metadata stored") | ||
| clusterversion, err := kubeClient.ConfigV1().ClusterVersions().Get(ctx, "version", metav1.GetOptions{}) | ||
| o.Expect(err).NotTo(o.HaveOccurred(), "Failed to get Clusterversion") | ||
| })*/ | ||
|
|
||
| // Migrated from case NonHyperShiftHOST-Author:dis-Medium-OCP-54887-The default channel should be corret | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix typos in migrated case text and log message. Line 116 has “corret”, and Line 148 has “Deafault”; these should be corrected for clarity in test output/logs. ✏️ Proposed wording fix- // Migrated from case NonHyperShiftHOST-Author:dis-Medium-OCP-54887-The default channel should be corret
+ // Migrated from case NonHyperShiftHOST-Author:dis-Medium-OCP-54887-The default channel should be correct
...
- logger.Info("Deafault channel for version is correct", "version:", version, "channel:", channel)
+ logger.Info("Default channel for version is correct", "version:", version, "channel:", channel)Also applies to: 148-148 🤖 Prompt for AI Agents |
||
| g.It("The default channel should be correct", func() { | ||
| ctx := context.Background() | ||
| err := util.SkipIfHypershift(ctx, restCfg) | ||
| o.Expect(err).NotTo(o.HaveOccurred(), "Failed to determine if cluster is HyperShift") | ||
| err = util.SkipIfMicroshift(ctx, restCfg) | ||
| o.Expect(err).NotTo(o.HaveOccurred(), "Failed to determine if cluster is MicroShift") | ||
|
|
||
| g.By("Checking that the default channel matches the cluster version") | ||
| configClient, err := util.GetConfigClient(restCfg) | ||
| o.Expect(err).NotTo(o.HaveOccurred(), "Failed to create config client") | ||
| clusterversion, err := configClient.ConfigV1().ClusterVersions().Get(ctx, "version", metav1.GetOptions{}) | ||
| o.Expect(err).NotTo(o.HaveOccurred(), "Failed to get Clusterversion") | ||
|
|
||
| g.By("Extracting version details from ClusterVersion status") | ||
| o.Expect(clusterversion.Status.Desired.Version).NotTo(o.BeEmpty(), "ClusterVersion desired version should not be empty") | ||
| version := clusterversion.Status.Desired.Version | ||
| logger.Info("Cluster version detected", "version", version) | ||
|
|
||
| g.By("Verifying the cluster is using a signed build") | ||
| o.Expect(clusterversion.Status.History).NotTo(o.BeEmpty(), "ClusterVersion history should not be empty") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Refer to https://gitlab.cee.redhat.com/aosqe/v4-installer-autotest/-/blob/master/cases/TestCases/OCP-54887/default_channel_should_be_correct.py?ref_type=heads#L19-L21, shall we check the |
||
| currentUpdate := clusterversion.Status.History[0] | ||
| o.Expect(currentUpdate.Verified).To(o.BeTrue(), "Expected the cluster build to be signed and verified, but Verified is false. Version: %s, Image: %s", currentUpdate.Version, currentUpdate.Image) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this a new checkpoint for the test?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| logger.Info("Cluster build is verified", "version", currentUpdate.Version, "image", currentUpdate.Image, "verified", currentUpdate.Verified) | ||
|
|
||
| g.By("Validating default channel format matches stable-<major>.<minor>") | ||
| channel := clusterversion.Spec.Channel | ||
| o.Expect(channel).To(o.MatchRegexp(`^stable-\d+\.\d+$`), "Expected channel to match pattern 'stable-<major>.<minor>', but got %s", channel) | ||
|
|
||
| g.By("Verifying channel matches the cluster's major.minor version") | ||
| expectedChannelPrefix := util.GetExpectedChannelPrefix(version) | ||
| o.Expect(channel).To(o.Equal(expectedChannelPrefix), "Expected channel to be %s based on version %s, but got %s", expectedChannelPrefix, version, channel) | ||
| logger.Info("Deafault channel for version is correct", "version:", version, "channel:", channel) | ||
| }) | ||
| }) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it added unintentionally?