Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | source ${SCRIPTS}/common_functions.sh |
| 4 | |
| 5 | export PRH_SERVICE="prh" |
| 6 | export DMAAP_SIMULATOR="dmaap_simulator" |
| 7 | export AAI_SIMULATOR="aai_simulator" |
| 8 | |
Gary Wu | 13111e9 | 2018-09-27 11:31:33 -0700 | [diff] [blame] | 9 | cd ${WORKSPACE}/tests/dcaegen2/prh-testcases/resources/ |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 10 | |
| 11 | pip uninstall -y docker-py |
| 12 | pip uninstall -y docker |
| 13 | pip install -U docker |
| 14 | docker-compose up -d --build |
| 15 | |
| 16 | PRH_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${PRH_SERVICE}) |
| 17 | DMAAP_SIMULATOR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${DMAAP_SIMULATOR}) |
| 18 | AAI_SIMULATOR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${AAI_SIMULATOR}) |
| 19 | |
| 20 | bypass_ip_adress ${PRH_IP} |
| 21 | bypass_ip_adress ${DMAAP_SIMULATOR_IP} |
| 22 | bypass_ip_adress ${AAI_SIMULATOR_IP} |
| 23 | |
| 24 | echo PRH_IP=${PRH_IP} |
| 25 | echo DMAAP_SIMULATOR_IP=${DMAAP_SIMULATOR_IP} |
| 26 | echo AAI_SIMULATOR_IP=${AAI_SIMULATOR_IP} |
| 27 | |
| 28 | # Wait for initialization of PRH services |
| 29 | for i in {1..10}; do |
| 30 | curl -sS -m 1 localhost:8100/heartbeat && break |
| 31 | echo sleep ${i} |
| 32 | sleep ${i} |
| 33 | done |
| 34 | |
| 35 | # #Pass any variables required by Robot test suites in ROBOT_VARIABLES |
| 36 | ROBOT_VARIABLES="-v DMAAP_SIMULATOR:${DMAAP_SIMULATOR_IP}:2222 -v AAI_SIMULATOR:${AAI_SIMULATOR_IP}:3333 -v PRH:${PRH_IP}:8100" |