diff options
author | Singhsumalee, Pete (ps2418) <petes@att.com> | 2017-09-25 14:13:15 -0500 |
---|---|---|
committer | Venkata Harish K Kajur <vk250x@att.com> | 2017-09-29 00:22:18 +0000 |
commit | 56bb06b065db80f838eadfe945b1b7cfcaa1bfb4 (patch) | |
tree | caab8c004d8b518cfc669bcee3143dac401a8573 /test/csit/plans/aai/resources | |
parent | 065d88d2ef8d7cfa7b38d2a6e53329524a198591 (diff) |
Added 2 more resources test cases
Also modified the resources setup to take
into account recent changes
Issue ID: AAI-155
Change-Id: I71997fcf0ee6b4c2eb17abb1a7f6a4bd1255aba0
Signed-off-by: Singhsumalee, Pete (ps2418) <petes@att.com>
Signed-off-by: Venkata Harish K Kajur <vk250x@att.com>
Diffstat (limited to 'test/csit/plans/aai/resources')
-rw-r--r-- | test/csit/plans/aai/resources/docker-compose.yml | 3 | ||||
-rw-r--r-- | test/csit/plans/aai/resources/setup.sh | 44 |
2 files changed, 31 insertions, 16 deletions
diff --git a/test/csit/plans/aai/resources/docker-compose.yml b/test/csit/plans/aai/resources/docker-compose.yml index 923f24dea..09d2a8127 100644 --- a/test/csit/plans/aai/resources/docker-compose.yml +++ b/test/csit/plans/aai/resources/docker-compose.yml @@ -9,6 +9,7 @@ services: - CHEF_BRANCH=master - CHEF_GIT_URL=http://gerrit.onap.org/r/aai - AAI_CORE_VERSION=1.1.0-SNAPSHOT + - LOCAL_USER_ID=${USER_ID} ports: - 8447:8447 logging: @@ -25,6 +26,8 @@ services: - CHEF_BRANCH=master - CHEF_GIT_URL=http://gerrit.onap.org/r/aai - AAI_CORE_VERSION=1.1.0-SNAPSHOT + - LOCAL_USER_ID=${USER_ID} + - DISABLE_UPDATE_QUERY=true ports: - 8446:8446 logging: diff --git a/test/csit/plans/aai/resources/setup.sh b/test/csit/plans/aai/resources/setup.sh index 915536be2..19beb6365 100644 --- a/test/csit/plans/aai/resources/setup.sh +++ b/test/csit/plans/aai/resources/setup.sh @@ -31,7 +31,7 @@ function wait_for_container() { CONTAINER_NAME="$1"; START_TEXT="$2"; - TIMEOUT=240 + TIMEOUT=360 # wait for the real startup AMOUNT_STARTUP=$(docker logs ${CONTAINER_NAME} 2>&1 | grep "$START_TEXT" | wc -l) @@ -59,6 +59,7 @@ export HBASE_VERSION="${HBASE_VERSION:-1.2.0}"; docker pull ${HBASE_IMAGE}:${HBASE_VERSION}; +docker pull ${HBASE_IMAGE}:${HBASE_VERSION}; docker pull ${DOCKER_REGISTRY}/openecomp/aai-resources:${DOCKER_IMAGE_VERSION}; docker tag ${DOCKER_REGISTRY}/openecomp/aai-resources:${DOCKER_IMAGE_VERSION} ${DOCKER_REGISTRY}/openecomp/aai-resources:latest; @@ -74,25 +75,36 @@ wait_for_container ${HBASE_CONTAINER_NAME} ' Started SelectChannelConnector@0.0. wait_for_container ${HBASE_CONTAINER_NAME} ' Started SelectChannelConnector@0.0.0.0:8080'; wait_for_container ${HBASE_CONTAINER_NAME} ' Started SelectChannelConnector@0.0.0.0:9095'; -# Start the resources microservice -RESOURCES_CONTAINER_NAME=$(${DOCKER_COMPOSE_CMD} up -d aai-resources.api.simpledemo.openecomp.org 2>&1 | grep 'Creating' | grep -v 'volume' | grep -v 'network' | awk '{ print $2; }' | head -1); -wait_for_container ${RESOURCES_CONTAINER_NAME} '0.0.0.0:8447'; -docker logs ${CONTAINER_NAME}; - -# Start the traversal microservice -GRAPH_CONTAINER_NAME=$(${DOCKER_COMPOSE_CMD} up -d aai-traversal.api.simpledemo.openecomp.org 2>&1 | grep 'Creating' | awk '{ print $2; }' | head -1); -wait_for_container ${GRAPH_CONTAINER_NAME} '0.0.0.0:8446'; +USER_EXISTS=$(check_if_user_exists aaiadmin); -# Start the haproxy to route requests between resources and traversal -HAPROXY_CONTAINER_NAME=$(${DOCKER_COMPOSE_CMD} up -d aai.api.simpledemo.openecomp.org 2>&1 |grep 'Creating' | grep -v 'volume' | grep -v 'network' | awk '{ print $2; }' | head -1); +function check_if_user_exists(){ + local user_id=$1; -echo "A&AI Microservices, resources and traversal, are up and running along with HAProxy"; + if [ -z "$user_id" ]; then + echo "Needs to provide at least one argument for check_if_user_exists func"; + exit 1; + fi; -docker exec $GRAPH_CONTAINER_NAME "/opt/app/aai-traversal/scripts/install/updateQueryData.sh" && { - echo "Successfully loaded the widget related data into db"; -} || { - echo "Unable to load widget related data into db"; + id -u ${user_id} > /dev/null 2>&1 && { + echo "1"; + } || { + echo "0"; + } } + +if [ "${USER_EXISTS}" -eq 0 ]; then + export USER_ID=9000; +else + export USER_ID=$(id -u aaiadmin); +fi; + +RESOURCES_CONTAINER_NAME=$(${DOCKER_COMPOSE_CMD} up -d aai-resources.api.simpledemo.openecomp.org 2>&1 | grep 'Creating' | grep -v 'volume' | grep -v 'network' | awk '{ print $2; }' | head -1); +wait_for_container ${RESOURCES_CONTAINER_NAME} '0.0.0.0:8447'; + +docker logs ${RESOURCES_CONTAINER_NAME}; + +${DOCKER_COMPOSE_CMD} up -d aai-traversal.api.simpledemo.openecomp.org aai.api.simpledemo.openecomp.org +echo "A&AI Microservices, resources and traversal, are up and running along with HAProxy"; # Set the host ip for robot from the haproxy ROBOT_VARIABLES="-v HOST_IP:`ip addr show docker0 | head -3 | tail -1 | cut -d' ' -f6 | cut -d'/' -f1`" |