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 monitors+etp:local testcases #60

Merged
merged 1 commit into from
Dec 14, 2022

Conversation

rlobillo
Copy link
Contributor

Covers partially the epic https://issues.redhat.com/browse/OSASINFRA-2753

Two tests, one for amphora and another for ovn provider.

They create an UDP lb svc enabling openstack monitors and configuring ETP:Local and then checking that the existing lbMethod is successfully applied.

These test will be skipped for Kuryr NetworkType.

@openshift-ci openshift-ci bot requested review from gryf and luis5tb November 16, 2022 13:40
g.It(fmt.Sprintf("should apply lb-method on UDP %s LoadBalancer when an UDP svc with monitors and ETP:Local is created on Openshift", lbProviderUnderTest), func() {

g.By("Checking cluster configuration")
cloudProviderConfig, err := getConfig(oc.AdminKubeClient(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this be added on the beforeeach? All the test cases seems to fetch it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure! I will think about moving this to BeforeEach during the rebases as soon as #58 get merged

e2e.Logf("Pods accessed after 100 UDP requests:\n%v\n", results)
pods, err := oc.KubeClient().CoreV1().Pods(oc.Namespace()).List(context.Background(), metav1.ListOptions{})
o.Expect(err).NotTo(o.HaveOccurred())
//lbMethod can be something different to ROUND_ROBIN as monitors && ETP:Local are enabled on this test:
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to check something specific around the use of ETP:local and the Pods?
It seems only the lbMethods are being checked

Copy link
Contributor Author

Choose a reason for hiding this comment

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

mmm I don't see more checks to add here.

On line 209 we are checking that the spec is there, and we are checking also that the LbMethod different to ROUND_ROBIN is applied: In D/S CI, we are enabling monitors and setting SOURCE_IP LbMethod. Under these circunstances, a unique pod should be accesed. That is checked on line 335.

That will confirm that the ETP:Local is in place.

@rlobillo
Copy link
Contributor Author

/retest

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 2, 2022
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 7, 2022
@rlobillo rlobillo requested review from MaysaMacedo and removed request for gryf and luis5tb December 8, 2022 13:14
@rlobillo
Copy link
Contributor Author

rlobillo commented Dec 8, 2022

@dulek @MaysaMacedo PTAL, this is the next pair of testcases on the queue for UDP LB epic

@rlobillo
Copy link
Contributor Author

rlobillo commented Dec 9, 2022

/retest

Copy link
Contributor

@dulek dulek left a comment

Choose a reason for hiding this comment

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

/lgtm

Minor remarks inline, feel free to ignore them if you think they're not worth it.

Comment on lines +230 to +232
monitorDelay := 10
monitorTimeout := 20
monitorMaxRetries := 2
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if these shouldn't be constants somewhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's only used on the test so I prefer to have it defined at the top of the test.

Comment on lines +238 to +243
svc.SetAnnotations(map[string]string{
"loadbalancer.openstack.org/enable-health-monitor": "true",
"loadbalancer.openstack.org/health-monitor-delay": fmt.Sprintf("%d", monitorDelay),
"loadbalancer.openstack.org/health-monitor-timeout": fmt.Sprintf("%d", monitorTimeout),
"loadbalancer.openstack.org/health-monitor-max-retries": fmt.Sprintf("%d", monitorMaxRetries),
})
Copy link
Contributor

Choose a reason for hiding this comment

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

And this could probably be a helper function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for the moment it's only used once, and also I think this approach is more readable.

g.By("Checks from openshift perspective")
loadBalancerId := svc.GetAnnotations()["loadbalancer.openstack.org/load-balancer-id"]
o.Expect(loadBalancerId).ShouldNot(o.BeEmpty(), "load-balancer-id annotation missing")
o.Expect(svc.Status.LoadBalancer.Ingress).ShouldNot(o.BeEmpty(), "svc.Status.LoadBalancer.Ingress should not be empty")
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch! I'm removing it

Comment on lines +266 to +268
o.Expect(monitor.AdminStateUp).Should(o.BeTrue(), "Unexpected healthmonitor adminStateUp on Openstack LoadBalancer Pool: %q", pool.Name)
o.Expect(monitor.Delay).Should(o.Equal(monitorDelay), "Unexpected healthmonitor delay on Openstack LoadBalancer Pool: %q", pool.Name)
o.Expect(monitor.Timeout).Should(o.Equal(monitorTimeout), "Unexpected healthmonitor timeout on Openstack LoadBalancer Pool: %q", pool.Name)
o.Expect(monitor.MaxRetries).Should(o.Equal(monitorMaxRetries), "Unexpected healthmonitor MaxRetries on Openstack LoadBalancer Pool: %q", pool.Name)
Copy link
Contributor

Choose a reason for hiding this comment

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

You could probably test Type as well, but that's a bit tricky as it depends on OpenStack version. Probably not worth it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agree, I think that's internal implementatoin.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 13, 2022
Covers partially the epic https://issues.redhat.com/browse/OSASINFRA-2753

two equivalent test, one for amphora and another for ovn provider.

They create an UDP lb svc enabling openstack monitors and configuring ETP:Local
and then checking that the existing lbMethod is successfully applied.

These test will be skipped for Kuryr NetworkType.
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Dec 13, 2022
@MaysaMacedo
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 13, 2022
@rlobillo
Copy link
Contributor Author

/test test

@rlobillo
Copy link
Contributor Author

/test verify
/test images
/test build

@dulek
Copy link
Contributor

dulek commented Dec 14, 2022

/approve
/override ci/prow/test-kuryr

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 14, 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 14, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 14, 2022

@dulek: Overrode contexts on behalf of dulek: ci/prow/test-kuryr

In response to this:

/approve
/override ci/prow/test-kuryr

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

/override ci/prow/test-kuryr

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 14, 2022

@rlobillo: Overrode contexts on behalf of rlobillo: ci/prow/test-kuryr

In response to this:

/override ci/prow/test-kuryr

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.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 14, 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.

@openshift-merge-robot openshift-merge-robot merged commit 2ebdb67 into openshift:main Dec 14, 2022
@rlobillo
Copy link
Contributor Author

/cherry-pick release-4.12

@openshift-cherrypick-robot

@rlobillo: #60 failed to apply on top of branch "release-4.12":

Applying: Add monitors+etp:local testcases
Using index info to reconstruct a base tree...
M	test/extended/openstack/loadbalancers.go
M	test/extended/util/annotate/generated/zz_generated.annotations.go
Falling back to patching base and 3-way merge...
Auto-merging test/extended/util/annotate/generated/zz_generated.annotations.go
Auto-merging test/extended/openstack/loadbalancers.go
CONFLICT (content): Merge conflict in test/extended/openstack/loadbalancers.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Add monitors+etp:local testcases
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

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

/cherry-pick release-4.12

@openshift-cherrypick-robot

@rlobillo: new pull request created: #67

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 etp_local 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