diff options
author | Gary Wu <gary.i.wu@huawei.com> | 2017-09-29 03:37:29 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-09-29 03:37:29 +0000 |
commit | 8534458b0fe4e9e87dad0e2c92ac17d989054403 (patch) | |
tree | 2d9d5845b0da3fedb954c28254181c2cb8b34c66 /test/csit/plans/aai | |
parent | 2fa433ee517d7c1778e88f72e608e94a81286b97 (diff) | |
parent | 56bb06b065db80f838eadfe945b1b7cfcaa1bfb4 (diff) |
Merge "Added 2 more resources test cases"
Diffstat (limited to 'test/csit/plans/aai')
-rw-r--r-- | test/csit/plans/aai/resources/docker-compose.yml | 3 | ||||
-rw-r--r-- | test/csit/plans/aai/resources/setup.sh | 44 | ||||
-rw-r--r-- | test/csit/plans/aai/traversal/setup.sh | 1 |
3 files changed, 32 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`" diff --git a/test/csit/plans/aai/traversal/setup.sh b/test/csit/plans/aai/traversal/setup.sh index 80eace0dd..010b0352e 100644 --- a/test/csit/plans/aai/traversal/setup.sh +++ b/test/csit/plans/aai/traversal/setup.sh @@ -58,6 +58,7 @@ export HBASE_IMAGE="${HBASE_IMAGE:-aaionap/hbase}"; export HBASE_VERSION="${HBASE_VERSION:-1.2.0}"; 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; |