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

Add udp-lb testcase for ovn provider #58

Merged
merged 1 commit into from
Dec 1, 2022

Conversation

rlobillo
Copy link
Contributor

@rlobillo rlobillo commented Nov 4, 2022

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.

@rlobillo
Copy link
Contributor Author

rlobillo commented Nov 4, 2022

/retest

3 similar comments
@rlobillo
Copy link
Contributor Author

rlobillo commented Nov 7, 2022

/retest

@rlobillo
Copy link
Contributor Author

rlobillo commented Nov 8, 2022

/retest

@rlobillo
Copy link
Contributor Author

rlobillo commented Nov 8, 2022

/retest

@MaysaMacedo
Copy link
Contributor

do we expect the configuration to be manually updated before running the test?
Or should the test update the configuration to use the OVN driver?

@rlobillo
Copy link
Contributor Author

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

@rlobillo rlobillo force-pushed the udplb_ovn branch 2 times, most recently from 20af315 to 04c2b6d Compare November 16, 2022 13:02
@rlobillo
Copy link
Contributor Author

/retest

2 similar comments
@MaysaMacedo
Copy link
Contributor

/retest

@MaysaMacedo
Copy link
Contributor

/retest

@MaysaMacedo
Copy link
Contributor

I opened a ticket to vexxhost about the issue seen here

@MaysaMacedo
Copy link
Contributor

/retest

@MaysaMacedo
Copy link
Contributor

/test test

Copy link
Contributor

@MaysaMacedo MaysaMacedo left a 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 {
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

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).

Copy link
Contributor Author

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)
Copy link
Contributor

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:"

Copy link
Contributor Author

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",
Copy link
Contributor

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")

Copy link
Contributor Author

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) {
Copy link
Contributor

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")

Copy link
Contributor Author

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"]
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

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

Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto before line 106

Copy link
Contributor Author

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?

Copy link
Contributor

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.

@MaysaMacedo
Copy link
Contributor

/retest
/lgtm
/hold for CI result

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 30, 2022
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 30, 2022
@rlobillo
Copy link
Contributor Author

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 30, 2022

@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.

@MaysaMacedo
Copy link
Contributor

/hold cancel
I will leave the approve for someone else. Maybe @dulek?

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 1, 2022
@dulek
Copy link
Contributor

dulek commented Dec 1, 2022

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 1, 2022

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 1, 2022
@openshift-merge-robot openshift-merge-robot merged commit d8d1422 into openshift:main Dec 1, 2022
@rlobillo
Copy link
Contributor Author

rlobillo commented Dec 2, 2022

/cherry-pick release-4.12

@openshift-cherrypick-robot

@rlobillo: new pull request created: #62

In response to this:

/cherry-pick release-4.12

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.

@rlobillo rlobillo deleted the udplb_ovn branch March 14, 2023 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants