-
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 monitors+etp:local testcases #60
Conversation
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(), |
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 this be added on the beforeeach? All the test cases seems to fetch it
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.
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: |
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.
do we need to check something specific around the use of ETP:local and the Pods?
It seems only the lbMethods are being checked
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.
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.
/retest |
@dulek @MaysaMacedo PTAL, this is the next pair of testcases on the queue for UDP LB epic |
/retest |
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.
/lgtm
Minor remarks inline, feel free to ignore them if you think they're not worth it.
monitorDelay := 10 | ||
monitorTimeout := 20 | ||
monitorMaxRetries := 2 |
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 wonder if these shouldn't be constants somewhere.
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's only used on the test so I prefer to have it defined at the top of the test.
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), | ||
}) |
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.
And this could probably be a helper function.
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 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") |
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 is a bit redundant, it's checked by WaitForLoadBalancer: https://github.com/openshift/kubernetes/blob/020cf2d7aa2011147a89c9bd4063c8237b71a08f/test/e2e/framework/service/jig.go#L581-L586
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.
good catch! I'm removing it
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) |
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 could probably test Type
as well, but that's a bit tricky as it depends on OpenStack version. Probably not worth it.
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.
agree, I think that's internal implementatoin.
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.
/lgtm |
/test test |
/test verify |
/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 |
@dulek: Overrode contexts on behalf of dulek: ci/prow/test-kuryr 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. |
/override ci/prow/test-kuryr |
@rlobillo: Overrode contexts on behalf of rlobillo: ci/prow/test-kuryr 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. |
@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. |
/cherry-pick release-4.12 |
@rlobillo: #60 failed to apply on top of branch "release-4.12":
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. |
/cherry-pick release-4.12 |
@rlobillo: new pull request created: #67 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
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.