blob: 058ed20bd0dce1bee6df77b4aed6cf6b4fb79ea4 [file] [log] [blame]
wejs060bc422018-05-25 13:58:11 +02001#!/bin/bash
2
3source ${SCRIPTS}/common_functions.sh
4
5export PRH_SERVICE="prh"
6export DMAAP_SIMULATOR="dmaap_simulator"
Mariusz Wagner4a6ece42018-06-05 15:54:27 +02007export AAI_SIMULATOR="aai_simulator"
wejs060bc422018-05-25 13:58:11 +02008
Mariusz Wagner26b89ec2018-06-19 09:52:01 +02009cd ${WORKSPACE}/test/csit/tests/dcaegen2/prh-testcases/resources/
wejs060bc422018-05-25 13:58:11 +020010
Mariusz Wagner3cbe5472018-07-30 14:19:50 +020011docker login -u docker -p docker nexus3.onap.org:10001
Mariusz Wagner4a6ece42018-06-05 15:54:27 +020012docker-compose up -d --build
wejs060bc422018-05-25 13:58:11 +020013
14# Wait for initialization of Docker containers
Mariusz Wagner60be36d2018-07-05 11:32:51 +020015for i in {1..10}; do
wejs060bc422018-05-25 13:58:11 +020016 if [ $(docker inspect --format '{{ .State.Running }}' ${PRH_SERVICE}) ] && \
Mariusz Wagner4a6ece42018-06-05 15:54:27 +020017 [ $(docker inspect --format '{{ .State.Running }}' ${DMAAP_SIMULATOR}) ] && \
18 [ $(docker inspect --format '{{ .State.Running }}' ${AAI_SIMULATOR}) ]
wejs060bc422018-05-25 13:58:11 +020019 then
Mariusz Wagner4a6ece42018-06-05 15:54:27 +020020 echo "dmaap_simulator, aai_simulator and prh services are running"
wejs060bc422018-05-25 13:58:11 +020021 break
22 else
23 echo sleep ${i}
24 sleep ${i}
25 fi
26done
27
28PRH_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${PRH_SERVICE})
29DMAAP_SIMULATOR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${DMAAP_SIMULATOR})
Mariusz Wagner4a6ece42018-06-05 15:54:27 +020030AAI_SIMULATOR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${AAI_SIMULATOR})
wejs060bc422018-05-25 13:58:11 +020031
32bypass_ip_adress ${PRH_IP}
33bypass_ip_adress ${DMAAP_SIMULATOR_IP}
Mariusz Wagner4a6ece42018-06-05 15:54:27 +020034bypass_ip_adress ${AAI_SIMULATOR_IP}
wejs060bc422018-05-25 13:58:11 +020035
36echo PRH_IP=${PRH_IP}
37echo DMAAP_SIMULATOR_IP=${DMAAP_SIMULATOR_IP}
Mariusz Wagner4a6ece42018-06-05 15:54:27 +020038echo AAI_SIMULATOR_IP=${AAI_SIMULATOR_IP}
wejs060bc422018-05-25 13:58:11 +020039
40# Wait for initialization of docker services
Mariusz Wagner60be36d2018-07-05 11:32:51 +020041for i in {1..10}; do
wejs060bc422018-05-25 13:58:11 +020042 curl -sS -m 1 localhost:8100/heartbeat && break
43 echo sleep ${i}
44 sleep ${i}
45done
46
Mariusz Wagner60be36d2018-07-05 11:32:51 +020047docker stop prh
wejs060bc422018-05-25 13:58:11 +020048docker cp prh:/config/prh_endpoints.json ${WORKDIR}
49sed -i -e 's/"dmaapHostName":.*/"dmaapHostName": "'${DMAAP_SIMULATOR_IP}'",/g' ${WORKDIR}/prh_endpoints.json
Mariusz Wagner4a6ece42018-06-05 15:54:27 +020050sed -i -e 's/"aaiHost":.*/"aaiHost": "'${AAI_SIMULATOR_IP}'",/g' ${WORKDIR}/prh_endpoints.json
wejs060bc422018-05-25 13:58:11 +020051docker cp ${WORKDIR}/prh_endpoints.json prh:/config/
Mariusz Wagner60be36d2018-07-05 11:32:51 +020052docker start prh
wejs060bc422018-05-25 13:58:11 +020053
Mariusz Wagner60be36d2018-07-05 11:32:51 +020054# #Pass any variables required by Robot test suites in ROBOT_VARIABLES
55ROBOT_VARIABLES="-v DMAAP_SIMULATOR:${DMAAP_SIMULATOR_IP}:2222 -v AAI_SIMULATOR:${AAI_SIMULATOR_IP}:3333 -v PRH:${PRH_IP}:8100"
Mariusz Wagnercfd26b92018-06-13 14:30:27 +020056
Mariusz Wagner60be36d2018-07-05 11:32:51 +020057pip install docker==2.7.0