summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/csit/scripts/externalapi-nbi/start_nbi_containers.sh13
-rw-r--r--test/csit/tests/externalapi-nbi/healthcheck/healthcheck.robot6
2 files changed, 18 insertions, 1 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
+
diff --git a/test/csit/tests/externalapi-nbi/healthcheck/healthcheck.robot b/test/csit/tests/externalapi-nbi/healthcheck/healthcheck.robot
index eb5a5bb4f..21c084894 100644
--- a/test/csit/tests/externalapi-nbi/healthcheck/healthcheck.robot
+++ b/test/csit/tests/externalapi-nbi/healthcheck/healthcheck.robot
@@ -1,6 +1,7 @@
*** Settings ***
Documentation The main interface for interacting with External API/NBI
Library RequestsLibrary
+Library Collections
*** Variables ***
${GLOBAL_NBI_SERVER_PROTOCOL} http
@@ -9,6 +10,9 @@ ${GLOBAL_NBI_SERVER_PORT} 8080
${NBI_HEALTH_CHECK_PATH} /nbi/api/v1/status
${NBI_ENDPOINT} ${GLOBAL_NBI_SERVER_PROTOCOL}://${GLOBAL_INJECTED_NBI_IP_ADDR}:${GLOBAL_NBI_SERVER_PORT}
+*** Test Cases ***
+NBI Health Check
+ Run NBI Health Check
*** Keywords ***
Run NBI Health Check
@@ -26,4 +30,4 @@ Run NBI Get Request
${json}= Set Variable ${resp.json()}
${status}= Get From Dictionary ${json} status
Should Be Equal ${status} ok
- [Return] ${resp} \ No newline at end of file
+ [Return] ${resp}