-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add udp-lb testcase for ovn provider #58
Conversation
/retest |
3 similar comments
/retest |
/retest |
/retest |
do we expect the configuration to be manually updated before running the test? |
Hello @MaysaMacedo Yes, we expect the configuration to be manually updated before running the test. The configuration change takes around 30-40 minutes and it can affect the run of the rest of the tests. In D/S CI we are doing the cloud-provider-config changes and running the openstack-tests sequentially: https://code.engineering.redhat.com/gerrit/gitweb?p=rhos-qe-jenkins.git;hb=refs%2Fchanges%2F16%2F434216%2F4;f=jobs%2Fdefaults%2Fstages%2Fir_openshift_udplb_tests_run.groovy.inc |
20af315
to
04c2b6d
Compare
/retest |
2 similar comments
/retest |
/retest |
I opened a ticket to vexxhost about the issue seen here |
/retest |
/test test |
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.
It looks good! There are just some minor remarks:
o.Expect(err).NotTo(o.HaveOccurred()) | ||
o.Expect(fip.FloatingIP).Should(o.Equal(svcIp), "Unexpected floatingIp in the Openstack LoadBalancer") | ||
o.Expect(lb.Pools).Should(o.HaveLen(1), "Unexpected number of pools on Openstack LoadBalancer %q", lb.Name) | ||
for _, i := range availableLbProvidersUnderTests { |
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.
instead of i
, could it be lbProviderUnderTest
so we avoid the following line?
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.
I don't know why but your proposal did not work. I tried that, but if I don't set the variable later, the loop is not working as expected. I found this approach on origin repo, for example: https://github.com/openshift/origin/blob/master/test/extended/apiserver/apply.go#L57
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.
Instead of looping like this shouldn't we just check the LB provider that's configured and then when LB is created in Octavia checking if it has correct provider?
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.
Hi @dulek
The intention is to have separated tests per provider so we can track if the feature is working with Amphora and/or OVN provider at a glance.
That's very useful for our reporting tool (ReportPortal) and conceptually I think they're different tests because they're testing different things. What do you think?
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.
They're testing different providers really. But I can't argue with the concept of a separate test if you need it like this for your tools. The loop and skip just feels a bit weird here.
Do you need both tests to appear in every result set, even if skipped? If so, I guess for
loop is the way to go. Otherwise you could check LB provider before g.It(fmt.Sprintf("should create an UDP %s LoadBalancer when an UDP svc with type:LoadBalancer is created on Openshift", lbProviderUnderTest)
.
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.
Thanks! Done
lbProvider, err := getClusterLoadBalancerSetting("lb-provider", cloudProviderConfig) | ||
o.Expect(err).NotTo(o.HaveOccurred()) | ||
if lbProvider != strings.ToLower(lbProviderUnderTest) { | ||
e2eskipper.Skipf("Test not applicable for LoadBalancer provider different than %s: %q", lbProviderUnderTest, lbProvider) |
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.
might be good to add "cluster is configured with:"
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.
Done
labels := map[string]string{"app": "udp-lb-default-dep"} | ||
depName := "udp-lb-default-dep" | ||
svcName := "udp-lb-default-svc" | ||
testDeployment := e2edeployment.NewDeployment(depName, 2, labels, "udp-test", |
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.
it would be good to add a step of g.By("Creating deployment")
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.
Done
|
||
jig := e2eservice.NewTestJig(clientSet, oc.Namespace(), svcName) | ||
jig.Labels = labels | ||
svc, err := jig.CreateLoadBalancerService(5*time.Minute, func(svc *v1.Service) { |
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.
it would be good to add a step of g.By("Creating Load-Balancer")
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.
Done
g.By("Checks from openshift perspective") | ||
o.Expect(svc.GetAnnotations()["loadbalancer.openstack.org/load-balancer-id"]).ShouldNot(o.BeEmpty(), | ||
"load-balancer-id annotation missing") | ||
loadBalancerId := svc.GetAnnotations()["loadbalancer.openstack.org/load-balancer-id"] |
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.
can this be defined before line 103 and then use the variable on the expect check?
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.
I need to know if the key is present before assigning it, right?
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.
You'll get empty string if it's not assigned, so it's safe to just save it into the var and then do the checks: https://go.dev/play/p/hP_VtvL_K8t
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.
Thanks! Done
o.Expect(err).NotTo(o.HaveOccurred()) | ||
o.Expect(lb.Provider).Should(o.Equal(strings.ToLower(lbProviderUnderTest)), "Unexpected provider in the Openstack LoadBalancer") | ||
|
||
svcIp := svc.Status.LoadBalancer.Ingress[0].IP |
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.
ditto before line 106
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.
I need to know if the key is present before assigning it, right?
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.
Well, the string will be empty in worst case so no problem there, but you should check for length of the Ingress array, otherwise if it's empty, you'll end up with some golang panic here.
/retest |
/retest |
@rlobillo: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/hold cancel |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dulek The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/cherry-pick release-4.12 |
@rlobillo: new pull request created: #62 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Covers partially the epic https://issues.redhat.com/browse/OSASINFRA-2753
This test creates an UDP lb when OVN provider is configured on the cluster and checks the created Openstack resources. It also sends 100 requests to the LoadBalancer Service and analyze the pods' responses so that the e2e functionality is verified.
This test will be skipped for Kuryr NetworkType and if cloudProviderConfig is configuring a different lb-provider than OVN.