Add CSIT for multicloud-k8s
[integration/csit.git] / plans / multicloud-k8s / functionality1 / setup.sh
1 #!/bin/bash
2 #
3 # Copyright (c) 2018 Intel Corporation, Inc
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at:
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
14 pushd ${SCRIPTS}
15
16 # start mongodb
17 ./run-instance.sh docker.io/mongo:4.0 multicloud-k8s-mongodb
18 MONGO_IP=$(./get-instance-ip.sh multicloud-k8s-mongodb)
19
20 # start multicloud-k8s
21 ./run-instance.sh nexus3.onap.org:10001/onap/multicloud/k8s:latest multicloud-k8s "-e PLUGINS_DIR=/opt/multicloud/k8s -e DATABASE_TYPE=mongo -e DATABASE_IP=$MONGO_IP"
22 SERVICE_IP=$(./get-instance-ip.sh multicloud-k8s)
23 SERVICE_PORT=8081
24 popd
25
26 if [[ $no_proxy && $no_proxy != *$SERVICE_IP* ]]; then
27         export no_proxy+=$no_proxy,$SERVICE_IP
28 fi
29
30 for i in {1..50}; do
31     curl -sS ${SERVICE_IP}:${SERVICE_PORT} && break
32     echo sleep $i
33     sleep $i
34 done
35
36 # Pass any variables required by Robot test suites in ROBOT_VARIABLES
37 ROBOT_VARIABLES+="-v SERVICE_IP:${SERVICE_IP} "
38 ROBOT_VARIABLES+="-v SERVICE_PORT:${SERVICE_PORT} "