blob: 73121139190a9f3865b4754ae42af5eca648a6b2 [file] [log] [blame]
Gary Wu9abb61c2018-09-27 10:38:50 -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
Gary Wu13111e92018-09-27 11:31:33 -070020generic_sim_path=${WORKSPACE}/scripts/multicloud-pike/generic_sim
21multicloud_provision_path=${WORKSPACE}/tests/multicloud-pike/provision
Gary Wu9abb61c2018-09-27 10:38:50 -070022# 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-pike
46./run-instance.sh nexus3.onap.org:10001/onap/multicloud/openstack-pike multicloud-pike "-t -e AAI_SERVICE_URL=http://aai:8080/aai -e no_proxy=$no_proxy -p 9007:9007"
47SERVICE_IP=$(./get-instance-ip.sh multicloud-pike)
48SERVICE_PORT=9007
49
50docker network create hpa-net
51for container in aai keystone glance cinder nova multicloud-pike; 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} "