diff options
Diffstat (limited to 'test/csit/plans')
10 files changed, 108 insertions, 52 deletions
diff --git a/test/csit/plans/aai/resources/setup.sh b/test/csit/plans/aai/resources/setup.sh index ee2046078..30b4b29b8 100644 --- a/test/csit/plans/aai/resources/setup.sh +++ b/test/csit/plans/aai/resources/setup.sh @@ -24,16 +24,14 @@ NEXUS_PASSWD=$(cat /opt/config/nexus_password.txt) NEXUS_DOCKER_REPO=$(cat /opt/config/nexus_docker_repo.txt) DOCKER_IMAGE_VERSION=$(cat /opt/config/docker_version.txt) DOCKER_REGISTRY=${NEXUS_DOCKER_REPO} -DOCKER_IMAGE_VERSION=$(cat /opt/config/docker_version.txt) - -docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO +DOCKER_IMAGE_VERSION=1.1-STAGING-latest function wait_for_container() { CONTAINER_NAME="$1"; START_TEXT="$2"; - TIMEOUT=160 + TIMEOUT=240 # wait for the real startup AMOUNT_STARTUP=$(docker logs ${CONTAINER_NAME} 2>&1 | grep "$START_TEXT" | wc -l) @@ -43,6 +41,7 @@ function wait_for_container() { AMOUNT_STARTUP=$(docker logs ${CONTAINER_NAME} 2>&1 | grep "$START_TEXT" | wc -l) if [ "$TIMEOUT" = "0" ]; then + docker logs ${CONTAINER_NAME}; echo "ERROR: $CONTAINER_NAME deployment failed." exit 1 fi @@ -54,6 +53,7 @@ function wait_for_container() { DOCKER_COMPOSE_CMD="docker-compose"; export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1); export DOCKER_REGISTRY="nexus3.onap.org:10001"; +export AAI_HAPROXY_IMAGE="${AAI_HAPROXY_IMAGE:-aaionap/haproxy}"; export HBASE_IMAGE="${HBASE_IMAGE:-harisekhon/hbase}"; docker pull ${DOCKER_REGISTRY}/openecomp/aai-resources:${DOCKER_IMAGE_VERSION}; @@ -74,9 +74,10 @@ wait_for_container ${HBASE_CONTAINER_NAME} ' Started SelectChannelConnector@0.0. # 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); +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'; # Start the haproxy to route requests between resources and traversal @@ -84,12 +85,11 @@ HAPROXY_CONTAINER_NAME=$(${DOCKER_COMPOSE_CMD} up -d aai.api.simpledemo.openecom echo "A&AI Microservices, resources and traversal, are up and running along with HAProxy"; -docker exec -it $GRAPH_CONTAINER_NAME "/opt/app/aai-traversal/scripts/install/updateQueryData.sh" && { +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"; } -HAPROXY_IP=$(${SCRIPTS}/get-instance-ip.sh ${HAPROXY_CONTAINER_NAME}); # Set the host ip for robot from the haproxy -ROBOT_VARIABLES="-v HOST_IP:${HAPROXY_IP}" +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/appc/healthcheck/db_query.sh b/test/csit/plans/appc/healthcheck/db_query.sh new file mode 100755 index 000000000..87e0ac397 --- /dev/null +++ b/test/csit/plans/appc/healthcheck/db_query.sh @@ -0,0 +1,66 @@ +#!/usr/bin/env bash +############################################################################### +# Copyright 2017 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +############################################################################### +SCRIPTS="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +echo $SCRIPTS + +sdnctl_num_tables=$(docker exec -i sdnc_db_container mysql -s -D sdnctl -u sdnctl -pgamma <<<'show tables;' 2>/dev/null | grep -v ERROR | wc -l) + +appcctl_num_tables=$(docker exec -i sdnc_db_container mysql -s -D appcctl -u appcctl -pappcctl <<<'show tables;' 2>/dev/null | grep -v ERROR | wc -l) + + + +docker exec -i sdnc_db_container mysql -s -D sdnctl -u sdnctl -pgamma <<<"show tables" 2>/dev/null | ( while read table_name; do +export $table_name="$(docker exec -i sdnc_db_container mysql -s -D sdnctl -u sdnctl -pgamma <<<"select count(*) from $table_name" 2>/dev/null)" +done + +if [ "$sdnctl_num_tables" -ge "1" ]; then + echo "There are $sdnctl_num_tables tables in the sdnctl database. " +else + echo "Database sdnctl is not available." + exit 1; +fi + +if [ "$appcctl_num_tables" -ge "1" ]; then + echo "There is $appcctl_num_tables table in the appcctl database. " +else + echo "Database appcctl is not available." + exit 1; +fi + +if [ "$NODE_TYPES" -eq "0" ]; then + echo "There is no data in table NODE_TYPES. " + exit 1; +fi + +if [ "$SVC_LOGIC" -eq "0" ] ; then + echo "There is no data in table SVC_LOGIC. " + exit 1; +fi + +if [ "$VNF_DG_MAPPING" -eq "0" ]; then + echo "There is no data in table VNF_DG_MAPPING. " + exit 1; +fi + +echo "Expected table data is present." +exit 0 ) + +if [ "$?" -eq "1" ]; then + exit 1; +fi + +exit 0 diff --git a/test/csit/plans/appc/healthcheck/setup.sh b/test/csit/plans/appc/healthcheck/setup.sh index b91baa3a9..3c57cefac 100755 --- a/test/csit/plans/appc/healthcheck/setup.sh +++ b/test/csit/plans/appc/healthcheck/setup.sh @@ -22,6 +22,10 @@ source ${WORKSPACE}/test/csit/scripts/appc/script1.sh export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1) +if [ "$MTU" == "" ]; then + export MTU="1450" +fi + # Clone APPC repo to get docker-compose for APPC mkdir -p $WORKSPACE/archives/appc @@ -42,7 +46,7 @@ docker pull nexus3.onap.org:10001/openecomp/dgbuilder-sdnc-image:1.1-STAGING-lat docker tag nexus3.onap.org:10001/openecomp/dgbuilder-sdnc-image:1.1-STAGING-latest openecomp/dgbuilder-sdnc-image:latest # start APPC containers with docker compose and configuration from docker-compose.yml -/opt/docker/docker-compose up -d +docker-compose up -d # WAIT 5 minutes maximum and test every 5 seconds if APPC is up using HealthCheck API TIME_OUT=500 diff --git a/test/csit/plans/msb/rest-service/setup.sh b/test/csit/plans/msb/rest-service/setup.sh index 18b17ff8f..9682cde74 100644 --- a/test/csit/plans/msb/rest-service/setup.sh +++ b/test/csit/plans/msb/rest-service/setup.sh @@ -18,20 +18,20 @@ source ${SCRIPTS}/common_functions.sh #start msb -sudo docker run -d -p 8500:8500 --name msb_consul consul +docker run -d -p 8500:8500 --name msb_consul consul MSB_CONSUL_IP=`get-instance-ip.sh msb_consul` echo MSB_CONSUL_IP=${MSB_CONSUL_IP} -sudo docker run -d -p 10081:10081 -e CONSUL_IP=$MSB_CONSUL_IP --name msb_discovery nexus3.onap.org:10001/onap/msb/msb_discovery +docker run -d -p 10081:10081 -e CONSUL_IP=$MSB_CONSUL_IP --name msb_discovery nexus3.onap.org:10001/onap/msb/msb_discovery MSB_DISCOVERY_IP=`get-instance-ip.sh msb_discovery` echo DISCOVERY_IP=${MSB_DISCOVERY_IP} -sudo docker run -d -p 80:80 -e CONSUL_IP=$MSB_CONSUL_IP -e SDCLIENT_IP=$MSB_DISCOVERY_IP -e "ROUTE_LABELS=visualRange:1" --name msb_internal_apigateway nexus3.onap.org:10001/onap/msb/msb_apigateway +docker run -d -p 80:80 -e CONSUL_IP=$MSB_CONSUL_IP -e SDCLIENT_IP=$MSB_DISCOVERY_IP -e "ROUTE_LABELS=visualRange:1" --name msb_internal_apigateway nexus3.onap.org:10001/onap/msb/msb_apigateway MSB_IAG_IP=`get-instance-ip.sh msb_internal_apigateway` echo MSB_IAG_IP=${MSB_IAG_IP} # Start rest example service -sudo docker run -d -p 9090:9090 --name i-rest-example zhaohuabing/rest-example +docker run -d -p 9090:9090 --name i-rest-example zhaohuabing/rest-example REST_EXAMPLE_IP=`get-instance-ip.sh i-rest-example` echo REST_EXAMPLE_IP=${REST_EXAMPLE_IP} @@ -43,7 +43,7 @@ for i in {1..10}; do sleep $i done -#Need some time so service info can be synced from discovery to api gateway +#Need some time for the initialization of MSB services sleep 60 curl -X POST \ diff --git a/test/csit/plans/vfc-nfvo-driver-vnfm-gvnfm/sanity-check/setup.sh b/test/csit/plans/vfc-nfvo-driver-vnfm-gvnfm/sanity-check/setup.sh index c5c9f12cd..2a364a407 100644 --- a/test/csit/plans/vfc-nfvo-driver-vnfm-gvnfm/sanity-check/setup.sh +++ b/test/csit/plans/vfc-nfvo-driver-vnfm-gvnfm/sanity-check/setup.sh @@ -45,30 +45,23 @@ sleep 60 docker run -d --name vfc-gvnfmdriver -e MSB_ADDR=${MSB_DISCOVERY_IP}:10081 nexus3.onap.org:10001/onap/vfc/gvnfmdriver GVNFMDRIVER_IP=`get-instance-ip.sh vfc-gvnfmdriver` -docker logs -f vfc-gvnfmdriver > vfc-gvnfmdriver & # Wait for initialization for i in {1..10}; do curl -sS ${GVNFMDRIVER_IP}:8484 && break echo sleep $i sleep $i done -cat vfc-gvnfmdriver.log -echo "================================================" -docker cp vfc-gvnfmdriver:/service/vfc/nfvo/driver/vnfm/gvnfm/gvnfmadapter/docker/docker-entrypoint.sh ./ -cat docker-entrypoint.sh +# start vfc-jujudriver +docker run -d --name vfc-jujudriver -e MSB_ADDR=${MSB_DISCOVERY_IP}:10081 nexus3.onap.org:10001/onap/vfc/jujudriver +JUJUDRIVER_IP=`get-instance-ip.sh vfc-jujudriver` -echo "================================================" -docker cp vfc-gvnfmdriver:/service/vfc/nfvo/driver/vnfm/gvnfm/gvnfmadapter/docker/instance_config.sh ./ -cat instance_config.sh - -echo "================================================" -docker cp vfc-gvnfmdriver:/service/vfc/nfvo/driver/vnfm/gvnfm/gvnfmadapter/docker/instance_init.sh ./ -cat instance_init.sh - -echo "================================================" -docker cp vfc-gvnfmdriver:/service/vfc/nfvo/driver/vnfm/gvnfm/gvnfmadapter/docker/instance_run.sh ./ -cat instance_run.sh +# Wait for initialization +for i in {1..10}; do + curl -sS ${JUJUDRIVER_IP}:8483 && break + echo sleep $i + sleep $i +done # Pass any variables required by Robot test suites in ROBOT_VARIABLES -ROBOT_VARIABLES="-v MSB_IAG_IP:${MSB_IAG_IP} -v MSB_DISCOVERY_IP:${MSB_DISCOVERY_IP} -v GVNFMDRIVER_IP:${GVNFMDRIVER_IP}" +ROBOT_VARIABLES="-v MSB_IAG_IP:${MSB_IAG_IP} -v MSB_DISCOVERY_IP:${MSB_DISCOVERY_IP} -v GVNFMDRIVER_IP:${GVNFMDRIVER_IP} -v JUJUDRIVER_IP:${JUJUDRIVER_IP}" diff --git a/test/csit/plans/vfc-nfvo-driver-vnfm-gvnfm/sanity-check/teardown.sh b/test/csit/plans/vfc-nfvo-driver-vnfm-gvnfm/sanity-check/teardown.sh index a55050251..78d7c5ad9 100644 --- a/test/csit/plans/vfc-nfvo-driver-vnfm-gvnfm/sanity-check/teardown.sh +++ b/test/csit/plans/vfc-nfvo-driver-vnfm-gvnfm/sanity-check/teardown.sh @@ -21,4 +21,4 @@ kill-instance.sh msb_discovery kill-instance.sh msb_consul kill-instance.sh vfc-gvnfmdriver -# kill-instance.sh vfc-jujudriver +kill-instance.sh vfc-jujudriver diff --git a/test/csit/plans/vfc-nfvo-driver-vnfm-gvnfm/sanity-check/testplan.txt b/test/csit/plans/vfc-nfvo-driver-vnfm-gvnfm/sanity-check/testplan.txt index 7cca2fbe5..e7bee519b 100644 --- a/test/csit/plans/vfc-nfvo-driver-vnfm-gvnfm/sanity-check/testplan.txt +++ b/test/csit/plans/vfc-nfvo-driver-vnfm-gvnfm/sanity-check/testplan.txt @@ -3,4 +3,4 @@ vfc/nfvo-driver-gvnfm/gvnfmdriver.robot -# vfc/nfvo-driver-gvnfm/jujudriver.robot +vfc/nfvo-driver-gvnfm/jujudriver.robot diff --git a/test/csit/plans/vfc-nfvo-driver-vnfm-svnfm/sanity-check/setup.sh b/test/csit/plans/vfc-nfvo-driver-vnfm-svnfm/sanity-check/setup.sh index de4fbd266..8eb205b0b 100644 --- a/test/csit/plans/vfc-nfvo-driver-vnfm-svnfm/sanity-check/setup.sh +++ b/test/csit/plans/vfc-nfvo-driver-vnfm-svnfm/sanity-check/setup.sh @@ -41,34 +41,27 @@ done # wait for container initalization echo sleep 60 sleep 60 + # start vfc-ztevmanagerdriver docker run -d --name vfc-ztevmanagerdriver -e MSB_ADDR=${MSB_DISCOVERY_IP}:10081 nexus3.onap.org:10001/onap/vfc/ztevmanagerdriver ZTEVMANAGERDRIVER_IP=`get-instance-ip.sh vfc-ztevmanagerdriver` -docker logs -f vfc-ztevmanagerdriver > vfc-ztevmanagerdriver & # Wait for initialization for i in {1..10}; do curl -sS ${ZTEVMANAGERDRIVER_IP}:8410 && break echo sleep $i sleep $i done -cat vfc-ztevmanagerdriver.log - -echo "================================================" -docker cp vfc-ztevmanagerdriver:/service/vfc/nfvo/driver/vnfm/svnfm/zte/vmanager/docker/docker-entrypoint.sh ./ -cat docker-entrypoint.sh -echo "================================================" -docker cp vfc-ztevmanagerdriver:/service/vfc/nfvo/driver/vnfm/svnfm/zte/vmanager/docker/instance_config.sh ./ -cat instance_config.sh -echo "================================================" -docker cp vfc-ztevmanagerdriver:/service/vfc/nfvo/driver/vnfm/svnfm/zte/vmanager/docker/instance_init.sh ./ -cat instance_init.sh - -echo "================================================" -docker cp vfc-ztevmanagerdriver:/service/vfc/nfvo/driver/vnfm/svnfm/zte/vmanager/docker/instance_run.sh ./ -cat instance_run.sh +# Start svnfm-huawei +docker run -d --name vfc-svnfm-huawei -e MSB_ADDR=${MSB_IAG_IP}:80 nexus3.onap.org:10001/onap/vfc/nfvo/svnfm/huawei +SERVICE_IP=`get-instance-ip.sh vfc-svnfm-huawei` +for i in {1..10}; do + curl -sS ${SERVICE_IP}:8482 && break + echo sleep $i + sleep $i +done # Pass any variables required by Robot test suites in ROBOT_VARIABLES -ROBOT_VARIABLES="-v MSB_IAG_IP:${MSB_IAG_IP} -v MSB_DISCOVERY_IP:${MSB_DISCOVERY_IP} -v ZTEVMANAGERDRIVER_IP:${ZTEVMANAGERDRIVER_IP}" +ROBOT_VARIABLES="-v MSB_IAG_IP:${MSB_IAG_IP} -v MSB_DISCOVERY_IP:${MSB_DISCOVERY_IP} -v ZTEVMANAGERDRIVER_IP:${ZTEVMANAGERDRIVER_IP} -v MSB_IP:${MSB_IAG_IP} -v SERVICE_IP:${SERVICE_IP}" diff --git a/test/csit/plans/vfc-nfvo-driver-vnfm-svnfm/sanity-check/teardown.sh b/test/csit/plans/vfc-nfvo-driver-vnfm-svnfm/sanity-check/teardown.sh index 1020cf1af..e440068fb 100644 --- a/test/csit/plans/vfc-nfvo-driver-vnfm-svnfm/sanity-check/teardown.sh +++ b/test/csit/plans/vfc-nfvo-driver-vnfm-svnfm/sanity-check/teardown.sh @@ -21,4 +21,4 @@ kill-instance.sh msb_discovery kill-instance.sh msb_consul kill-instance.sh vfc-ztevmanagerdriver -# kill-instance.sh vfc-svnfm-huawei +kill-instance.sh vfc-svnfm-huawei diff --git a/test/csit/plans/vfc-nfvo-driver-vnfm-svnfm/sanity-check/testplan.txt b/test/csit/plans/vfc-nfvo-driver-vnfm-svnfm/sanity-check/testplan.txt index e5691f4b8..7eb861eda 100644 --- a/test/csit/plans/vfc-nfvo-driver-vnfm-svnfm/sanity-check/testplan.txt +++ b/test/csit/plans/vfc-nfvo-driver-vnfm-svnfm/sanity-check/testplan.txt @@ -3,4 +3,4 @@ vfc/nfvo-driver-svnfm/ztevmanager.robot -# vfc/nfvo-driver-svnfm/huawei.robot +vfc/nfvo-driver-svnfm/huawei.robot |