Skip to content

Commit

Permalink
Add oc client integration script
Browse files Browse the repository at this point in the history
  • Loading branch information
tssurya committed Jan 29, 2021
1 parent c47db73 commit 5ba6d7f
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions debug-scripts/network-tools
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

source common

get_network_plugin () {
oc get networks.config.openshift.io cluster -o 'jsonpath={.spec.networkType}'
}

network_plugin=$(get_network_plugin)
echo "INFO: Cluster is using $network_plugin network plugin"

# Create basic resources that can be reused for any test.
# NOTE: Test specific resources should be created within the script.
client="network-tools-debug-pod"-$(get_random_name); server="network-tools-debug-svc"-$(get_random_name)
create_pod_on_node $client
create_svc $server
global_namespace=$(oc get pod $client -o jsonpath={.metadata.namespace})

if [[ "$network_plugin" == "OVNKubernetes" ]] ; then
# run scripts
ovn_pod_to_pod_connectivity "$global_namespace"/"$client" "$global_namespace"/"$server"
ovn_pod_to_svc_connectivity "$global_namespace"/"$client" "$global_namespace"/"$server"
# ovn_ipsec_connectivity
elif [[ "$network_plugin" == "OpenShiftSDN" ]] ; then
# run scripts
sdn_pod_to_pod_connectivity "$global_namespace"/"$client" "$global_namespace"/"$server"
sdn_pod_to_svc_connectivity "$global_namespace"/"$client" "$global_namespace"/"$server"
# sdn_node_connectivity
else
echo "Unable to debug cluster networking. Only OpenShiftSDN and OVNKubernetes plugins are supported"
fi

0 comments on commit 5ba6d7f

Please sign in to comment.