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

E2E test for MC ACNP copy-span #3435

Merged
merged 1 commit into from
Mar 25, 2022
Merged

Conversation

Dyanngg
Copy link
Contributor

@Dyanngg Dyanngg commented Mar 11, 2022

PR is based on #3424 and #3363. Only the last commit is relevant to this PR.

@Dyanngg Dyanngg added the area/multi-cluster Issues or PRs related to multi cluster. label Mar 11, 2022
@Dyanngg Dyanngg added this to the Antrea v1.6 release milestone Mar 11, 2022
@Dyanngg
Copy link
Contributor Author

Dyanngg commented Mar 11, 2022

/test-multicluster-e2e

@codecov-commenter
Copy link

codecov-commenter commented Mar 11, 2022

Codecov Report

Merging #3435 (33af3b3) into main (2dcc257) will decrease coverage by 11.42%.
The diff coverage is n/a.

❗ Current head 33af3b3 differs from pull request most recent head 0011cb8. Consider uploading reports for the commit 0011cb8 to get more accurate results

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #3435       +/-   ##
===========================================
- Coverage   65.51%   54.08%   -11.43%     
===========================================
  Files         277      247       -30     
  Lines       27500    35027     +7527     
===========================================
+ Hits        18016    18945      +929     
- Misses       7567    14295     +6728     
+ Partials     1917     1787      -130     
Flag Coverage Δ
e2e-tests 54.08% <ø> (?)
kind-e2e-tests ?
unit-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/controller/egress/controller.go 0.00% <0.00%> (-88.45%) ⬇️
pkg/controller/networkpolicy/endpoint_querier.go 4.58% <0.00%> (-86.85%) ⬇️
pkg/controller/ipam/validate.go 0.00% <0.00%> (-82.26%) ⬇️
pkg/agent/util/iptables/lock.go 0.00% <0.00%> (-81.82%) ⬇️
pkg/controller/ipam/antrea_ipam_controller.go 0.00% <0.00%> (-80.29%) ⬇️
pkg/agent/cniserver/ipam/antrea_ipam_controller.go 0.00% <0.00%> (-80.00%) ⬇️
pkg/controller/externalippool/validate.go 0.00% <0.00%> (-76.20%) ⬇️
pkg/agent/cniserver/ipam/antrea_ipam.go 3.62% <0.00%> (-76.17%) ⬇️
pkg/cni/client.go 0.00% <0.00%> (-75.52%) ⬇️
.../registry/networkpolicy/clustergroupmember/rest.go 11.11% <0.00%> (-73.21%) ⬇️
... and 267 more

@Dyanngg Dyanngg force-pushed the mcs-copy-span-e2e branch from d2a63f4 to 0d9e3ff Compare March 11, 2022 01:10
@Dyanngg
Copy link
Contributor Author

Dyanngg commented Mar 11, 2022

/test-multicluster-e2e

multicluster/test/e2e/mcs_antreapolicy_test.go Outdated Show resolved Hide resolved
multicluster/test/e2e/mcs_antreapolicy_test.go Outdated Show resolved Hide resolved
multicluster/test/e2e/mcs_antreapolicy_test.go Outdated Show resolved Hide resolved
multicluster/test/e2e/mcs_antreapolicy_test.go Outdated Show resolved Hide resolved
@Dyanngg Dyanngg force-pushed the mcs-copy-span-e2e branch from 0d9e3ff to 1ceeb94 Compare March 11, 2022 04:41
@Dyanngg
Copy link
Contributor Author

Dyanngg commented Mar 11, 2022

/test-multicluster-e2e

@Dyanngg Dyanngg force-pushed the mcs-copy-span-e2e branch from 1ceeb94 to 251d2fa Compare March 11, 2022 05:08
@Dyanngg
Copy link
Contributor Author

Dyanngg commented Mar 11, 2022

/test-multicluster-e2e

@Dyanngg Dyanngg requested a review from luolanzone March 11, 2022 18:55
@Dyanngg
Copy link
Contributor Author

Dyanngg commented Mar 11, 2022

Multi-cluster e2e already passing for the copy-span feature.

@Dyanngg
Copy link
Contributor Author

Dyanngg commented Mar 11, 2022

/test-all

luolanzone
luolanzone previously approved these changes Mar 15, 2022
Copy link
Contributor

@luolanzone luolanzone left a comment

Choose a reason for hiding this comment

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

LGTM overall, two nits:

multicluster/test/e2e/fixtures.go Outdated Show resolved Hide resolved
multicluster/test/e2e/antreapolicy_test.go Outdated Show resolved Hide resolved
@Dyanngg Dyanngg force-pushed the mcs-copy-span-e2e branch 2 times, most recently from 4fb0587 to f53058d Compare March 15, 2022 21:16
@Dyanngg
Copy link
Contributor Author

Dyanngg commented Mar 15, 2022

Rebased and resolved merge conflicts /test-all /test-multicluster-e2e

@Dyanngg Dyanngg force-pushed the mcs-copy-span-e2e branch 2 times, most recently from 40781ae to ea5e639 Compare March 20, 2022 03:56
@Dyanngg
Copy link
Contributor Author

Dyanngg commented Mar 20, 2022

Rebased and resolved merge conflicts /test-all /test-multicluster-e2e

@Dyanngg Dyanngg force-pushed the mcs-copy-span-e2e branch from ea5e639 to 1d6f264 Compare March 20, 2022 04:44
@Dyanngg
Copy link
Contributor Author

Dyanngg commented Mar 20, 2022

/test-multicluster-e2e

@Dyanngg Dyanngg force-pushed the mcs-copy-span-e2e branch from 1d6f264 to 32ee56d Compare March 22, 2022 21:52
@luolanzone luolanzone added the area/test/e2e Issues or PRs related to Antrea specific end-to-end testing. label Mar 23, 2022
luolanzone
luolanzone previously approved these changes Mar 23, 2022
_, wrong, _ := step.Reachability.Summary()
if wrong != 0 {
t.Errorf("Failure in cluster %s -- %d wrong results", clusterName, wrong)
reachability.PrintSummary(true, true, true)
Copy link
Contributor

@luolanzone luolanzone Mar 23, 2022

Choose a reason for hiding this comment

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

not introduced in this PR, but I see all callers of reachability.PrintSummary() are using (true, true, true), maybe we can remove all three parameters. do you think if this can be enhanced in #3286 by enhao?

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. /cc @enhaocui for awareness.

Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

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

LGTM, one question

match: Self
- podSelector:
matchLabels:
k8s-app: kube-dns
Copy link
Member

Choose a reason for hiding this comment

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

Why it must allow kube-dns to access the test Pods?

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 does not need to allow kube-dns for the test to pass. I am merely trying to align the yaml with https://github.com/antrea-io/antrea/blob/main/docs/antrea-network-policy.md#acnp-for-strict-namespace-isolation

Copy link
Member

Choose a reason for hiding this comment

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

But I didn't see this in that doc. And the rule should only make sense if it's egress rule, no reason to allow kube-dns accessing all Pods.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But I didn't see this in that doc.

Sorry I was meant to say in here #3512. I've created a PR to update the sample yamls of Antrea-native policies.

And the rule should only make sense if it's egress rule, no reason to allow kube-dns accessing all Pods.

I was thinking in the lines of the DNS return packets need to be allowed. But I guess your point is that does not warrant an ingress rule since there's going to be some bypass flow. In that case let me just remove this section from ingress then.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, the policy is stateful, DNS return packets will be allowed if the requests are allowed regardless of the existence of this rule. The rule will only apply to packets in request direction.

@Dyanngg
Copy link
Contributor Author

Dyanngg commented Mar 25, 2022

/test-all /test-multicluster-e2e

@tnqn
Copy link
Member

tnqn commented Mar 25, 2022

@Dyanngg could you rebase the PR and check if #3435 (comment) makes sense?

@luolanzone
Copy link
Contributor

/test-all /test-multicluster-e2e

@Dyanngg Dyanngg force-pushed the mcs-copy-span-e2e branch from 57a340a to f1c1dfa Compare March 25, 2022 03:47
@Dyanngg
Copy link
Contributor Author

Dyanngg commented Mar 25, 2022

/test-all /test-multicluster-e2e

@tnqn tnqn merged commit 7599ffb into antrea-io:main Mar 25, 2022
@Dyanngg Dyanngg deleted the mcs-copy-span-e2e branch March 25, 2022 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/multi-cluster Issues or PRs related to multi cluster. area/test/e2e Issues or PRs related to Antrea specific end-to-end testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants