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 antctl check installation command to conduct connectivity checks (#6133) #6133

Merged
merged 12 commits into from
Apr 29, 2024

Conversation

kanha-gupta
Copy link
Contributor

@kanha-gupta kanha-gupta commented Mar 22, 2024

Ref #6061
This PR introduces new tests for Antrea (Post installation connectivity tests) using antctl test command. Following are the functionalities :

  • Framework to conduct connectivity tests is created
  • Currently supports Pod to pod connectivity tests within same nodes, different nodes
  • Also supports testing internet connectivity

Github workflow is also updated accordingly

Signed-off-by: Kanha gupta <kanhag4163@gmail.com>

Enable Post installation Connectivity tests

Signed-off-by: Kanha gupta <kanhag4163@gmail.com>

Enable Post installation Connectivity tests

Signed-off-by: Kanha gupta <kanhag4163@gmail.com>

Enable Post installation Connectivity tests

Signed-off-by: Kanha gupta <kanhag4163@gmail.com>

Enable Post installation Connectivity tests

Signed-off-by: Kanha gupta <kanhag4163@gmail.com>

Enable Post installation Connectivity tests

Signed-off-by: Kanha gupta <kanhag4163@gmail.com>

Pod to pod working, same and different nodes and Internet connectivity
…ests

Signed-off-by: Kanha gupta <kanhag4163@gmail.com>
Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

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

some initial comments

.github/workflows/kind.yml Outdated Show resolved Hide resolved
.github/workflows/kind.yml Outdated Show resolved Hide resolved
pkg/antctl/raw/test/client.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/client.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/command.go Outdated Show resolved Hide resolved
Signed-off-by: Kanha gupta <kanhag4163@gmail.com>

Initial review changes

Signed-off-by: Kanha gupta <kanhag4163@gmail.com>
@kanha-gupta
Copy link
Contributor Author

Hi @antoninbas Thank you for the review. I have made changes and it is visible in the new commit I've made.
Thank you

pkg/antctl/raw/test/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/command.go Outdated Show resolved Hide resolved
Signed-off-by: Kanha gupta <kanhag4163@gmail.com>
@kanha-gupta
Copy link
Contributor Author

@antoninbas Thanks for the review, I have made all the changes and The examples of randomly generated namespace output is "antrea-test-gst75", "antrea-test-i9ubk" etc.
Thank you

pkg/antctl/antctl.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/client.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/client.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/client.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/client.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/exec.go Outdated Show resolved Hide resolved
Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

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

Having think about it some more, I think the command could look like this: antctl check installation. When you address #6153, you should use the same command group (antctl check), and maybe that command should be antctl check pre-installation or antctl check cluster.

pkg/antctl/raw/test/command.go Outdated Show resolved Hide resolved
pkg/antctl/antctl.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/command.go Outdated Show resolved Hide resolved
@kanha-gupta
Copy link
Contributor Author

kanha-gupta commented Mar 27, 2024

Hi mentors, Thanks for the review and I've made changes and It is visible in the new commit I've made.
The raw/test directory contains go files directly at this point and I wanted to know if its a good practice to refactor the structure in this PR only or refactor it while adding support for preinstallation checks since its go files will need separation under raw/test directory
Thank you

Signed-off-by: Kanha gupta <kanhag4163@gmail.com>
.github/workflows/kind.yml Outdated Show resolved Hide resolved
.github/workflows/kind.yml Outdated Show resolved Hide resolved
.github/workflows/kind.yml Outdated Show resolved Hide resolved
pkg/antctl/antctl.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/client.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/client.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/client.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/client.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/client.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/test/command.go Outdated Show resolved Hide resolved
Signed-off-by: Kanha gupta <kanhag4163@gmail.com>
@kanha-gupta
Copy link
Contributor Author

Hey mentors, I have did all the changes.
Test files are yet to be implemented in this PR and I will implement it after the framework is finalised so as to prevent confusion.
Thank you

pkg/antctl/raw/check/client.go Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/test_PodToInternet.go Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/test_PodToInternet.go Outdated Show resolved Hide resolved
@kanha-gupta
Copy link
Contributor Author

Hey mentors, I have made the changes in latest commit. Please review :)

Signed-off-by: Kanha gupta <kanhag4163@gmail.com>
pkg/antctl/raw/check/client.go Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/command.go Outdated Show resolved Hide resolved
Signed-off-by: Kanha gupta <kanhag4163@gmail.com>
pkg/antctl/raw/check/installation/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/test_podtopod.go Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/command.go Show resolved Hide resolved
@kanha-gupta
Copy link
Contributor Author

Hey mentors, changes have been pushed in the latest commit :)

pkg/antctl/raw/check/installation/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/test_podtointernet.go Outdated Show resolved Hide resolved
Signed-off-by: Kanha gupta <kanhag4163@gmail.com>
@kanha-gupta
Copy link
Contributor Author

Hey mentors, Changes have been pushed in the commit :)

pkg/antctl/raw/check/installation/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/command.go Outdated Show resolved Hide resolved
@kanha-gupta
Copy link
Contributor Author

Hey mentors, changes have been pushed :)

pkg/antctl/raw/check/installation/command.go Outdated Show resolved Hide resolved
.github/workflows/kind.yml Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/command.go Show resolved Hide resolved
pkg/antctl/raw/check/installation/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/command.go Show resolved Hide resolved
pkg/antctl/raw/check/installation/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/check/installation/test_podtointernet.go Outdated Show resolved Hide resolved
Signed-off-by: Kanha gupta <kanhag4163@gmail.com>
@kanha-gupta
Copy link
Contributor Author

Hey mentors, changes have been pushed.
There are 2 comments left to discuss from previous review
Thank you :)

Signed-off-by: Kanha gupta <kanhag4163@gmail.com>
@kanha-gupta
Copy link
Contributor Author

Hey mentors, Changes are pushed :)

Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

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

LGTM, @tnqn @luolanzone do you want to take another look?

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

Tested in a cluster which I was reproducing service issue, connecting to google.com failed as expected, but it should be related to DNS, maybe we could differentiate Connection timeout and DNS resolution timeout later.

[kind-kind] Test starting....
[kind-kind] Creating Namespace antrea-test-729be for post installation tests...
[kind-kind] Deploying echo-same-node Service echo-same-node...
[kind-kind] Deploying client Deployment test-client...
[kind-kind] Deploying echo-other-node Service echo-other-node...
[kind-kind] Waiting for Deployment test-client to become ready...
[kind-kind] Deployment test-client is ready.
[kind-kind] Waiting for Deployment echo-same-node to become ready...
[kind-kind] Deployment echo-same-node is ready.
[kind-kind] Waiting for Deployment echo-other-node to become ready...
[kind-kind] Deployment echo-other-node is ready.
[kind-kind] Deployment is validated successfully
[kind-kind] -------------------------------------------------------------------------------------------
[kind-kind] Running test: pod-to-pod-internode-connectivity
[kind-kind] -------------------------------------------------------------------------------------------
[kind-kind] Validating from Pod antrea-test-729be/test-client-5448f7d5f6-dplnl to Pod antrea-test-729be/echo-other-node-64c4f7664-csrw8 at IP 10.244.2.4...
[kind-kind] client Pod test-client-5448f7d5f6-dplnl was able to communicate with echo Pod echo-other-node-64c4f7664-csrw8 (10.244.2.4)
[kind-kind] -------------------------------------------------------------------------------------------
[kind-kind] Test pod-to-pod-internode-connectivity passed
[kind-kind] -------------------------------------------------------------------------------------------
[kind-kind] -------------------------------------------------------------------------------------------
[kind-kind] Running test: pod-to-pod-intranode-connectivity
[kind-kind] -------------------------------------------------------------------------------------------
[kind-kind] Validating from Pod antrea-test-729be/test-client-5448f7d5f6-dplnl to Pod antrea-test-729be/echo-same-node-67dfc97d4b-wdqwh at IP 10.244.1.3...
[kind-kind] client Pod test-client-5448f7d5f6-dplnl was able to communicate with echo Pod echo-same-node-67dfc97d4b-wdqwh (10.244.1.3)
[kind-kind] -------------------------------------------------------------------------------------------
[kind-kind] Test pod-to-pod-intranode-connectivity passed
[kind-kind] -------------------------------------------------------------------------------------------
[kind-kind] -------------------------------------------------------------------------------------------
[kind-kind] Running test: pod-to-internet-connectivity
[kind-kind] -------------------------------------------------------------------------------------------
[kind-kind] Validating connectivity from Pod antrea-test-729be/test-client-5448f7d5f6-dplnl to the world (google.com)...
[kind-kind] -------------------------------------------------------------------------------------------
[kind-kind] Test pod-to-internet-connectivity failed: Pod antrea-test-729be/test-client-5448f7d5f6-dplnl was not able to connect to google.com: error in stream: command terminated with exit code 1
[kind-kind] -------------------------------------------------------------------------------------------
[kind-kind] Test finished
[kind-kind] Deleting post installation tests setup...
[kind-kind] Waiting for Namespace antrea-test-729be to disappear
[kind-kind] Setup deletion successful

@antoninbas
Copy link
Contributor

/skip-all

@antoninbas antoninbas merged commit dc97a83 into antrea-io:main Apr 29, 2024
49 of 53 checks passed
@antoninbas antoninbas changed the title Add antctl test command to conduct post installation connectivity tests Add antctl check installation command to conduct connectivity checks (#6133) Apr 29, 2024
@antoninbas
Copy link
Contributor

Thanks for your contribution to Antrea @kanha-gupta !

@kanha-gupta
Copy link
Contributor Author

Thanks for your contribution to Antrea @kanha-gupta !

Thanks to all of you for the guidance :)

@kanha-gupta kanha-gupta deleted the antrea-connectivity-tests branch April 29, 2024 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants