aboutsummaryrefslogtreecommitdiffstats
path: root/test/csit/plans
diff options
context:
space:
mode:
authorSinghsumalee, Pete (ps2418) <petes@att.com>2017-09-25 14:13:15 -0500
committerVenkata Harish K Kajur <vk250x@att.com>2017-09-29 00:22:18 +0000
commit56bb06b065db80f838eadfe945b1b7cfcaa1bfb4 (patch)
treecaab8c004d8b518cfc669bcee3143dac401a8573 /test/csit/plans
parent065d88d2ef8d7cfa7b38d2a6e53329524a198591 (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')
-rw-r--r--test/csit/plans/aai/resources/docker-compose.yml3
-rw-r--r--test/csit/plans/aai/resources/setup.sh44
-rw-r--r--test/csit/plans/aai/traversal/setup.sh1
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;