summaryrefslogtreecommitdiffstats
path: root/kud/tests
diff options
context:
space:
mode:
authorKuralamudhan Ramakrishnan <kuralamudhan.ramakrishnan@intel.com>2019-10-18 09:08:50 -0700
committerKuralamudhan Ramakrishnan <kuralamudhan.ramakrishnan@intel.com>2019-10-23 14:33:28 -0700
commit47224ff96fea8e5a4cda20e5211f66adceb87d10 (patch)
tree6ef7f3225c77adc50117146143c598c4fa769bf1 /kud/tests
parent07eb93be83349a4da6b41c5a0a1dc98284462098 (diff)
Adding onap4ks installation script in kud containerized installer
Issue-ID: MULTICLOUD-867 Co-authored-by: Pramod Raghavendra Jayathirth <pramod.raghavendra.jayathirth@intel.com> Co-authored-by: Ritu Sood <ritu.sood@intel.com> Change-Id: I37b8112bdd5809f1ae0eaa58ddb0d834d395e8d8 Signed-off-by: Kuralamudhan Ramakrishnan <kuralamudhan.ramakrishnan@intel.com>
Diffstat (limited to 'kud/tests')
-rwxr-xr-xkud/tests/onap4k8s.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/kud/tests/onap4k8s.sh b/kud/tests/onap4k8s.sh
new file mode 100755
index 00000000..702bed46
--- /dev/null
+++ b/kud/tests/onap4k8s.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+# SPDX-license-identifier: Apache-2.0
+##############################################################################
+# Copyright (c) 2018
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+set -o errexit
+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"
+
+function check_onap_svc {
+ while ((timeout > 0)); do
+ echo "try $timeout: Wait for $interval seconds to check for onap svc"
+ sleep $interval
+ call_api "$base_url/healthcheck"
+ call_api_ret=$?
+ if [[ $call_api_ret -eq 0 ]]; then
+ echo "onap svc health check is success"
+ exit 0
+ fi
+ ((timeout-=1))
+ done
+}
+
+check_onap_svc
+echo "Failed to check for onap svc"
+exit 1