-
Notifications
You must be signed in to change notification settings - Fork 26
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
base: main
Are you sure you want to change the base?
Conversation
6388573
to
6db3323
Compare
// 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" |
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.
Could you make the cluster type into a separate type like what HubOperatorName does?
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.
Okay, updated. Thanks!
return ranparam.SNO, nil | ||
} | ||
|
||
return ranparam.Standard, fmt.Errorf("could not determine spoke cluster type") |
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.
for the error case, could you make it return ""
instead of standard?
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.
Okay, updated. Thanks!
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") |
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.
are these the same between the test cases? maybe they should go into an AfterEach
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.
Okay, updated. Thanks!
6db3323
to
6c94c95
Compare
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") |
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.
if these are the same between the two cases, they could be moved to a function at the end of this file
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.
Okay,updated. Thanks!
6c94c95
to
165e3a7
Compare
165e3a7
to
adfa642
Compare
glog.V(ranparam.LogLevel).Infof("podList[0] matching podLabelSelector is '%v'", | ||
podList[0].Definition.Name) | ||
|
||
return podList[0].Definition.Name, err |
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.
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() { |
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.
for consistency, could you please switch this PR to use the form of By
without the func() {}
?
Expect(err).ToNot(HaveOccurred(), "Failed to find default AI cluster level templates config map") | ||
|
||
if err == nil { |
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.
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?
@mcornea , @klaskosk , Please review this PR when you have a time.
cc: @yliu127 , @dgonyier
Thanks.
/Peri M
Adding siteconfig-operator test case - OCP-75374
Adding siteconfig-operator test case - OCP-75376
Sample test configuration for your reference:
http://registry.kni-qe-0.lab.eng.rdu2.redhat.com:3000/kni-qe/ztp-site-configs/src/8549392f6abc0f776a4d35e74e13d4e40cdb11e2/siteconfig/ztp-siteconfigoperator-test/detach-ai-sno/kustomization.yaml#L4
Manual test logs:-
Test case 1: https://docs.google.com/document/d/1ihBMjxsZmi2RRX90f5a--vmqzb0hDUxWQIlK4t8Wugk/edit?usp=sharing
Test case 2: https://docs.google.com/document/d/1FsTuWvS0UGaCujsfy5UQRJIlU69T2TdbGJ6Jt6OFANA/edit?usp=sharing