blob: d17bec124b0fda56d67f77ef8a2132ff828e0432 [file] [log] [blame]
Shashank Kumar Shankarf8aab842018-04-20 11:22:55 -07001#!/bin/bash
2#
3# Copyright 2018 Intel Corporation, Inc
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
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# See the License for the specific language governing permissions and
14# limitations under the License.
15
16cd ${SCRIPTS}
17
18source common_functions.sh
19
20generic_sim_path=${WORKSPACE}/test/csit/scripts/multicloud-ocata/generic_sim
21multicloud_provision_path=${WORKSPACE}/test/csit/tests/multicloud-ocata/provision
22# start generic simulator for openstack mock and AAI mock
23if [[ -z $(docker images -q generic_sim) ]]; then
24 pushd $generic_sim_path
25 docker build -t generic_sim .
26 popd
27fi
28
29function start_simulator ()
30{
31 local service_name=$1
32 local service_port=$2
33
34 ./run-instance.sh generic_sim $service_name "-v ${multicloud_provision_path}/${service_name}/:/tmp/generic_sim/ -v ${generic_sim_path}/${service_name}/:/etc/generic_sim/ -p $service_port:8080"
35 wait_for_service_init localhost:$service_port
36 bypass_ip_adress $service_name
37}
38
39start_simulator nova 8774
40start_simulator glance 9292
41start_simulator cinder 8776
42start_simulator keystone 5000
43start_simulator aai 8443
44
45# start multicloud-ocata
xinhuili2da2e842018-06-06 07:28:03 +080046./run-instance.sh nexus3.onap.org:10001/onap/multicloud/openstack/openstack-ocata multicloud-ocata "-t -e AAI_SERVICE_URL=http://aai:8080/aai -e no_proxy=$no_proxy -p 9006:9006"
Shashank Kumar Shankarf8aab842018-04-20 11:22:55 -070047SERVICE_IP=$(./get-instance-ip.sh multicloud-ocata)
48SERVICE_PORT=9006
49
50docker network create hpa-net
51for container in aai keystone glance cinder nova multicloud-ocata; do
52 docker network connect hpa-net $container
53done
54
55bypass_ip_adress $SERVICE_IP
56wait_for_service_init ${SERVICE_IP}:${SERVICE_PORT}
57
58# Pass any variables required by Robot test suites in ROBOT_VARIABLES
59ROBOT_VARIABLES+="-v SERVICE_IP:${SERVICE_IP} "
60ROBOT_VARIABLES+="-v SERVICE_PORT:${SERVICE_PORT} "