-
Notifications
You must be signed in to change notification settings - Fork 208
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
OCM-8679 | test: automated case id:72868 Separate the component route options when updating ingress #2157
base: master
Are you sure you want to change the base?
OCM-8679 | test: automated case id:72868 Separate the component route options when updating ingress #2157
Changes from 1 commit
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 |
---|---|---|
|
@@ -8,6 +8,7 @@ import ( | |
|
||
"github.com/openshift/rosa/tests/ci/labels" | ||
"github.com/openshift/rosa/tests/utils/common" | ||
|
||
"github.com/openshift/rosa/tests/utils/config" | ||
"github.com/openshift/rosa/tests/utils/exec/rosacli" | ||
) | ||
|
@@ -284,4 +285,83 @@ var _ = Describe("Edit default ingress", | |
Expect(expectLabel).To(BeElementOf(ingressRouteSelectors)) | ||
} | ||
}) | ||
It("can update ingress components (oauth, downloads, console) - [id:72868]", | ||
labels.Medium, | ||
labels.Runtime.Day2, | ||
func() { | ||
|
||
By("Record ingress default value") | ||
output, err := rosaClient.Ingress.ListIngress(clusterID) | ||
Expect(err).ToNot(HaveOccurred()) | ||
ingressList, err := rosaClient.Ingress.ReflectIngressList(output) | ||
Expect(err).ToNot(HaveOccurred()) | ||
defaultIngress := ingressList.Ingresses[0] | ||
|
||
By("Check edit ingress help message") | ||
output, err = rosaClient.Ingress.EditIngress(clusterID, "-h") | ||
Expect(err).ToNot(HaveOccurred()) | ||
Expect(output.String()).Should(ContainSubstring("--component-routes")) | ||
|
||
By("Edit ingress with --component-routes") | ||
componentRoutes := "oauth: hostname=oauth.hostname.com;tlsSecretRef=oauth-secret,downloads: hostname=downloads.hostname.com;tlsSecretRef=downloads-secret,console: hostname=console.hostname.com;tlsSecretRef=console-secret" | ||
output, err = rosaClient.Ingress.EditIngress(clusterID, | ||
defaultIngress.ID, | ||
"--component-routes", componentRoutes, | ||
) | ||
Expect(err).ToNot(HaveOccurred()) | ||
defer rosaClient.Ingress.EditIngress(clusterID, | ||
defaultIngress.ID, | ||
"--component-routes", "oauth: hostname=oauth.hostname.com;tlsSecretRef=oauth-secret,downloads: hostname=downloads.hostname.com;tlsSecretRef=downloads-secret,console: hostname=console.hostname.com;tlsSecretRef=console-secret", | ||
) | ||
|
||
By("List ingress to check") | ||
output, err = rosaClient.Ingress.ListIngress(clusterID) | ||
Expect(err).ToNot(HaveOccurred()) | ||
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. Here just checked the error is not happening when list the ingress, but it didn't check the edited value showing |
||
}) | ||
It("cannot update ingress components with incorrect syntax - [id:72868]", | ||
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. Combine the |
||
labels.Medium, | ||
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. For the negative cases, they should be another negative case. |
||
labels.Runtime.Day2, | ||
func() { | ||
By("Record ingress default value") | ||
output, err := rosaClient.Ingress.ListIngress(clusterID) | ||
Expect(err).ToNot(HaveOccurred()) | ||
ingressList, err := rosaClient.Ingress.ReflectIngressList(output) | ||
Expect(err).ToNot(HaveOccurred()) | ||
defaultIngress := ingressList.Ingresses[0] | ||
|
||
By("Edit ingress with --component-routes") | ||
componentRoutes := "oauth: hostname:custom1;tlsSecretRef=custom1,downloads: hostname=custom2;tlsSecretRef=custom2,console: hostname=custom3;tlsSecretRef=custom3" | ||
output, err = rosaClient.Ingress.EditIngress(clusterID, | ||
defaultIngress.ID, | ||
"--component-routes", componentRoutes, | ||
) | ||
Expect(err).To(HaveOccurred()) | ||
Expect(output.String()).Should(ContainSubstring("An error occurred whilst parsing the supplied component routes: only the name of the component should be followed by ':'")) | ||
By("List ingress to check") | ||
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. If last steps is expecting an error happen, no need to list the ingress for double checking |
||
output, err = rosaClient.Ingress.ListIngress(clusterID) | ||
Expect(err).ToNot(HaveOccurred()) | ||
}) | ||
It("cannot update ingress components with incorrect number of components - [id:72868]", | ||
labels.Medium, | ||
labels.Runtime.Day2, | ||
func() { | ||
By("Record ingress default value") | ||
output, err := rosaClient.Ingress.ListIngress(clusterID) | ||
Expect(err).ToNot(HaveOccurred()) | ||
ingressList, err := rosaClient.Ingress.ReflectIngressList(output) | ||
Expect(err).ToNot(HaveOccurred()) | ||
defaultIngress := ingressList.Ingresses[0] | ||
|
||
By("Edit ingress with --component-routes") | ||
componentRoutes := "oauth: hostname=custom1;tlsSecretRef=custom1" | ||
output, err = rosaClient.Ingress.EditIngress(clusterID, | ||
defaultIngress.ID, | ||
"--component-routes", componentRoutes, | ||
) | ||
Expect(err).To(HaveOccurred()) | ||
Expect(output.String()).Should(ContainSubstring("An error occurred whilst parsing the supplied component routes: the expected amount of component routes is 3, but 1 have been supplied")) | ||
By("List ingress to check") | ||
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. Same as above |
||
_, err = rosaClient.Ingress.ListIngress(clusterID) | ||
Expect(err).ToNot(HaveOccurred()) | ||
}) | ||
}) |
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.
Defer is used to recover the updated data, please not use hardcode but the recorded variable value