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

cnf ran:siteconfig-operator:ready-for-final-review: adding 'ocp-75374-75376' test cases #196

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mpmaruthu
Copy link
Collaborator

@mpmaruthu mpmaruthu commented Sep 13, 2024

@mpmaruthu mpmaruthu self-assigned this Sep 13, 2024
@mpmaruthu mpmaruthu force-pushed the cnf-ocp-75376 branch 2 times, most recently from 6388573 to 6db3323 Compare September 19, 2024 17:01
Comment on lines 38 to 41
// SNO represents spoke cluster type as single-node openshift (SNO) cluster.
SNO = "sno"
// Standard represents spoke cluster type as multi-node openshift (MNO) cluster.
Standard = "standard"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make the cluster type into a separate type like what HubOperatorName does?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, updated. Thanks!

return ranparam.SNO, nil
}

return ranparam.Standard, fmt.Errorf("could not determine spoke cluster type")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the error case, could you make it return "" instead of standard?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, updated. Thanks!

Comment on lines 103 to 132
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")

// Test step 2 expected results validation.
By("checking the infra env manifests exists on hub")
_, err = assisted.PullInfraEnvInstall(HubAPIClient, RANConfig.Spoke1Name, RANConfig.Spoke1Name)
Expect(err).ToNot(HaveOccurred(), "Failed to find spoke infra env manifests")

By("checking the bare metal host manifests exists on hub")
_, err = bmh.Pull(HubAPIClient, RANConfig.Spoke1Name, RANConfig.Spoke1Name)
Expect(err).ToNot(HaveOccurred(), "Failed to find spoke bmh manifests")

By("checking the cluster deployment manifests exists on hub")
_, err = hive.PullClusterDeployment(HubAPIClient, RANConfig.Spoke1Name, RANConfig.Spoke1Name)
Expect(err).ToNot(HaveOccurred(), "Failed to find spoke cluster deployment manifests")

By("checking the NM state config manifests exists on hub")
nmStateConfigList, err = assisted.ListNmStateConfigs(HubAPIClient, RANConfig.Spoke1Name)
Expect(err).ToNot(HaveOccurred(), "Failed to list NM state config manifests")
Expect(nmStateConfigList).ToNot(BeEmpty(), "Failed to find NM state config manifests")

By("checking the klusterlet addon config manifests exists on hub")
_, err = ocm.PullKAC(HubAPIClient, RANConfig.Spoke1Name, RANConfig.Spoke1Name)
Expect(err).ToNot(HaveOccurred(), "Failed to find spoke kac manifests")

By("checking the agent cluster install manifests exists on hub")
_, err = assisted.PullAgentClusterInstall(HubAPIClient, RANConfig.Spoke1Name, RANConfig.Spoke1Name)
Expect(err).ToNot(HaveOccurred(), "Failed to find spoke agent cluster install manifests")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these the same between the test cases? maybe they should go into an AfterEach

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, updated. Thanks!

Comment on lines 98 to 125
By("checking the infra env manifests removed on hub")
_, err = assisted.PullInfraEnvInstall(HubAPIClient, RANConfig.Spoke1Name, RANConfig.Spoke1Name)
Expect(err).To(HaveOccurred(), "Found spoke infra env manifests but expected to be removed")

By("checking the bare metal host manifests removed on hub")
_, err = bmh.Pull(HubAPIClient, RANConfig.Spoke1Name, RANConfig.Spoke1Name)
Expect(err).To(HaveOccurred(), "Found spoke bmh manifests but expected to be removed")

By("checking the cluster deployment manifests removed on hub")
_, err = hive.PullClusterDeployment(HubAPIClient, RANConfig.Spoke1Name, RANConfig.Spoke1Name)
Expect(err).To(HaveOccurred(), "Found spoke cluster deployment manifests but expected to be removed")

By("checking the NM state config manifests removed on hub")
nmStateConfigList, err := assisted.ListNmStateConfigs(HubAPIClient, RANConfig.Spoke1Name)
Expect(err).ToNot(HaveOccurred(), "Failed to list NM state config manifests")
Expect(nmStateConfigList).To(BeEmpty(), "Found spoke NM state config manifests but expected to be removed")

By("checking the klusterlet addon config manifests removed on hub")
_, err = ocm.PullKAC(HubAPIClient, RANConfig.Spoke1Name, RANConfig.Spoke1Name)
Expect(err).To(HaveOccurred(), "Found spoke kac manifests but expected to be removed")

By("checking the agent cluster install manifests removed on hub")
_, err = assisted.PullAgentClusterInstall(HubAPIClient, RANConfig.Spoke1Name, RANConfig.Spoke1Name)
Expect(err).To(HaveOccurred(), "Found spoke ACI manifests but expected to be removed")

By("verifying installed spoke cluster should still be functional")
_, err = version.GetOCPVersion(Spoke1APIClient)
Expect(err).ToNot(HaveOccurred(), "Failed to get OCP version from spoke and verify spoke cluster access")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if these are the same between the two cases, they could be moved to a function at the end of this file

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay,updated. Thanks!

@mpmaruthu mpmaruthu changed the title cnf ran:siteconfig-operator:ready-for-review: adding ocp-75376 test case cnf ran:siteconfig-operator:ready-for-final-review: adding 'ocp-75374-75376' test case Sep 20, 2024
@mpmaruthu mpmaruthu changed the title cnf ran:siteconfig-operator:ready-for-final-review: adding 'ocp-75374-75376' test case cnf ran:siteconfig-operator:ready-for-final-review: adding 'ocp-75374-75376' test cases Sep 20, 2024
glog.V(ranparam.LogLevel).Infof("podList[0] matching podLabelSelector is '%v'",
podList[0].Definition.Name)

return podList[0].Definition.Name, err
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will panic if no pods exist with the label or the list function returns an error


// ValidateAISpokeClusterInstallCRsRemoved verifies AI spoke cluster install CRs removed and spoke cluster accessible.
func ValidateAISpokeClusterInstallCRsRemoved() {
By("checking the infra env manifests removed on hub", func() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for consistency, could you please switch this PR to use the form of By without the func() {}?

Comment on lines +91 to +93
Expect(err).ToNot(HaveOccurred(), "Failed to find default AI cluster level templates config map")

if err == nil {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since you assert the error didn't occur, it is always nil so the if statement is unnecessary. Is it a test failure if the cm does not exist?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants