aboutsummaryrefslogtreecommitdiffstats
path: root/kud/tests
diff options
context:
space:
mode:
authorTodd Malsbary <todd.malsbary@intel.com>2020-11-11 12:13:03 -0800
committerTodd Malsbary <todd.malsbary@intel.com>2021-10-12 10:57:04 -0700
commit988ebcf24c7d854a4053437b69cfb120acb8039c (patch)
tree6504bc0acaab449f44dc3d71a182984c2469b43b /kud/tests
parent5aa8c4de9fd620ef42ac5bf73b62f76d80e713a0 (diff)
Allow KuD installer to specify Kubespray 2.14.1 or 2.16.00.9.2
The default is 2.14.1 (the existing value). Setting KUBESPRAY_VERSION=2.16.0 in the installer environment uses the newer Kubespray version. The newer Kubespray version installs Kubernetes 1.20.7. Kubernetes 1.20.7 comes with following caveats: - The Virtlet addon is disabled; it does not work with 1.20.7. This requires removing the plugin_fw test as well. - Kubernetes 1.20.7 removed support for basic auth. Issue-ID: MULTICLOUD-1251 Signed-off-by: Todd Malsbary <todd.malsbary@intel.com> Change-Id: Ic8b9fb1f3effc31da58de5bb3768ed9e509d50de
Diffstat (limited to 'kud/tests')
-rwxr-xr-xkud/tests/_functions.sh7
-rwxr-xr-xkud/tests/emco.sh3
-rwxr-xr-xkud/tests/kubevirt.sh3
-rwxr-xr-xkud/tests/negative_tests/test_all_intents.sh4
-rwxr-xr-xkud/tests/negative_tests/test_composite_app.sh4
-rwxr-xr-xkud/tests/negative_tests/test_controllers.sh4
-rwxr-xr-xkud/tests/negative_tests/test_deployment_intent_group.sh4
-rwxr-xr-xkud/tests/negative_tests/test_generic_placement_intent.sh4
-rwxr-xr-xkud/tests/negative_tests/test_generic_placement_intent_app.sh4
-rwxr-xr-xkud/tests/negative_tests/test_multipart.sh4
-rwxr-xr-xkud/tests/negative_tests/test_profile.sh4
-rwxr-xr-xkud/tests/negative_tests/test_profile_apps.sh4
-rwxr-xr-xkud/tests/onap4k8s.sh4
-rwxr-xr-xkud/tests/plugin_collection_v2.sh4
-rwxr-xr-xkud/tests/plugin_eaa.sh4
-rwxr-xr-xkud/tests/plugin_edgex.sh4
-rwxr-xr-xkud/tests/plugin_fw.sh4
-rwxr-xr-xkud/tests/plugin_fw_v2.sh3
18 files changed, 22 insertions, 50 deletions
diff --git a/kud/tests/_functions.sh b/kud/tests/_functions.sh
index ec415409..367888e5 100755
--- a/kud/tests/_functions.sh
+++ b/kud/tests/_functions.sh
@@ -29,9 +29,12 @@ function print_msg {
echo -e "${RED} $msg ---------------------------------------${NC}"
}
+function control_plane_ip {
+ kubectl get endpoints kubernetes -o jsonpath='{.subsets[].addresses[].ip}'
+}
+
function ssh_cluster {
- master_ip=$(kubectl cluster-info | grep "Kubernetes master" | awk -F '[:/]' '{print $4}')
- ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ${master_ip} -- "$@"
+ ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $(control_plane_ip) -- "$@"
}
function get_ovn_central_address {
diff --git a/kud/tests/emco.sh b/kud/tests/emco.sh
index 1e003968..109f5638 100755
--- a/kud/tests/emco.sh
+++ b/kud/tests/emco.sh
@@ -17,8 +17,7 @@ function delete_resource_nox {
! call_api -X GET "$1" >/dev/null
}
-master_ip=$(kubectl cluster-info | grep "Kubernetes master" | \
- awk -F ":" '{print $2}' | awk -F "//" '{print $2}')
+master_ip=$(control_plane_ip)
rsync_service_port=30441
rsync_service_host="$master_ip"
base_url_orchestrator=${base_url_orchestrator:-"http://$master_ip:30415/v2"}
diff --git a/kud/tests/kubevirt.sh b/kud/tests/kubevirt.sh
index fbcf1bf6..529a67a7 100755
--- a/kud/tests/kubevirt.sh
+++ b/kud/tests/kubevirt.sh
@@ -39,7 +39,6 @@ if (($try > $tries)); then
fi
# Test
-master_ip=$(kubectl cluster-info | grep "Kubernetes master" | awk -F '[:/]' '{print $4}')
deployment_pod=$(kubectl get pods | grep $kubevirt_vmi_name | awk '{print $1}')
echo "Pod name: $deployment_pod"
echo "ssh testuser@$(kubectl get pods $deployment_pod -o jsonpath="{.status.podIP}")"
@@ -50,7 +49,7 @@ interval=60
for ((try=1;try<=$tries;try++)); do
echo "try $try/$tries: Wait for $interval seconds to check for ssh access"
sleep $interval
- if sshpass -p testuser ssh -o ProxyCommand="ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -W %h:%p $master_ip" -o StrictHostKeyChecking=no testuser@$(kubectl get pods $deployment_pod -o jsonpath="{.status.podIP}") -- uptime; then
+ if sshpass -p testuser ssh -o ProxyCommand="ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -W %h:%p $(control_plane_ip)" -o StrictHostKeyChecking=no testuser@$(kubectl get pods $deployment_pod -o jsonpath="{.status.podIP}") -- uptime; then
echo "ssh access check is success"
break
fi
diff --git a/kud/tests/negative_tests/test_all_intents.sh b/kud/tests/negative_tests/test_all_intents.sh
index 1f2f721f..00304906 100755
--- a/kud/tests/negative_tests/test_all_intents.sh
+++ b/kud/tests/negative_tests/test_all_intents.sh
@@ -26,10 +26,8 @@ source _test_functions.sh
if [ ${1:+1} ]; then
if [ "$1" == "--external" ]; then
- master_ip=$(kubectl cluster-info | grep "Kubernetes master" | \
- awk -F ":" '{print $2}' | awk -F "//" '{print $2}')
onap_svc_node_port=30498
- base_url="http://$master_ip:$onap_svc_node_port/v1"
+ base_url="http://$(control_plane_ip):$onap_svc_node_port/v1"
fi
fi
diff --git a/kud/tests/negative_tests/test_composite_app.sh b/kud/tests/negative_tests/test_composite_app.sh
index 8656a1d8..d020b860 100755
--- a/kud/tests/negative_tests/test_composite_app.sh
+++ b/kud/tests/negative_tests/test_composite_app.sh
@@ -26,10 +26,8 @@ source _test_functions.sh
if [ ${1:+1} ]; then
if [ "$1" == "--external" ]; then
- master_ip=$(kubectl cluster-info | grep "Kubernetes master" | \
- awk -F ":" '{print $2}' | awk -F "//" '{print $2}')
onap_svc_node_port=30498
- base_url="http://$master_ip:$onap_svc_node_port/v1"
+ base_url="http://$(control_plane_ip):$onap_svc_node_port/v1"
fi
fi
diff --git a/kud/tests/negative_tests/test_controllers.sh b/kud/tests/negative_tests/test_controllers.sh
index 20e6bda0..80e2f34f 100755
--- a/kud/tests/negative_tests/test_controllers.sh
+++ b/kud/tests/negative_tests/test_controllers.sh
@@ -25,10 +25,8 @@ source _test_functions.sh
if [ ${1:+1} ]; then
if [ "$1" == "--external" ]; then
- master_ip=$(kubectl cluster-info | grep "Kubernetes master" | \
- awk -F ":" '{print $2}' | awk -F "//" '{print $2}')
onap_svc_node_port=30498
- base_url="http://$master_ip:$onap_svc_node_port/v1"
+ base_url="http://$(control_plane_ip):$onap_svc_node_port/v1"
fi
fi
diff --git a/kud/tests/negative_tests/test_deployment_intent_group.sh b/kud/tests/negative_tests/test_deployment_intent_group.sh
index 402a0b1d..18857e42 100755
--- a/kud/tests/negative_tests/test_deployment_intent_group.sh
+++ b/kud/tests/negative_tests/test_deployment_intent_group.sh
@@ -26,10 +26,8 @@ source _test_functions.sh
if [ ${1:+1} ]; then
if [ "$1" == "--external" ]; then
- master_ip=$(kubectl cluster-info | grep "Kubernetes master" | \
- awk -F ":" '{print $2}' | awk -F "//" '{print $2}')
onap_svc_node_port=30498
- base_url="http://$master_ip:$onap_svc_node_port/v1"
+ base_url="http://$(control_plane_ip):$onap_svc_node_port/v1"
fi
fi
diff --git a/kud/tests/negative_tests/test_generic_placement_intent.sh b/kud/tests/negative_tests/test_generic_placement_intent.sh
index 708180f8..4d8834da 100755
--- a/kud/tests/negative_tests/test_generic_placement_intent.sh
+++ b/kud/tests/negative_tests/test_generic_placement_intent.sh
@@ -26,10 +26,8 @@ source _test_functions.sh
if [ ${1:+1} ]; then
if [ "$1" == "--external" ]; then
- master_ip=$(kubectl cluster-info | grep "Kubernetes master" | \
- awk -F ":" '{print $2}' | awk -F "//" '{print $2}')
onap_svc_node_port=30498
- base_url="http://$master_ip:$onap_svc_node_port/v1"
+ base_url="http://$(control_plane_ip):$onap_svc_node_port/v1"
fi
fi
diff --git a/kud/tests/negative_tests/test_generic_placement_intent_app.sh b/kud/tests/negative_tests/test_generic_placement_intent_app.sh
index 23e7dd00..f0b7fbb8 100755
--- a/kud/tests/negative_tests/test_generic_placement_intent_app.sh
+++ b/kud/tests/negative_tests/test_generic_placement_intent_app.sh
@@ -26,10 +26,8 @@ source _test_functions.sh
if [ ${1:+1} ]; then
if [ "$1" == "--external" ]; then
- master_ip=$(kubectl cluster-info | grep "Kubernetes master" | \
- awk -F ":" '{print $2}' | awk -F "//" '{print $2}')
onap_svc_node_port=30498
- base_url="http://$master_ip:$onap_svc_node_port/v1"
+ base_url="http://$(control_plane_ip):$onap_svc_node_port/v1"
fi
fi
diff --git a/kud/tests/negative_tests/test_multipart.sh b/kud/tests/negative_tests/test_multipart.sh
index 7f4a84be..ee15bf27 100755
--- a/kud/tests/negative_tests/test_multipart.sh
+++ b/kud/tests/negative_tests/test_multipart.sh
@@ -26,10 +26,8 @@ source _test_functions.sh
if [ ${1:+1} ]; then
if [ "$1" == "--external" ]; then
- master_ip=$(kubectl cluster-info | grep "Kubernetes master" | \
- awk -F ":" '{print $2}' | awk -F "//" '{print $2}')
onap_svc_node_port=30498
- base_url="http://$master_ip:$onap_svc_node_port/v1"
+ base_url="http://$(control_plane_ip):$onap_svc_node_port/v1"
fi
fi
diff --git a/kud/tests/negative_tests/test_profile.sh b/kud/tests/negative_tests/test_profile.sh
index c5002d50..44cfee23 100755
--- a/kud/tests/negative_tests/test_profile.sh
+++ b/kud/tests/negative_tests/test_profile.sh
@@ -26,10 +26,8 @@ source _test_functions.sh
if [ ${1:+1} ]; then
if [ "$1" == "--external" ]; then
- master_ip=$(kubectl cluster-info | grep "Kubernetes master" | \
- awk -F ":" '{print $2}' | awk -F "//" '{print $2}')
onap_svc_node_port=30498
- base_url="http://$master_ip:$onap_svc_node_port/v1"
+ base_url="http://$(control_plane_ip):$onap_svc_node_port/v1"
fi
fi
diff --git a/kud/tests/negative_tests/test_profile_apps.sh b/kud/tests/negative_tests/test_profile_apps.sh
index ca8c6454..6e6adbf8 100755
--- a/kud/tests/negative_tests/test_profile_apps.sh
+++ b/kud/tests/negative_tests/test_profile_apps.sh
@@ -26,10 +26,8 @@ source _test_functions.sh
if [ ${1:+1} ]; then
if [ "$1" == "--external" ]; then
- master_ip=$(kubectl cluster-info | grep "Kubernetes master" | \
- awk -F ":" '{print $2}' | awk -F "//" '{print $2}')
onap_svc_node_port=30498
- base_url="http://$master_ip:$onap_svc_node_port/v1"
+ base_url="http://$(control_plane_ip):$onap_svc_node_port/v1"
fi
fi
diff --git a/kud/tests/onap4k8s.sh b/kud/tests/onap4k8s.sh
index 702bed46..67aae58f 100755
--- a/kud/tests/onap4k8s.sh
+++ b/kud/tests/onap4k8s.sh
@@ -13,13 +13,11 @@ set -o pipefail
source _functions.sh
set +e
-master_ip=$(kubectl cluster-info | grep "Kubernetes master" | \
- awk -F ":" '{print $2}' | awk -F "//" '{print $2}')
onap_svc_node_port=30498
declare -i timeout=18
declare -i interval=10
-base_url="http://$master_ip:$onap_svc_node_port/v1"
+base_url="http://$(control_plane_ip):$onap_svc_node_port/v1"
function check_onap_svc {
while ((timeout > 0)); do
diff --git a/kud/tests/plugin_collection_v2.sh b/kud/tests/plugin_collection_v2.sh
index 84f5ca27..5695dfc7 100755
--- a/kud/tests/plugin_collection_v2.sh
+++ b/kud/tests/plugin_collection_v2.sh
@@ -25,10 +25,8 @@ source _common.sh
if [ ${1:+1} ]; then
if [ "$1" == "--external" ]; then
- master_ip=$(kubectl cluster-info | grep "Kubernetes master" | \
- awk -F ":" '{print $2}' | awk -F "//" '{print $2}')
onap_svc_node_port=30498
- base_url="http://$master_ip:$onap_svc_node_port/v1"
+ base_url="http://$(control_plane_ip):$onap_svc_node_port/v1"
fi
fi
diff --git a/kud/tests/plugin_eaa.sh b/kud/tests/plugin_eaa.sh
index 5cf44e02..1fedbbf3 100755
--- a/kud/tests/plugin_eaa.sh
+++ b/kud/tests/plugin_eaa.sh
@@ -19,10 +19,8 @@ source _common.sh
if [ ${1:+1} ]; then
if [ "$1" == "--external" ]; then
- master_ip=$(kubectl cluster-info | grep "Kubernetes master" | \
- awk -F ":" '{print $2}' | awk -F "//" '{print $2}')
onap_svc_node_port=30498
- base_url="http://$master_ip:$onap_svc_node_port/v1"
+ base_url="http://$(control_plane_ip):$onap_svc_node_port/v1"
fi
fi
diff --git a/kud/tests/plugin_edgex.sh b/kud/tests/plugin_edgex.sh
index ae390add..ff27ab27 100755
--- a/kud/tests/plugin_edgex.sh
+++ b/kud/tests/plugin_edgex.sh
@@ -19,10 +19,8 @@ source _common.sh
if [ ${1:+1} ]; then
if [ "$1" == "--external" ]; then
- master_ip=$(kubectl cluster-info | grep "Kubernetes master" | \
- awk -F ":" '{print $2}' | awk -F "//" '{print $2}')
onap_svc_node_port=30498
- base_url="http://$master_ip:$onap_svc_node_port/v1"
+ base_url="http://$(control_plane_ip):$onap_svc_node_port/v1"
fi
fi
diff --git a/kud/tests/plugin_fw.sh b/kud/tests/plugin_fw.sh
index 4d59006b..0a0f62dc 100755
--- a/kud/tests/plugin_fw.sh
+++ b/kud/tests/plugin_fw.sh
@@ -23,10 +23,8 @@ source _common.sh
if [ ${1:+1} ]; then
if [ "$1" == "--external" ]; then
- master_ip=$(kubectl cluster-info | grep "Kubernetes master" | \
- awk -F ":" '{print $2}' | awk -F "//" '{print $2}')
onap_svc_node_port=30498
- base_url="http://$master_ip:$onap_svc_node_port/v1"
+ base_url="http://$(control_plane_ip):$onap_svc_node_port/v1"
fi
fi
diff --git a/kud/tests/plugin_fw_v2.sh b/kud/tests/plugin_fw_v2.sh
index abab9004..86ef97f9 100755
--- a/kud/tests/plugin_fw_v2.sh
+++ b/kud/tests/plugin_fw_v2.sh
@@ -56,8 +56,7 @@ while [[ $# -gt 0 ]]; do
case $arg in
"--external" )
- service_host=$(kubectl cluster-info | grep "Kubernetes master" | \
- awk -F ":" '{print $2}' | awk -F "//" '{print $2}')
+ service_host=$(control_plane_ip)
shift
;;
* )