blob: 279696597e824e284764a768d864ab56ab113609 [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 Wagnerdf3a25a2018-05-28 10:05:08 +02009cd ${WORKSPACE}/test/csit/tests/dcaegen2/prh_testcases/resources/
wejs060bc422018-05-25 13:58:11 +020010
11docker login -u docker -p docker nexus3.onap.org:10003
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
15for i in {1..50}; do
16 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
41for i in {1..50}; do
42 curl -sS -m 1 localhost:2222 && \
Mariusz Wagner4a6ece42018-06-05 15:54:27 +020043 curl -sS -m 1 localhost:3333 && \
wejs060bc422018-05-25 13:58:11 +020044 curl -sS -m 1 localhost:8100/heartbeat && break
45 echo sleep ${i}
46 sleep ${i}
47done
48
wejs060bc422018-05-25 13:58:11 +020049docker cp prh:/config/prh_endpoints.json ${WORKDIR}
50sed -i -e 's/"dmaapHostName":.*/"dmaapHostName": "'${DMAAP_SIMULATOR_IP}'",/g' ${WORKDIR}/prh_endpoints.json
Mariusz Wagner4a6ece42018-06-05 15:54:27 +020051sed -i -e 's/"aaiHost":.*/"aaiHost": "'${AAI_SIMULATOR_IP}'",/g' ${WORKDIR}/prh_endpoints.json
wejs060bc422018-05-25 13:58:11 +020052docker cp ${WORKDIR}/prh_endpoints.json prh:/config/
53
54#Pass any variables required by Robot test suites in ROBOT_VARIABLES
Mariusz Wagner4a6ece42018-06-05 15:54:27 +020055ROBOT_VARIABLES="-v DMAAP_SIMULATOR:localhost:2222 -v AAI_SIMULATOR:localhost:3333 -v PRH:localhost:8100"