blob: 096c695b8af894a92f2142fd494f3d9bcac517d9 [file] [log] [blame]
Gary Wu9abb61c2018-09-27 10:38:50 -07001#!/bin/bash
2
3source ${SCRIPTS}/common_functions.sh
4
pkaras55d36862018-10-17 15:08:34 +02005function check_heartbeat ()
6{
7 local port=$1
8
9 for i in {1..10}; do
10 curl -sS -m 1 localhost:$port/heartbeat && break
11 echo sleep ${i}
12 sleep ${i}
13 done
14}
15
Gary Wu9abb61c2018-09-27 10:38:50 -070016export PRH_SERVICE="prh"
pkaras55d36862018-10-17 15:08:34 +020017export SSL_PRH_SERVICE="ssl_prh"
Gary Wu9abb61c2018-09-27 10:38:50 -070018export DMAAP_SIMULATOR="dmaap_simulator"
19export AAI_SIMULATOR="aai_simulator"
20
Gary Wu13111e92018-09-27 11:31:33 -070021cd ${WORKSPACE}/tests/dcaegen2/prh-testcases/resources/
Gary Wu9abb61c2018-09-27 10:38:50 -070022
23pip uninstall -y docker-py
24pip uninstall -y docker
25pip install -U docker
26docker-compose up -d --build
27
28PRH_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${PRH_SERVICE})
pkaras55d36862018-10-17 15:08:34 +020029SSL_PRH_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${SSL_PRH_SERVICE})
Gary Wu9abb61c2018-09-27 10:38:50 -070030DMAAP_SIMULATOR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${DMAAP_SIMULATOR})
31AAI_SIMULATOR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${AAI_SIMULATOR})
32
33bypass_ip_adress ${PRH_IP}
pkaras55d36862018-10-17 15:08:34 +020034bypass_ip_adress ${SSL_PRH_IP}
Gary Wu9abb61c2018-09-27 10:38:50 -070035bypass_ip_adress ${DMAAP_SIMULATOR_IP}
36bypass_ip_adress ${AAI_SIMULATOR_IP}
37
38echo PRH_IP=${PRH_IP}
pkaras55d36862018-10-17 15:08:34 +020039echo SSL_PRH_IP=${SSL_PRH_IP}
Gary Wu9abb61c2018-09-27 10:38:50 -070040echo DMAAP_SIMULATOR_IP=${DMAAP_SIMULATOR_IP}
41echo AAI_SIMULATOR_IP=${AAI_SIMULATOR_IP}
42
43# Wait for initialization of PRH services
pkaras55d36862018-10-17 15:08:34 +020044check_heartbeat 8100
45check_heartbeat 8200
Gary Wu9abb61c2018-09-27 10:38:50 -070046
47# #Pass any variables required by Robot test suites in ROBOT_VARIABLES
pkaras55d36862018-10-17 15:08:34 +020048ROBOT_VARIABLES="-v DMAAP_SIMULATOR:${DMAAP_SIMULATOR_IP}:2222 -v AAI_SIMULATOR:${AAI_SIMULATOR_IP}:3333 -v SSL_AAI_SIMULATOR:${AAI_SIMULATOR_IP}:3334 -v AAI_SIMULATOR_SETUP:${AAI_SIMULATOR_IP}:3335"
49