blob: a5ce48b5230188dbe365d5c59e81679f824202bd [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 Wagner7a1e0c82018-07-31 09:32:05 +020012pip uninstall -y docker-py
13pip uninstall -y docker
14pip install -U docker
Mariusz Wagner4a6ece42018-06-05 15:54:27 +020015docker-compose up -d --build
wejs060bc422018-05-25 13:58:11 +020016
17# Wait for initialization of Docker containers
Mariusz Wagner60be36d2018-07-05 11:32:51 +020018for i in {1..10}; do
wejs060bc422018-05-25 13:58:11 +020019 if [ $(docker inspect --format '{{ .State.Running }}' ${PRH_SERVICE}) ] && \
Mariusz Wagner4a6ece42018-06-05 15:54:27 +020020 [ $(docker inspect --format '{{ .State.Running }}' ${DMAAP_SIMULATOR}) ] && \
21 [ $(docker inspect --format '{{ .State.Running }}' ${AAI_SIMULATOR}) ]
wejs060bc422018-05-25 13:58:11 +020022 then
Mariusz Wagner4a6ece42018-06-05 15:54:27 +020023 echo "dmaap_simulator, aai_simulator and prh services are running"
wejs060bc422018-05-25 13:58:11 +020024 break
25 else
26 echo sleep ${i}
27 sleep ${i}
28 fi
29done
30
31PRH_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${PRH_SERVICE})
32DMAAP_SIMULATOR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${DMAAP_SIMULATOR})
Mariusz Wagner4a6ece42018-06-05 15:54:27 +020033AAI_SIMULATOR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${AAI_SIMULATOR})
wejs060bc422018-05-25 13:58:11 +020034
35bypass_ip_adress ${PRH_IP}
36bypass_ip_adress ${DMAAP_SIMULATOR_IP}
Mariusz Wagner4a6ece42018-06-05 15:54:27 +020037bypass_ip_adress ${AAI_SIMULATOR_IP}
wejs060bc422018-05-25 13:58:11 +020038
39echo PRH_IP=${PRH_IP}
40echo DMAAP_SIMULATOR_IP=${DMAAP_SIMULATOR_IP}
Mariusz Wagner4a6ece42018-06-05 15:54:27 +020041echo AAI_SIMULATOR_IP=${AAI_SIMULATOR_IP}
wejs060bc422018-05-25 13:58:11 +020042
Mariusz Wagner7a1e0c82018-07-31 09:32:05 +020043# Wait for initialization of PRH services
Mariusz Wagner60be36d2018-07-05 11:32:51 +020044for i in {1..10}; do
wejs060bc422018-05-25 13:58:11 +020045 curl -sS -m 1 localhost:8100/heartbeat && break
46 echo sleep ${i}
47 sleep ${i}
48done
49
Mariusz Wagner60be36d2018-07-05 11:32:51 +020050docker stop prh
wejs060bc422018-05-25 13:58:11 +020051docker cp prh:/config/prh_endpoints.json ${WORKDIR}
52sed -i -e 's/"dmaapHostName":.*/"dmaapHostName": "'${DMAAP_SIMULATOR_IP}'",/g' ${WORKDIR}/prh_endpoints.json
Mariusz Wagner4a6ece42018-06-05 15:54:27 +020053sed -i -e 's/"aaiHost":.*/"aaiHost": "'${AAI_SIMULATOR_IP}'",/g' ${WORKDIR}/prh_endpoints.json
wejs060bc422018-05-25 13:58:11 +020054docker cp ${WORKDIR}/prh_endpoints.json prh:/config/
Mariusz Wagner60be36d2018-07-05 11:32:51 +020055docker start prh
wejs060bc422018-05-25 13:58:11 +020056
Mariusz Wagner60be36d2018-07-05 11:32:51 +020057# #Pass any variables required by Robot test suites in ROBOT_VARIABLES
58ROBOT_VARIABLES="-v DMAAP_SIMULATOR:${DMAAP_SIMULATOR_IP}:2222 -v AAI_SIMULATOR:${AAI_SIMULATOR_IP}:3333 -v PRH:${PRH_IP}:8100"