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

Update and Activate ovn_ipsec_connectivity #37

Merged
merged 2 commits into from May 8, 2021

Conversation

astoycos
Copy link
Contributor

Activate IPSEC test, and convert test to use built in functions described in the common script

When run it will check if node to node traffic in an OVN-K cluster is encrypted with IPSEC

Output will resemble the following

[astoycos@localhost debug-scripts]$ ./network-tools 
INFO: Cluster is using OVNKubernetes network plugin
node/ci-ln-4yjcsz2-f76d1-75gv8-worker-b-fmrh4 labeled
INFO: Scheduling network-tools-debug-pod-5gqot on ci-ln-4yjcsz2-f76d1-75gv8-worker-b-fmrh4
pod/network-tools-debug-pod-5gqot created
pod/network-tools-debug-pod-5gqot condition met
node/ci-ln-4yjcsz2-f76d1-75gv8-worker-b-fmrh4 labeled
node/ci-ln-4yjcsz2-f76d1-75gv8-worker-b-fmrh4 labeled
INFO: Scheduling network-tools-debug-svc-ipz62 on ci-ln-4yjcsz2-f76d1-75gv8-worker-b-fmrh4
pod/network-tools-debug-svc-ipz62 created
pod/network-tools-debug-svc-ipz62 condition met
node/ci-ln-4yjcsz2-f76d1-75gv8-worker-b-fmrh4 labeled
INFO: Creating a ClusterIP service: network-tools-debug-svc-ipz62
service/network-tools-debug-svc-ipz62 exposed
IPSEC is enabled 
node/ci-ln-4yjcsz2-f76d1-75gv8-worker-b-fmrh4 labeled
INFO: Scheduling client-debug-3qnme on ci-ln-4yjcsz2-f76d1-75gv8-worker-b-fmrh4
pod/client-debug-3qnme created
pod/client-debug-3qnme condition met
node/ci-ln-4yjcsz2-f76d1-75gv8-worker-b-fmrh4 labeled
node/ci-ln-4yjcsz2-f76d1-75gv8-worker-c-q9694 labeled
INFO: Scheduling server-debug-0m5ei on ci-ln-4yjcsz2-f76d1-75gv8-worker-c-q9694
pod/server-debug-0m5ei created
pod/server-debug-0m5ei condition met
node/ci-ln-4yjcsz2-f76d1-75gv8-worker-c-q9694 labeled
INFO: Scheduling ci-ln-4yjcsz2-f76d1-75gv8-worker-c-q9694-debug on ci-ln-4yjcsz2-f76d1-75gv8-worker-c-q9694
pod/ci-ln-4yjcsz2-f76d1-75gv8-worker-c-q9694-debug condition met
INFO: Get Ethernet Interface Name
INFO: Ethernet Interface name is: ens4
INFO: packet sniffing command is: tcpdump -i ens4 -vv -c 2 -w ipsec-test-2021-02-15.pcap src     10.0.32.4     && dst 10.0.32.2
INFO: pinging server from client pod: oc rsh client-debug-3qnme ping 10.128.6.64 -c 5 -W 2
 
INFO:Tunnel traffic is encrypted with ovn-ipsec!
 
pod "server-debug-0m5ei" deleted
pod "client-debug-3qnme" deleted
pod "ci-ln-4yjcsz2-f76d1-75gv8-worker-c-q9694-debug" deleted

This PR also adds some fixes to common functions (see commit messages for more detail)

TODO: The script generates a PCAP which should prove that the traffic is encrypted... This file is copied to the network-tools image and should be accessible to the user at some point

@astoycos
Copy link
Contributor Author

/retest

Copy link
Contributor

@tssurya tssurya left a comment

Choose a reason for hiding this comment

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

Thanks for the PR Andrew! couple of questions inline.

debug-scripts/common Show resolved Hide resolved
debug-scripts/common Show resolved Hide resolved
debug-scripts/common Show resolved Hide resolved
debug-scripts/common Outdated Show resolved Hide resolved
Comment on lines +12 to +13
# TODO check with oc get network.operator.openshift.io/cluster -o=jsonpath='{.items[*].spec.defaultNetwork.ovnKubernetesConfig.ipsecConfig}'
# once tests can be run with real cluster
Copy link
Contributor

Choose a reason for hiding this comment

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

we can't run it using cluster-bot now ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not yet unfortunately I think Mark has some work in the pipeline to be able to do so though

}

help()
Copy link
Contributor

Choose a reason for hiding this comment

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

this func has to be changed in accordance to this script.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ack sorry missed that

@@ -175,3 +199,12 @@ create_host_network_pod_on_node () {
sleep 2
oc wait -n "$NAMESPACE" --for=condition=Ready pod/"$POD_NAME" --timeout=3m
}

format_sdout () {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: stdout

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep I actually didn't mean to have the color formatting in this PR... Sorry about that!

Copy link
Contributor

@tssurya tssurya left a comment

Choose a reason for hiding this comment

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

/lgtm

just a few nits, wouldn't block merge. As noted, we still need to do some improvements to the ipsec script once we have a better way to spawn an ipsec cluster on openshift.

@@ -174,4 +191,4 @@ create_host_network_pod_on_node () {
# wait till pod is running
sleep 2
oc wait -n "$NAMESPACE" --for=condition=Ready pod/"$POD_NAME" --timeout=3m
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

woops, we actually need the newline.


global_namespace="${1}"

main
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto...

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 2, 2021
@tssurya
Copy link
Contributor

tssurya commented Mar 3, 2021

/assign @rcarrillocruz

Cleanup the info logging

Make the tcpdump command run in a dedicated host-networked container

copy pcap capture back to the network-tools container

TODO: Copy this file out to the local machine

Fix some empty fields erros

In some of these functions they didn't seem to work if the namespace
or other parameters were not specified

This commit just adds some error checking to those functions

Signed-off-by: Andrew Stoycos <astoycos@redhat.com>
Activiates this test for the network-tools image

Script will check for ipsec enablement internally and only
run if so

Signed-off-by: Andrew Stoycos <astoycos@redhat.com>
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Apr 5, 2021
@openshift-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@rcarrillocruz
Copy link
Contributor

/approve

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: astoycos, rcarrillocruz, tssurya

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-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 5, 2021
@astoycos
Copy link
Contributor Author

astoycos commented Apr 5, 2021

/retest

2 similar comments
@astoycos
Copy link
Contributor Author

astoycos commented Apr 5, 2021

/retest

@astoycos
Copy link
Contributor Author

astoycos commented Apr 6, 2021

/retest

@tssurya
Copy link
Contributor

tssurya commented May 7, 2021

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 7, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 7, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: astoycos, rcarrillocruz, tssurya

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

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit c57d9f8 into openshift:master May 8, 2021
tssurya pushed a commit to tssurya/network-tools that referenced this pull request Jun 7, 2021
Update and Activate `ovn_ipsec_connectivity`
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

6 participants