Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | source ${SCRIPTS}/common_functions.sh |
| 4 | |
pkaras | 55d3686 | 2018-10-17 15:08:34 +0200 | [diff] [blame] | 5 | function 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 Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 16 | export PRH_SERVICE="prh" |
pkaras | 55d3686 | 2018-10-17 15:08:34 +0200 | [diff] [blame] | 17 | export SSL_PRH_SERVICE="ssl_prh" |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 18 | export DMAAP_SIMULATOR="dmaap_simulator" |
| 19 | export AAI_SIMULATOR="aai_simulator" |
| 20 | |
Gary Wu | 13111e9 | 2018-09-27 11:31:33 -0700 | [diff] [blame] | 21 | cd ${WORKSPACE}/tests/dcaegen2/prh-testcases/resources/ |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 22 | |
| 23 | pip uninstall -y docker-py |
| 24 | pip uninstall -y docker |
| 25 | pip install -U docker |
| 26 | docker-compose up -d --build |
| 27 | |
| 28 | PRH_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${PRH_SERVICE}) |
pkaras | 55d3686 | 2018-10-17 15:08:34 +0200 | [diff] [blame] | 29 | SSL_PRH_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${SSL_PRH_SERVICE}) |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 30 | DMAAP_SIMULATOR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${DMAAP_SIMULATOR}) |
| 31 | AAI_SIMULATOR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${AAI_SIMULATOR}) |
| 32 | |
| 33 | bypass_ip_adress ${PRH_IP} |
pkaras | 55d3686 | 2018-10-17 15:08:34 +0200 | [diff] [blame] | 34 | bypass_ip_adress ${SSL_PRH_IP} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 35 | bypass_ip_adress ${DMAAP_SIMULATOR_IP} |
| 36 | bypass_ip_adress ${AAI_SIMULATOR_IP} |
| 37 | |
| 38 | echo PRH_IP=${PRH_IP} |
pkaras | 55d3686 | 2018-10-17 15:08:34 +0200 | [diff] [blame] | 39 | echo SSL_PRH_IP=${SSL_PRH_IP} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 40 | echo DMAAP_SIMULATOR_IP=${DMAAP_SIMULATOR_IP} |
| 41 | echo AAI_SIMULATOR_IP=${AAI_SIMULATOR_IP} |
| 42 | |
| 43 | # Wait for initialization of PRH services |
pkaras | 55d3686 | 2018-10-17 15:08:34 +0200 | [diff] [blame] | 44 | check_heartbeat 8100 |
| 45 | check_heartbeat 8200 |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 46 | |
| 47 | # #Pass any variables required by Robot test suites in ROBOT_VARIABLES |
pkaras | 55d3686 | 2018-10-17 15:08:34 +0200 | [diff] [blame] | 48 | ROBOT_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 | |