summaryrefslogtreecommitdiffstats
path: root/test/csit/scripts/externalapi-nbi
diff options
context:
space:
mode:
authorEric Debeau <eric.debeau@orange.com>2018-04-18 20:53:01 +0000
committerGary Wu <gary.i.wu@huawei.com>2018-04-19 09:03:51 -0700
commita09ce2bf4fb2d61a549f57ff7533fcd0d32d1928 (patch)
tree1b3ef439d1f16ae79c2b7386b282ea3758c3ca20 /test/csit/scripts/externalapi-nbi
parentaedcf8ed19f09c8c7e7731864a53121cf565e052 (diff)
Correct Robot script for ExternalAPI-NBI CSIT
Add Testcases (thanks to Gary Wu) Change-Id: Ide10a8fabd1b8bce1584ee03ccbc29f11e949141 Issue-ID: EXTAPI-76 Signed-off-by: Eric Debeau <eric.debeau@orange.com> Signed-off-by: Sylvain Desbureaux <sylvain.desbureaux@orange.com> Signed-off-by: Quoc Nghia Nguyen <quocnghia.nguyen@orange.com> Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
Diffstat (limited to 'test/csit/scripts/externalapi-nbi')
-rw-r--r--test/csit/scripts/externalapi-nbi/start_nbi_containers.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/csit/scripts/externalapi-nbi/start_nbi_containers.sh b/test/csit/scripts/externalapi-nbi/start_nbi_containers.sh
index d1a026a67..7237a1fbc 100644
--- a/test/csit/scripts/externalapi-nbi/start_nbi_containers.sh
+++ b/test/csit/scripts/externalapi-nbi/start_nbi_containers.sh
@@ -36,3 +36,16 @@ docker pull $NEXUS_DOCKER_REPO/onap/externalapi/nbi:$DOCKER_IMAGE_VERSION
# Start nbi, MariaDB and MongoDB containers with docker compose and nbi/docker-compose.yml
docker-compose up -d mariadb mongo && sleep 5 # to ensure that these services are ready for connections
docker-compose up -d nbi
+
+NBI_CONTAINER_NAME=$(docker-compose ps 2> /dev/null | tail -n+3 | tr -s ' ' | cut -d' ' -f1 | grep _nbi_)
+NBI_IP=$(docker inspect $NBI_CONTAINER_NAME --format='{{ range .NetworkSettings.Networks }}{{ .IPAddress }}{{ end }}')
+
+echo "IP address for NBI main container ($NBI_CONTAINER_NAME) is set to ${NBI_IP}."
+
+# Wait for initialization
+for i in {1..30}; do
+ curl -sS ${NBI_IP}:8080 > /dev/null 2>&1 && break
+ echo sleep $i
+ sleep $i
+done
+