diff options
Diffstat (limited to 'test/csit')
66 files changed, 2085 insertions, 362 deletions
diff --git a/test/csit/plans/aaf/aafapi/setup.sh b/test/csit/plans/aaf/aafapi/setup.sh new file mode 100644 index 000000000..bfaff925c --- /dev/null +++ b/test/csit/plans/aaf/aafapi/setup.sh @@ -0,0 +1,72 @@ +#!/bin/bash +# +# ============LICENSE_START======================================================= +# ONAP AAF +# ================================================================================ +# Copyright (C) 2017 AT&T Intellectual Property. All rights +# reserved. +# ================================================================================ +# 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. +# ============LICENSE_END============================================ +# =================================================================== +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +# Place the scripts in run order: +source ${SCRIPTS}/common_functions.sh + +# Clone AAF Authz repo +mkdir -p $WORKSPACE/archives/aafcsit +cd $WORKSPACE/archives/aafcsit +#unset http_proxy https_proxy +git clone --depth 1 http://gerrit.onap.org/r/aaf/authz -b master +git pull +cd $WORKSPACE/archives/aafcsit/authz/authz-service/src/main/resources/docker-compose +pwd +chmod -R 777 $WORKSPACE/archives/aafcsit/authz/authz-service/src/main/resources/docker-compose + + +# start aaf containers with docker compose and configuration from docker-compose.yml +docker-compose up -d + +# Wait for initialization of Docker contaienr for AAF & Cassandra +for i in {1..50}; do + if [ $(docker inspect --format '{{ .State.Running }}' dockercompose_aaf_container_1) ] && \ + [ $(docker inspect --format '{{ .State.Running }}' dockercompose_cassandra_container_1) ] && \ + [ $(docker inspect --format '{{ .State.Running }}' dockercompose_aaf_container_1) ] + then + echo "AAF Service Running" + break + else + echo sleep $i + sleep $i + fi +done + + +AAF_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dockercompose_aaf_container_1) +CASSANDRA_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dockercompose_cassandra_container_1) + + +echo AAF_IP=${AAF_IP} +echo CASSANDRA_IP=${CASSANDRA_IP} + + +# Wait for initialization of docker services +for i in {1..50}; do + curl -sS -m 1 ${AAF_IP}:8101 && break + echo sleep $i + sleep $i +done + +#Pass any variables required by Robot test suites in ROBOT_VARIABLES +ROBOT_VARIABLES="-v AAF_IP:${AAF_IP}" diff --git a/test/csit/plans/aaf/aafapi/teardown.sh b/test/csit/plans/aaf/aafapi/teardown.sh new file mode 100644 index 000000000..1f7b2853d --- /dev/null +++ b/test/csit/plans/aaf/aafapi/teardown.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# +# Copyright 2016-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. +# +# Modifications copyright (c) 2017 AT&T Intellectual Property +# + +kill-instance.sh dockercompose_aaf_container_1 +kill-instance.sh dockercompose_cassandra_container_1 + diff --git a/test/csit/plans/aaf/aafapi/testplan.txt b/test/csit/plans/aaf/aafapi/testplan.txt new file mode 100644 index 000000000..ea18ca6d8 --- /dev/null +++ b/test/csit/plans/aaf/aafapi/testplan.txt @@ -0,0 +1,2 @@ +# Place the suites in run order. +aaf/aafapi diff --git a/test/csit/plans/appc/healthcheck/bundle_query.sh b/test/csit/plans/appc/healthcheck/bundle_query.sh index f163ce5c2..45a92ea31 100755 --- a/test/csit/plans/appc/healthcheck/bundle_query.sh +++ b/test/csit/plans/appc/healthcheck/bundle_query.sh @@ -24,7 +24,7 @@ failed_bundles=$(docker exec appc_controller_container /opt/opendaylight/current echo "There are $num_failed_bundles failed bundles out of $num_bundles installed bundles." -if [ "$num_failed_bundles" -ge 1 ] || [ $num_bundles -le 400 ]; then +if [ "$num_failed_bundles" -ge 1 ] || [ "$num_bundles" == "" ]; then echo "There are $num_bundles bundles with $num_failed_bundles in a failed state. " echo "The following bundle(s) are in a failed state: " echo " $failed_bundles" diff --git a/test/csit/plans/appc/healthcheck/setup.sh b/test/csit/plans/appc/healthcheck/setup.sh index eaf488a65..8798e561a 100755 --- a/test/csit/plans/appc/healthcheck/setup.sh +++ b/test/csit/plans/appc/healthcheck/setup.sh @@ -24,7 +24,8 @@ export NEXUS_USERNAME=docker export NEXUS_PASSWD=docker export NEXUS_DOCKER_REPO=nexus3.onap.org:10001 export DMAAP_TOPIC=AUTO -export DOCKER_IMAGE_VERSION=1.1.0-SNAPSHOT-latest +export APPC_DOCKER_IMAGE_VERSION=1.1-STAGING-latest +export CCSDK_DOCKER_IMAGE_VERSION=0.1-STAGING-latest export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1) @@ -39,54 +40,27 @@ cd $WORKSPACE/archives git clone -b master --single-branch http://gerrit.onap.org/r/appc/deployment.git appc cd $WORKSPACE/archives/appc git pull -unset http_proxy https_proxy cd $WORKSPACE/archives/appc/docker-compose - sed -i "s/DMAAP_TOPIC_ENV=.*/DMAAP_TOPIC_ENV="$DMAAP_TOPIC"/g" docker-compose.yml docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO - -docker pull $NEXUS_DOCKER_REPO/openecomp/appc-image:$DOCKER_IMAGE_VERSION -docker tag $NEXUS_DOCKER_REPO/openecomp/appc-image:$DOCKER_IMAGE_VERSION openecomp/appc-image:latest - -docker pull $NEXUS_DOCKER_REPO/onap/ccsdk-dgbuilder-image:latest -docker tag $NEXUS_DOCKER_REPO/onap/ccsdk-dgbuilder-image:latest onap/ccsdk-dgbuilder-image:latest - +docker pull $NEXUS_DOCKER_REPO/openecomp/appc-image:$APPC_DOCKER_IMAGE_VERSION +docker tag $NEXUS_DOCKER_REPO/openecomp/appc-image:$APPC_DOCKER_IMAGE_VERSION openecomp/appc-image:latest +docker pull $NEXUS_DOCKER_REPO/onap/ccsdk-dgbuilder-image:$CCSDK_DOCKER_IMAGE_VERSION +docker tag $NEXUS_DOCKER_REPO/onap/ccsdk-dgbuilder-image:$CCSDK_DOCKER_IMAGE_VERSION onap/ccsdk-dgbuilder-image:latest # start APPC containers with docker compose and configuration from docker-compose.yml docker-compose up -d - # WAIT 5 minutes maximum and test every 5 seconds if APPC is up using HealthCheck API -TIME_OUT=500 +TIME_OUT=2000 INTERVAL=30 TIME=0 while [ "$TIME" -lt "$TIME_OUT" ]; do - response=$(curl --write-out '%{http_code}' --silent --output /dev/null -H "Authorization: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==" -X POST -H "X-FromAppId: csit-appc" -H "X-TransactionId: csit-appc" -H "Accept: application/json" -H "Content-Type: application/json" http://localhost:8282/restconf/operations/SLI-API:healthcheck ); echo $response - - if [ "$response" == "200" ]; then - echo APPC started in $TIME seconds - break; - fi - - echo Sleep: $INTERVAL seconds before testing if APPC is up. Total wait time up now is: $TIME seconds. Timeout is: $TIME_OUT seconds - sleep $INTERVAL - TIME=$(($TIME+$INTERVAL)) -done - -if [ "$TIME" -ge "$TIME_OUT" ]; then - echo TIME OUT: Docker containers not started in $TIME_OUT seconds... Could cause problems for testing activities... -fi - -#sleep 800 - -TIME_OUT=1000 -INTERVAL=60 -TIME=0 -while [ "$TIME" -lt "$TIME_OUT" ]; do -response=$(docker exec appc_controller_container /opt/opendaylight/current/bin/client -u karaf system:start-level) -num_bundles=$(docker exec appc_controller_container /opt/opendaylight/current/bin/client -u karaf bundle:list | tail -1 | cut -d\| -f1) +startODL_status=$(docker exec appc_controller_container ps -e | grep startODL | wc -l) +waiting_bundles=$(docker exec appc_controller_container /opt/opendaylight/current/bin/client -u karaf bundle:list | grep Waiting | wc -l) +run_level=$(docker exec appc_controller_container /opt/opendaylight/current/bin/client -u karaf system:start-level) - if [ "$response" == "Level 100" ] && [ "$num_bundles" -ge 400 ]; then - echo APPC karaf started in $TIME seconds + if [ "$run_level" == "Level 100" ] && [ "$startODL_status" -lt "1" ] && [ "$waiting_bundles" -lt "1" ] ; then + echo APPC started in $TIME seconds break; fi @@ -96,30 +70,10 @@ num_bundles=$(docker exec appc_controller_container /opt/opendaylight/current/bi done if [ "$TIME" -ge "$TIME_OUT" ]; then - echo TIME OUT: karaf session not started in $TIME_OUT seconds... Could cause problems for testing activities... + echo TIME OUT: Docker containers not started in $TIME_OUT seconds... Could cause problems for testing activities... fi -response=$(docker exec appc_controller_container /opt/opendaylight/current/bin/client -u karaf system:start-level) -num_bundles=$(docker exec appc_controller_container /opt/opendaylight/current/bin/client -u karaf bundle:list | tail -1 | cut -d\| -f1) - - if [ "$response" == "Level 100" ] && [ "$num_bundles" -ge 400 ]; then - num_bundles=$(docker exec appc_controller_container /opt/opendaylight/current/bin/client -u karaf bundle:list | tail -1 | cut -d\| -f1) - num_failed_bundles=$(docker exec appc_controller_container /opt/opendaylight/current/bin/client -u karaf bundle:list | grep Failure | wc -l) - failed_bundles=$(docker exec appc_controller_container /opt/opendaylight/current/bin/client -u karaf bundle:list | grep Failure) - echo There is/are $num_failed_bundles failed bundles out of $num_bundles installed bundles. - fi - -if [ "$num_failed_bundles" -ge 1 ]; then - echo "The following bundle(s) are in a failed state: " - echo " $failed_bundles" -fi +sleep 300 # Pass any variables required by Robot test suites in ROBOT_VARIABLES ROBOT_VARIABLES="-v SCRIPTS:${SCRIPTS}" - -if [ "$response" == "" ] || [ "$num_bundles" == "" ]; then - echo "Docker container appc_controller_container is not available. Exiting." - exit 1 -fi - - diff --git a/test/csit/plans/ccsdk/healthcheck/health_check.sh b/test/csit/plans/ccsdk/healthcheck/health_check.sh index db5795eae..ffc766fe9 100644 --- a/test/csit/plans/ccsdk/healthcheck/health_check.sh +++ b/test/csit/plans/ccsdk/healthcheck/health_check.sh @@ -17,7 +17,9 @@ SCRIPTS="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" echo $SCRIPTS -response=$(curl --write-out '%{http_code}' --silent --output /dev/null -H "Authorization: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==" -X POST -H "X-FromAppId: csit-sdnc" -H "X-TransactionId: csit-ccsdk" -H "Accept: application/json" -H "Content-Type: application/json" http://localhost:8282/restconf/operations/SLI-API:healthcheck ) +unset http_proxy https_proxy + +response=$(curl --write-out '%{http_code}' --silent --output /dev/null -H "Authorization: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==" -X POST -H "X-FromAppId: csit-sdnc" -H "X-TransactionId: csit-ccsdk" -H "Accept: application/json" -H "Content-Type: application/json" http://localhost:8383/restconf/operations/SLI-API:healthcheck ) if [ "$response" == "200" ]; then echo "CCSDK health check passed." diff --git a/test/csit/plans/ccsdk/healthcheck/setup.sh b/test/csit/plans/ccsdk/healthcheck/setup.sh index babfe3eb1..78b4ff006 100644 --- a/test/csit/plans/ccsdk/healthcheck/setup.sh +++ b/test/csit/plans/ccsdk/healthcheck/setup.sh @@ -22,6 +22,11 @@ source ${WORKSPACE}/test/csit/scripts/ccsdk/script1.sh export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1) export NEXUS_DOCKER_REPO="nexus3.onap.org:10001" +export NEXUS_USERNAME=docker +export NEXUS_PASSWD=docker +export DMAAP_TOPIC=AUTO +export CCSDK_DOCKER_IMAGE_VERSION=0.1-STAGING-latest + if [ "$MTU" == "" ]; then export MTU="1450" fi @@ -37,16 +42,16 @@ unset http_proxy https_proxy cd $WORKSPACE/archives/ccsdk/src/main/yaml sed -i "s/DMAAP_TOPIC_ENV=.*/DMAAP_TOPIC_ENV="AUTO"/g" docker-compose.yml -docker login -u docker -p docker nexus3.onap.org:10001 +docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO -docker pull nexus3.onap.org:10001/onap/ccsdk-odl-image:0.1-STAGING-latest -docker tag nexus3.onap.org:10001/onap/ccsdk-odl-image:latest onap/ccsdk-odl-image:0.1-STAGING-latest +docker pull $NEXUS_DOCKER_REPO/onap/ccsdk-odl-image:$CCSDK_DOCKER_IMAGE_VERSION +docker tag $NEXUS_DOCKER_REPO/onap/ccsdk-odl-image:$CCSDK_DOCKER_IMAGE_VERSION onap/ccsdk-odl-image:0.1-STAGING-latest -docker pull nexus3.onap.org:10001/onap/ccsdk-dgbuilder-image:0.1-STAGING-latest -docker tag nexus3.onap.org:10001/onap/ccsdk-dgbuilder-image:latest onap/ccsdk-dgbuilder-image:0.1-STAGING-latest +docker pull $NEXUS_DOCKER_REPO/onap/ccsdk-dgbuilder-image:$CCSDK_DOCKER_IMAGE_VERSION +docker tag $NEXUS_DOCKER_REPO/onap/ccsdk-dgbuilder-image:$CCSDK_DOCKER_IMAGE_VERSION onap/ccsdk-dgbuilder-image:0.1-STAGING-latest -docker pull nexus3.onap.org:10001/onap/ccsdk-odlsli-image:0.1-STAGING-latest -docker tag nexus3.onap.org:10001/onap/ccsdk-odlsli-image:latest onap/ccsdk-odlsli-image:0.1-STAGING-latest +docker pull $NEXUS_DOCKER_REPO/onap/ccsdk-odlsli-image:$CCSDK_DOCKER_IMAGE_VERSION +docker tag $NEXUS_DOCKER_REPO/onap/ccsdk-odlsli-image:$CCSDK_DOCKER_IMAGE_VERSION onap/ccsdk-odlsli-image:0.1-STAGING-latest # start CCSDK containers with docker compose and configuration from docker-compose.yml curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > docker-compose @@ -58,7 +63,7 @@ TIME_OUT=500 INTERVAL=30 TIME=0 while [ "$TIME" -lt "$TIME_OUT" ]; do - response=$(curl --write-out '%{http_code}' --silent --output /dev/null -H "Authorization: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==" -X POST -H "X-FromAppId: csit-ccsdk" -H "X-TransactionId: csit-ccsdk" -H "Accept: application/json" -H "Content-Type: application/json" http://localhost:8282/restconf/operations/SLI-API:healthcheck ); echo $response + response=$(curl --write-out '%{http_code}' --silent --output /dev/null -H "Authorization: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==" -X POST -H "X-FromAppId: csit-ccsdk" -H "X-TransactionId: csit-ccsdk" -H "Accept: application/json" -H "Content-Type: application/json" http://localhost:8383/restconf/operations/SLI-API:healthcheck ); echo $response if [ "$response" == "200" ]; then echo CCSDK started in $TIME seconds @@ -81,10 +86,10 @@ INTERVAL=60 TIME=0 while [ "$TIME" -lt "$TIME_OUT" ]; do -response=$(docker exec ccsdk_bareodl_container /opt/opendaylight/current/bin/client -u karaf system:start-level) -num_bundles=$(docker exec ccsdk_bareodl_container /opt/opendaylight/current/bin/client -u karaf bundle:list | tail -1 | cut -d\| -f1) +response=$(docker exec ccsdk_odlsli_container /opt/opendaylight/current/bin/client -u karaf system:start-level) +num_bundles=$(docker exec ccsdk_odlsli_container /opt/opendaylight/current/bin/client -u karaf bundle:list | tail -1 | cut -d\| -f1) - if [ "$response" == "Level 100" ] && [ "$num_bundles" -ge 64 ]; then + if [ "$response" == "Level 100" ] && [ "$num_bundles" -ge 333 ]; then echo CCSDK karaf started in $TIME seconds break; fi @@ -98,13 +103,13 @@ if [ "$TIME" -ge "$TIME_OUT" ]; then echo TIME OUT: karaf session not started in $TIME_OUT seconds... Could cause problems for testing activities... fi -response=$(docker exec ccsdk_bareodl_container /opt/opendaylight/current/bin/client -u karaf system:start-level) -num_bundles=$(docker exec ccsdk_bareodl_container /opt/opendaylight/current/bin/client -u karaf bundle:list | tail -1 | cut -d\| -f1) +response=$(docker exec ccsdk_odlsli_container /opt/opendaylight/current/bin/client -u karaf system:start-level) +num_bundles=$(docker exec ccsdk_odlsli_container /opt/opendaylight/current/bin/client -u karaf bundle:list | tail -1 | cut -d\| -f1) - if [ "$response" == "Level 100" ] && [ "$num_bundles" -ge 64 ]; then - num_bundles=$(docker exec ccsdk_bareodl_container /opt/opendaylight/current/bin/client -u karaf bundle:list | tail -1 | cut -d\| -f1) - num_failed_bundles=$(docker exec ccsdk_bareodl_container /opt/opendaylight/current/bin/client -u karaf bundle:list | grep Failure | wc -l) - failed_bundles=$(docker exec ccsdk_bareodl_container /opt/opendaylight/current/bin/client -u karaf bundle:list | grep Failure) + if [ "$response" == "Level 100" ] && [ "$num_bundles" -ge 333 ]; then + num_bundles=$(docker exec ccsdk_odlsli_container /opt/opendaylight/current/bin/client -u karaf bundle:list | tail -1 | cut -d\| -f1) + num_failed_bundles=$(docker exec ccsdk_odlsli_container /opt/opendaylight/current/bin/client -u karaf bundle:list | grep Failure | wc -l) + failed_bundles=$(docker exec ccsdk_odlsli_container /opt/opendaylight/current/bin/client -u karaf bundle:list | grep Failure) echo There is/are $num_failed_bundles failed bundles out of $num_bundles installed bundles. fi diff --git a/test/csit/plans/ccsdk/healthcheck/teardown.sh b/test/csit/plans/ccsdk/healthcheck/teardown.sh index 60433f8ce..fbc0dfa42 100644 --- a/test/csit/plans/ccsdk/healthcheck/teardown.sh +++ b/test/csit/plans/ccsdk/healthcheck/teardown.sh @@ -18,7 +18,7 @@ # kill-instance.sh ccsdk_db_container -kill-instance.sh sdnc_dgbuilder_container +kill-instance.sh ccsdk_dgbuilder_container kill-instance.sh ccsdk_bareodl_container kill-instance.sh ccsdk_odlsli_container diff --git a/test/csit/plans/dcaegen2/testsuites/setup.sh b/test/csit/plans/dcaegen2/testsuites/setup.sh index 3068b5026..6692bb209 100755 --- a/test/csit/plans/dcaegen2/testsuites/setup.sh +++ b/test/csit/plans/dcaegen2/testsuites/setup.sh @@ -20,7 +20,6 @@ #get current host IP addres HOST_IP=$(ip route get 8.8.8.8 | awk '/8.8.8.8/ {print $NF}') -echo HOST_IP=${HOST_IP} VESC_IMAGE=nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.ves.vescollector:1.1 echo VESC_IMAGE=${VESC_IMAGE} @@ -30,9 +29,11 @@ docker run -d -p 8080:8080/tcp -p 8443:8443/tcp -P --name vesc -e DMAAPHOST=${HO VESC_IP=`get-instance-ip.sh vesc` export VESC_IP=${VESC_IP} +export HOST_IP=${HOST_IP} export ROBOT_VARIABLES="--pythonpath ${WORKSPACE}/test/csit/tests/dcaegen2/testcases/resources" +pip install jsonschema uuid # Wait container ready sleep 5 diff --git a/test/csit/plans/multicloud-vmware/functionality1/setup.sh b/test/csit/plans/multicloud-vmware/functionality1/setup.sh new file mode 100755 index 000000000..d71d5c423 --- /dev/null +++ b/test/csit/plans/multicloud-vmware/functionality1/setup.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# +# Copyright 2016-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. +# +# Place the scripts in run order: +# Start all process required for executing test case + +source ${SCRIPTS}/common_functions.sh + +# start multicloud-vio +docker run -d --name multicloud-vio nexus3.onap.org:10001/onap/multicloud/vio +VIO_IP=`get-instance-ip.sh multicloud-vio` +for i in {1..50}; do + curl -sS ${VIO_IP}:9004 && break + echo sleep $i + sleep $i +done + +echo SCRIPTS +# Pass any variables required by Robot test suites in ROBOT_VARIABLES +ROBOT_VARIABLES="-v VIO_IP:${VIO_IP} -v SCRIPTS:${SCRIPTS}" diff --git a/test/csit/plans/multicloud-vmware/functionality1/teardown.sh b/test/csit/plans/multicloud-vmware/functionality1/teardown.sh new file mode 100755 index 000000000..546e01261 --- /dev/null +++ b/test/csit/plans/multicloud-vmware/functionality1/teardown.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# +# Copyright 2016-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. +# + +# This script is sourced by run-csit.sh after Robot test completion. +kill-instance.sh multicloud-vio diff --git a/test/csit/plans/multicloud-vmware/functionality1/testplan.txt b/test/csit/plans/multicloud-vmware/functionality1/testplan.txt new file mode 100644 index 000000000..dae4b2e69 --- /dev/null +++ b/test/csit/plans/multicloud-vmware/functionality1/testplan.txt @@ -0,0 +1,7 @@ +# Test suites are relative paths under [integration.git]/test/csit/tests/. +# Place the suites in run order. +multicloud-vmware/provision/sanity_test_vio.robot +multicloud-vmware/provision/sanity_test_tenant.robot +multicloud-vmware/provision/sanity_test_image.robot +multicloud-vmware/provision/sanity_test_neutron.robot + diff --git a/test/csit/plans/portal/testsuite/portal b/test/csit/plans/portal/testsuite/portal deleted file mode 160000 -Subproject e65a5d4a4852cbd0056fb3b881613f0a4dba4ec diff --git a/test/csit/plans/sdc/healthCheck/setup.sh b/test/csit/plans/sdc/healthCheck/setup.sh index f247be656..3e4e66024 100644 --- a/test/csit/plans/sdc/healthCheck/setup.sh +++ b/test/csit/plans/sdc/healthCheck/setup.sh @@ -23,6 +23,10 @@ source ${WORKSPACE}/test/csit/scripts/sdc/clone_and_setup_sdc_data.sh source ${WORKSPACE}/test/csit/scripts/sdc/start_sdc_containers.sh +source ${WORKSPACE}/test/csit/scripts/sdc/docker_health.sh + +source ${WORKSPACE}/test/csit/scripts/sdc/start_sdc_sanity.sh + BE_IP=`get-instance-ip.sh sdc-BE` echo BE_IP=${BE_IP} diff --git a/test/csit/plans/sdnc/healthcheck/health_check.sh b/test/csit/plans/sdnc/healthcheck/health_check.sh index 96c99848a..e8b5056d4 100644 --- a/test/csit/plans/sdnc/healthcheck/health_check.sh +++ b/test/csit/plans/sdnc/healthcheck/health_check.sh @@ -17,6 +17,8 @@ SCRIPTS="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" echo $SCRIPTS +unset http_proxy https_proxy + response=$(curl --write-out '%{http_code}' --silent --output /dev/null -H "Authorization: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==" -X POST -H "X-FromAppId: csit-sdnc" -H "X-TransactionId: csit-sdnc" -H "Accept: application/json" -H "Content-Type: application/json" http://localhost:8282/restconf/operations/SLI-API:healthcheck ) if [ "$response" == "200" ]; then diff --git a/test/csit/plans/sdnc/healthcheck/setup.sh b/test/csit/plans/sdnc/healthcheck/setup.sh index 643d54fe9..3db43559a 100644 --- a/test/csit/plans/sdnc/healthcheck/setup.sh +++ b/test/csit/plans/sdnc/healthcheck/setup.sh @@ -20,6 +20,13 @@ SCRIPTS="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source ${WORKSPACE}/test/csit/scripts/sdnc/script1.sh +export NEXUS_USERNAME=docker +export NEXUS_PASSWD=docker +export NEXUS_DOCKER_REPO=nexus3.onap.org:10003 +export DMAAP_TOPIC=AUTO +export DOCKER_IMAGE_VERSION=1.2-STAGING-latest +export CCSDK_DOCKER_IMAGE_VERSION=0.1-STAGING-latest + export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1) if [ "$MTU" == "" ]; then @@ -37,16 +44,16 @@ unset http_proxy https_proxy cd $WORKSPACE/archives/sdnc/installation/src/main/yaml sed -i "s/DMAAP_TOPIC_ENV=.*/DMAAP_TOPIC_ENV="AUTO"/g" docker-compose.yml -docker login -u docker -p docker nexus3.onap.org:10001 +docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO -docker pull nexus3.onap.org:10001/onap/sdnc-image:latest -docker tag nexus3.onap.org:10001/onap/sdnc-image:latest onap/sdnc-image:latest +docker pull $NEXUS_DOCKER_REPO/onap/sdnc-image:$DOCKER_IMAGE_VERSION +docker tag $NEXUS_DOCKER_REPO/onap/sdnc-image:$DOCKER_IMAGE_VERSION onap/sdnc-image:latest -docker pull nexus3.onap.org:10001/onap/ccsdk-dgbuilder-image:latest -docker tag nexus3.onap.org:10001/onap/ccsdk-dgbuilder-image:latest onap/ccsdk-dgbuilder-image:latest +docker pull $NEXUS_DOCKER_REPO/onap/ccsdk-dgbuilder-image:$CCSDK_DOCKER_IMAGE_VERSION +docker tag $NEXUS_DOCKER_REPO/onap/ccsdk-dgbuilder-image:$CCSDK_DOCKER_IMAGE_VERSION onap/ccsdk-dgbuilder-image:latest -docker pull nexus3.onap.org:10001/onap/admportal-sdnc-image:latest -docker tag nexus3.onap.org:10001/onap/admportal-sdnc-image:latest onap/admportal-sdnc-image:latest +docker pull $NEXUS_DOCKER_REPO/onap/admportal-sdnc-image:$DOCKER_IMAGE_VERSION +docker tag $NEXUS_DOCKER_REPO/onap/admportal-sdnc-image:$DOCKER_IMAGE_VERSION onap/admportal-sdnc-image:latest # start SDNC containers with docker compose and configuration from docker-compose.yml curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > docker-compose diff --git a/test/csit/plans/usecase-ui-server/testsuite/setup.sh b/test/csit/plans/usecase-ui-server/testsuite/setup.sh new file mode 100644 index 000000000..b2641beca --- /dev/null +++ b/test/csit/plans/usecase-ui-server/testsuite/setup.sh @@ -0,0 +1,58 @@ +#!/bin/bash +# +# Copyright (C) 2017 CMCC, Inc. and others. All rights reserved. +# +# 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. +# +# Place the scripts in run order: +# Start all process required for executing test case + +source ${SCRIPTS}/common_functions.sh + +#start msb +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} + +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} + +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} + +# Wait for initialization(8500 Consul, 10081 Service Registration & Discovery, 80 api gateway) +for i in {1..10}; do + curl -sS -m 1 ${MSB_CONSUL_IP}:8500 && curl -sS -m 1 ${MSB_DISCOVERY_IP}:10081 && curl -sS -m 1 ${MSB_IAG_IP}:80 && break + echo sleep $i + sleep $i +done + +# Need some time for the initialization of MSB services +echo sleep 60 +sleep 60 + +# start usecase-ui-server +docker run -d --name usecase-ui-server -v /var/lib/mysql -e MSB_ADDR=${MSB_IAG_IP}:80 nexus3.onap.org:10001/onap/usecase-ui/usecase-ui-server +USECASEUI_IP=`get-instance-ip.sh usecase-ui-server` + +# Wait for initialization +for i in {1..10}; do + curl -sS -m 1 ${USECASEUI_IP}:8901 && 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 USECASEUI_IP:${USECASEUI_IP} -v SCRIPTS:${SCRIPTS}" diff --git a/test/csit/plans/usecase-ui-server/testsuite/teardown.sh b/test/csit/plans/usecase-ui-server/testsuite/teardown.sh new file mode 100644 index 000000000..46f5879b3 --- /dev/null +++ b/test/csit/plans/usecase-ui-server/testsuite/teardown.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# +# Copyright (C) 2017 CMCC, Inc. and others. All rights reserved. +# +# 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. +# + +# This script is sourced by run-csit.sh after Robot test completion. +kill-instance.sh msb_internal_apigateway +kill-instance.sh msb_discovery +kill-instance.sh msb_consul +kill-instance.sh usecase-ui-server diff --git a/test/csit/plans/usecase-ui-server/testsuite/testplan.txt b/test/csit/plans/usecase-ui-server/testsuite/testplan.txt new file mode 100644 index 000000000..ec7f200a4 --- /dev/null +++ b/test/csit/plans/usecase-ui-server/testsuite/testplan.txt @@ -0,0 +1,3 @@ +# Test suites are relative paths under [integration.git]/test/csit/tests/. +# Place the suites in run order. +usecase-ui/server/test.robot diff --git a/test/csit/plans/vfc-gvnfm-vnflcm/sanity-check/setup.sh b/test/csit/plans/vfc-gvnfm-vnflcm/sanity-check/setup.sh index 634c32722..c9900d246 100755 --- a/test/csit/plans/vfc-gvnfm-vnflcm/sanity-check/setup.sh +++ b/test/csit/plans/vfc-gvnfm-vnflcm/sanity-check/setup.sh @@ -58,4 +58,4 @@ docker cp vfc-vnflcm:/service/vfc/gvnfm/vnflcm/lcm/logs/runtime_lcm.log ./ cat runtime_lcm.log # Pass any variables required by Robot test suites in ROBOT_VARIABLES -ROBOT_VARIABLES="-v MSB_IAG_IP:${MSB_IAG_IP} -v VNFLCM_IP:${VNFLCM_IP}" +ROBOT_VARIABLES="-v MSB_IAG_IP:${MSB_IAG_IP} -v VNFLCM_IP:${VNFLCM_IP} -v SCRIPTS:${SCRIPTS}" diff --git a/test/csit/plans/vfc-nfvo-resmanagement/sanity-check/setup.sh b/test/csit/plans/vfc-nfvo-resmanagement/sanity-check/setup.sh index a18562eb7..b0cec31a1 100644 --- a/test/csit/plans/vfc-nfvo-resmanagement/sanity-check/setup.sh +++ b/test/csit/plans/vfc-nfvo-resmanagement/sanity-check/setup.sh @@ -34,7 +34,7 @@ echo MSB_IP=${MSB_IP} # Start resmgr docker run -d --name vfc-resmanagement -e MSB_ADDR=${MSB_IP}:80 nexus3.onap.org:10001/onap/vfc/resmanagement RESMGR_IP=`get-instance-ip.sh vfc-resmanagement` -for i in {1..10}; do +for i in {1..20}; do curl -sS ${RESMGR_IP}:8480 && break echo sleep $i sleep $i diff --git a/test/csit/scripts/sdc/clone_and_setup_sdc_data.sh b/test/csit/scripts/sdc/clone_and_setup_sdc_data.sh index da421e4cf..97f767381 100644 --- a/test/csit/scripts/sdc/clone_and_setup_sdc_data.sh +++ b/test/csit/scripts/sdc/clone_and_setup_sdc_data.sh @@ -31,18 +31,25 @@ mkdir -p ${WORKSPACE}/data/clone/ cd ${WORKSPACE}/data/clone git clone --depth 1 http://gerrit.onap.org/r/sdc -b master +chmod -R 775 ${WORKSPACE}/data/ # set enviroment variables -ENV_NAME=CSIT -MR_IP_ADDR=10.0.0.1 +export ENV_NAME='CSIT' +export MR_IP_ADDR='10.0.0.1' + +ifconfig + +#if [ -e /opt/config/public_ip.txt ] +# then +# IP_ADDRESS=$(cat /opt/config/public_ip.txt) +# else +# IP_ADDRESS=$(ifconfig ens3 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2) +# fi + +IP_ADDRESS=`ip route get 8.8.8.8 | awk '/src/{ print $7 }'` +export HOST_IP=$IP_ADDRESS -if [ -e /opt/config/public_ip.txt ] - then - IP_ADDRESS=$(cat /opt/config/public_ip.txt) - else - IP_ADDRESS=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2) - fi cat ${WORKSPACE}/data/clone/sdc/sdc-os-chef/environments/Template.json | sed "s/yyy/"$IP_ADDRESS"/g" > ${WORKSPACE}/data/environments/$ENV_NAME.json sed -i "s/xxx/"$ENV_NAME"/g" ${WORKSPACE}/data/environments/$ENV_NAME.json diff --git a/test/csit/scripts/sdc/docker_health.sh b/test/csit/scripts/sdc/docker_health.sh new file mode 100644 index 000000000..832b25a23 --- /dev/null +++ b/test/csit/scripts/sdc/docker_health.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +curl localhost:9200/_cluster/health?pretty=true + +echo "BE health-Check:" +curl http://localhost:8080/sdc2/rest/healthCheck + +echo "" +echo "" +echo "FE health-Check:" +curl http://localhost:8181/sdc1/rest/healthCheck + + +echo "" +echo "" +res=`curl -s -X GET -H "Accept: application/json" -H "Content-Type: application/json" -H "USER_ID: jh0003" "http://localhost:8080/sdc2/rest/v1/user/demo" | wc -l` +if [[ ${res} != 0 ]] +then + echo "Error [${res}] while user existance check" + exit ${res} +fi +echo "check user existance: OK" + diff --git a/test/csit/scripts/sdc/kill_containers_and_remove_dataFolders.sh b/test/csit/scripts/sdc/kill_containers_and_remove_dataFolders.sh index e03284248..48a31e895 100644 --- a/test/csit/scripts/sdc/kill_containers_and_remove_dataFolders.sh +++ b/test/csit/scripts/sdc/kill_containers_and_remove_dataFolders.sh @@ -26,6 +26,6 @@ docker rm $(docker ps -a -q --filter="name=sdc") #delete data folder -rm -rf ${WORKSPACE}/data/* +#rm -rf ${WORKSPACE}/data/* diff --git a/test/csit/scripts/sdc/start_sdc_containers.sh b/test/csit/scripts/sdc/start_sdc_containers.sh index 31105acb0..7d61846f3 100644 --- a/test/csit/scripts/sdc/start_sdc_containers.sh +++ b/test/csit/scripts/sdc/start_sdc_containers.sh @@ -25,15 +25,13 @@ echo "This is ${WORKSPACE}/test/csit/scripts/sdc/start_sdc_containers.sh" -RELEASE=latest -LOCAL=false -SKIPTESTS=false -DEP_ENV=CSIT +export RELEASE='1.1-STAGING-latest' +export DEP_ENV=$ENV_NAME #[ -f /opt/config/nexus_username.txt ] && NEXUS_USERNAME=$(cat /opt/config/nexus_username.txt) || NEXUS_USERNAME=release #[ -f /opt/config/nexus_password.txt ] && NEXUS_PASSWD=$(cat /opt/config/nexus_password.txt) || NEXUS_PASSWD=sfWU3DFVdBr7GVxB85mTYgAW #[ -f /opt/config/nexus_docker_repo.txt ] && NEXUS_DOCKER_REPO=$(cat /opt/config/nexus_docker_repo.txt) || NEXUS_DOCKER_REPO=ecomp-nexus:${PORT} #[ -f /opt/config/nexus_username.txt ] && docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO -export IP=`ifconfig eth0 | awk -F: '/inet addr/ {gsub(/ .*/,"",$2); print $2}'` +export IP=$HOST_IP #export PREFIX=${NEXUS_DOCKER_REPO}'/openecomp' export PREFIX='nexus3.onap.org:10001/openecomp' @@ -63,7 +61,7 @@ docker run --detach --name sdc-BE --env HOST_IP=${IP} --env ENVNAME="${DEP_ENV}" echo "please wait while BE is starting..." echo "" -c=120 # seconds to wait +c=90 # seconds to wait REWRITE="\e[45D\e[1A\e[K" while [ $c -gt 0 ]; do c=$((c-1)) @@ -77,7 +75,7 @@ docker run --detach --name sdc-FE --env HOST_IP=${IP} --env ENVNAME="${DEP_ENV}" echo "please wait while FE is starting..." echo "" -c=120 # seconds to wait +c=60 # seconds to wait REWRITE="\e[45D\e[1A\e[K" while [ $c -gt 0 ]; do c=$((c-1)) @@ -86,23 +84,26 @@ while [ $c -gt 0 ]; do done echo -e "" +# WAIT 5 minutes maximum and test every 5 seconds if SDC up using HealthCheck API +echo " WAIT 5 minutes maximum and test every 5 seconds if SDC up using HealthCheck API...." +TIME_OUT=600 +INTERVAL=5 +TIME=0 +while [ "$TIME" -lt "$TIME_OUT" ]; do + response=$(curl --write-out '%{http_code}' --silent --output /dev/null http://localhost:8080/sdc2/rest/healthCheck); echo $response + if [ "$response" == "200" ]; then + echo SDC well started in $TIME seconds + break; + fi -#TIME=0 -#while [ "$TIME" -lt "$TIME_OUT" ]; do -# response=$(curl --write-out '%{http_code}' --silent --output /dev/null http://localhost:8080/restservices/clds/v1/clds/healthcheck); echo $response + echo Sleep: $INTERVAL seconds before testing if SDC is up. Total wait time up now is: $TIME seconds. Timeout is: $TIME_OUT seconds + sleep $INTERVAL + TIME=$(($TIME+$INTERVAL)) +done -# if [ "$response" == "200" ]; then -# echo Clamp and its database well started in $TIME seconds -# break; -# fi +if [ "$TIME" -ge "$TIME_OUT" ]; then + echo TIME OUT: Docker containers not started in $TIME_OUT seconds... Could cause problems for tests... -# echo Sleep: $INTERVAL seconds before testing if Clamp is up. Total wait time up now is: $TIME seconds. Timeout is: $TIME_OUT seconds -# sleep $INTERVAL -# TIME=$(($TIME+$INTERVAL)) -#done -#if [ "$TIME" -ge "$TIME_OUT" ]; then -# echo TIME OUT: Docker containers not started in $TIME_OUT seconds... Could cause problems for tests... -#fi diff --git a/test/csit/scripts/sdc/start_sdc_sanity.sh b/test/csit/scripts/sdc/start_sdc_sanity.sh new file mode 100644 index 000000000..33dbf67aa --- /dev/null +++ b/test/csit/scripts/sdc/start_sdc_sanity.sh @@ -0,0 +1,68 @@ +#!/bin/bash +# +# ============LICENSE_START======================================================= +# ONAP CLAMP +# ================================================================================ +# Copyright (C) 2017 AT&T Intellectual Property. All rights +# reserved. +# ================================================================================ +# 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. +# ============LICENSE_END============================================ +# =================================================================== +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# + + + +#start Sanity docker + +docker run --detach --name sdc-sanity --env HOST_IP=${IP} --env ENVNAME="${DEP_ENV}" --env http_proxy=${http_proxy} --env https_proxy=${https_proxy} --env no_proxy=${no_proxy} --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --ulimit memlock=-1:-1 --memory 512m --memory-swap=512m --ulimit nofile=4096:100000 --volume /etc/localtime:/etc/localtime:ro --volume ${WORKSPACE}/data/logs/sdc-sanity/target:/var/lib/tests/target --volume ${WORKSPACE}/data/logs/sdc-sanity/ExtentReport:/var/lib/tests/ExtentReport --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments --publish 9560:9560 ${PREFIX}/sdc-sanity:${RELEASE} + +#echo "please wait while Sanity Docker is starting..." +echo "" +c=60 # seconds to wait +REWRITE="\e[45D\e[1A\e[K" +while [ $c -gt 0 ]; do + c=$((c-1)) + sleep 1 + echo -e "${REWRITE}$c" +done +echo -e "" + + +#monitor sanity process + +TIME_OUT=1200 +INTERVAL=20 +TIME=0 +while [ "$TIME" -lt "$TIME_OUT" ]; do + +PID=`docker exec -it sdc-sanity ps -ef | grep java | awk '{print $2}'` +echo sanity PID is -- $PID + +if [ -z "$PID" ] + then + echo SDC sanity finished in $TIME seconds + break + fi + + echo Sleep: $INTERVAL seconds before testing if SDC sanity completed. Total wait time up now is: $TIME seconds. Timeout is: $TIME_OUT seconds + sleep $INTERVAL + TIME=$(($TIME+$INTERVAL)) +done + +if [ "$TIME" -ge "$TIME_OUT" ] + then + echo TIME OUT: Sany was NOT completed in $TIME_OUT seconds... Could cause problems for tests... +fi +cp -rf ${WORKSPACE}/data/logs/sdc-sanity/ExtentReport/* ${WORKSPACE}/archives/ diff --git a/test/csit/tests/aaf/aafapi/aafapi.robot b/test/csit/tests/aaf/aafapi/aafapi.robot new file mode 100644 index 000000000..b1f8e746d --- /dev/null +++ b/test/csit/tests/aaf/aafapi/aafapi.robot @@ -0,0 +1,63 @@ +*** Settings *** +Library OperatingSystem +Library RequestsLibrary +Library requests +Library Collections +Library String + +*** Variables *** +${TARGETURL_NAMESPACE} http://${AAF_IP}:8101/authz/nss/org.openecomp +${TARGETURL_PERMS} http://${AAF_IP}:8101/authz/perms/user/dgl@openecomp.org +${TARGETURL_ROLES} http://${AAF_IP}:8101/authz/roles/user/dgl@openecomp.org +${username} dgl@openecomp.org +${password} ecomp_admin + + +*** Test Cases *** +View Namesapce + [Tags] get + CreateSession aaf http://${AAF_IP}:8101 + &{headers}= Create Dictionary Authorization=Basic ZGdsQG9wZW5lY29tcC5vcmc6ZWNvbXBfYWRtaW4= Content-Type=application/json Accept=application/json + ${resp}= Get Request aaf /authz/nss/org.openecomp headers=&{headers} + Should Be Equal As Strings ${resp.status_code} 200 + log 'JSON Response Code :'${resp.text} + +View by User Permission + [Tags] get + CreateSession aaf http://${AAF_IP}:8101 + &{headers}= Create Dictionary Authorization=Basic ZGdsQG9wZW5lY29tcC5vcmc6ZWNvbXBfYWRtaW4= Content-Type=application/json Accept=application/json + ${resp}= Get Request aaf authz/perms/user/dgl@openecomp.org headers=&{headers} + Should Be Equal As Strings ${resp.status_code} 200 + log 'JSON Response Code :'${resp.text} + +View by User Role + [Tags] get + CreateSession aaf http://${AAF_IP}:8101 + &{headers}= Create Dictionary Authorization=Basic ZGdsQG9wZW5lY29tcC5vcmc6ZWNvbXBfYWRtaW4= Content-Type=application/json Accept=application/json + ${resp}= Get Request aaf authz/roles/user/dgl@openecomp.org headers=&{headers} + Should Be Equal As Strings ${resp.status_code} 200 + log 'JSON Response Code :'${resp.text} + +Cleanup Namespace ( 424 Response - Delete dependencies and try again) + [Tags] delete + CreateSession aaf http://${AAF_IP}:8101 + &{headers}= Create Dictionary Authorization=Basic ZGdsQG9wZW5lY29tcC5vcmc6ZWNvbXBfYWRtaW4= Content-Type=application/json Accept=application/json + ${resp}= Delete Request aaf authz/ns/org.openecomp.dmaapBC headers=&{headers} + Should Be Equal As Strings ${resp.status_code} 424 + log 'JSON Response Code :'${resp.text} + +Add Data ( Add Admin to Namespace Explicit ) + [Tags] post + CreateSession aaf http://${AAF_IP}:8101 + &{headers}= Create Dictionary Authorization=Basic ZGdsQG9wZW5lY29tcC5vcmc6ZWNvbXBfYWRtaW4= Content-Type=application/json Accept=application/json + ${resp}= Post Request aaf authz/ns/org.openecomp.dmaapBC/admin/alexD@openecomp.org headers=&{headers} + Should Be Equal As Strings ${resp.status_code} 403 + log 'JSON Response Code :'${resp.text} + +View Explicit Permission + [Tags] post + CreateSession aaf http://${AAF_IP}:8101 + &{headers}= Create Dictionary Authorization=Basic ZGdsQG9wZW5lY29tcC5vcmc6ZWNvbXBfYWRtaW4= Content-Type=application/json Accept=application/json + ${resp}= Post Request aaf authz/perms/user/m99751@dmaapBC.openecomp.org headers=&{headers} + Should Be Equal As Strings ${resp.status_code} 406 + log 'JSON Response Code :'${resp.text}
\ No newline at end of file diff --git a/test/csit/tests/clamp/APIs/01__TCA.robot b/test/csit/tests/clamp/APIs/01__TCA.robot index e4837a66a..c0b268bf1 100644 --- a/test/csit/tests/clamp/APIs/01__TCA.robot +++ b/test/csit/tests/clamp/APIs/01__TCA.robot @@ -52,7 +52,7 @@ Put Requests to add Close Loop TCA Model2 ${resp}= Put Request clamp /restservices/clds/v1/clds/model/TCAModel2 data=${data} headers=${headers} Should Be Equal As Strings ${resp.status_code} 200 -Get Requests verify Model1 and Model2 found +Get Requests verify TCA Model1 and Model2 found ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 Create Session clamp http://localhost:8080 auth=${auth} ${resp}= Get Request clamp /restservices/clds/v1/clds/model-names diff --git a/test/csit/tests/clamp/APIs/02__Holmes.robot b/test/csit/tests/clamp/APIs/02__Holmes.robot index 9087c4bcd..313b7a4d2 100644 --- a/test/csit/tests/clamp/APIs/02__Holmes.robot +++ b/test/csit/tests/clamp/APIs/02__Holmes.robot @@ -36,3 +36,18 @@ Get Requests verify Holmes template1 and template2 found Should Contain Match ${resp} *HolmesTemplate2* Should Not Contain Match ${resp} *HolmesTemplate99* +Put Requests to add Close Loop Holmes Model1 + ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 + Create Session clamp http://localhost:8080 auth=${auth} + ${data}= Get Binary File ${CURDIR}${/}data${/}createHolmesModel1.json + &{headers}= Create Dictionary Content-Type=application/json + ${resp}= Put Request clamp /restservices/clds/v1/clds/model/HolmesModel1 data=${data} headers=${headers} + Should Be Equal As Strings ${resp.status_code} 200 + +Get Requests verify Holmes Model1 found + ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 + Create Session clamp http://localhost:8080 auth=${auth} + ${resp}= Get Request clamp /restservices/clds/v1/clds/model-names + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain Match ${resp} *HolmesModel1* + Should Not Contain Match ${resp} *HolmesModel99* diff --git a/test/csit/tests/clamp/UIs/03__Create_Holmes_template.robot b/test/csit/tests/clamp/UIs/03__Create_Holmes_template.robot new file mode 100644 index 000000000..4d038caeb --- /dev/null +++ b/test/csit/tests/clamp/UIs/03__Create_Holmes_template.robot @@ -0,0 +1,75 @@ +*** Settings *** +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json +Library Selenium2Library +Library XvfbRobot + + +*** Test Cases *** +Get Requests health check ok + CreateSession clamp http://localhost:8080 + ${resp}= Get Request clamp /restservices/clds/v1/clds/healthcheck + Should Be Equal As Strings ${resp.status_code} 200 + +Open Browser +# Next line is to be enabled for Headless tests only (jenkins?). To see the tests desable the line. + Start Virtual Display 1920 1080 + Open Browser http://localhost:8080/designer/index.html browser=firefox + Set Selenium Speed .2 seconds + Set Window Size 1920 1080 + ${title}= Get Title + Should Be Equal CLDS ${title} + +Good Login to Clamp UI and Verify logged in + Input Text locator=username text=admin + Input Text locator=password text=password + Press Key locator=password key=\\13 + Wait Until Element Is Visible xpath=//*[@class="navbar-brand logo_name ng-binding"] timeout=60 + Element Text Should Be xpath=//*[@class="navbar-brand logo_name ng-binding"] expected=Hello:admin + +Create Template from Menu + Wait Until Element Is Visible xpath=//*[@id="navbar"]/ul/li[1]/a timeout=60 + Click Element xpath=//*[@id="navbar"]/ul/li[1]/a + Wait Until Element Is Visible locator=Create Template timeout=60 + Click Element locator=Create Template + Input Text locator=modelName text=HolmesTemplate + Click Button locator=OK + +Drag and Drop Boxes for template + Wait Until Element Is Visible xpath=//*[@class="entry icon-collector-node"] timeout=60 + Drag And Drop By Offset xpath=//*[@class="entry icon-collector-node"] 280 280 + Drag And Drop By Offset xpath=//*[@class="entry icon-stringmatch-node"] 480 280 + Drag And Drop By Offset xpath=//*[@class="entry icon-ves-collector-node"] 680 280 + Drag And Drop By Offset xpath=//*[@class="entry icon-holmes-node"] 880 280 + Drag And Drop By Offset xpath=//*[@class="entry icon-tca-node"] 1080 280 + Drag And Drop By Offset xpath=//*[@class="entry icon-policy-node"] 1280 280 + Drag And Drop By Offset xpath=//*[@class="entry icon-end-event-none"] 1480 280 + +Drag and Drop Connectors for template + Click Element xpath=//*[starts-with(@data-element-id, "StartEvent_")] + Wait Until Element Is Enabled xpath=//*[@id="js-canvas"]/div/div/div[2]/div[8]/div/div/div[2]/div + Drag And Drop xpath=//*[@id="js-canvas"]/div/div/div[2]/div[8]/div/div/div[2]/div xpath=//*[starts-with(@data-element-id, "Collector_")] + Wait Until Element Is Enabled xpath=//*[@id="js-canvas"]/div/div/div[2]/div[1]/div/div/div[3]/div + Drag And Drop xpath=//*[@id="js-canvas"]/div/div/div[2]/div[1]/div/div/div[3]/div xpath=//*[starts-with(@data-element-id, "StringMatch_")] + Wait Until Element Is Enabled xpath=//*[@id="js-canvas"]/div/div/div[2]/div[2]/div/div/div[3]/div + Drag And Drop xpath=//*[@id="js-canvas"]/div/div/div[2]/div[2]/div/div/div[3]/div xpath=//*[starts-with(@data-element-id, "VesCollector_")] + Wait Until Element Is Enabled xpath=//*[@id="js-canvas"]/div/div/div[2]/div[3]/div/div/div[2]/div + Drag And Drop xpath=//*[@id="js-canvas"]/div/div/div[2]/div[3]/div/div/div[2]/div xpath=//*[starts-with(@data-element-id, "Holmes_")] + Wait Until Element Is Enabled xpath=//*[@id="js-canvas"]/div/div/div[2]/div[4]/div/div/div[3]/div + Drag And Drop xpath=//*[@id="js-canvas"]/div/div/div[2]/div[4]/div/div/div[3]/div xpath=//*[starts-with(@data-element-id, "TCA_")] + Wait Until Element Is Enabled xpath=//*[@id="js-canvas"]/div/div/div[2]/div[5]/div/div/div[3]/div + Drag And Drop xpath=//*[@id="js-canvas"]/div/div/div[2]/div[5]/div/div/div[3]/div xpath=//*[starts-with(@data-element-id, "Policy_")] + Wait Until Element Is Enabled xpath=//*[@id="js-canvas"]/div/div/div[2]/div[6]/div/div/div[3]/div + Drag And Drop xpath=//*[@id="js-canvas"]/div/div/div[2]/div[6]/div/div/div[3]/div xpath=//*[starts-with(@data-element-id, "EndEvent_")] + +Save Template from Menu + Click Element xpath=//*[@id="navbar"]/ul/li[1]/a + Wait Until Element Is Visible locator=Save Template timeout=60 + Click Element locator=Save Template + Wait Until Element Is Visible xpath=//*[@id="alert_message_"] timeout=60 + Element Text Should Be xpath=//*[@id="alert_message_"] expected=Action Successful:SAVE + +Close Browser + Close Browser
\ No newline at end of file diff --git a/test/csit/tests/clamp/UIs/04__Create_Holmes_model.robot b/test/csit/tests/clamp/UIs/04__Create_Holmes_model.robot new file mode 100644 index 000000000..a531645a1 --- /dev/null +++ b/test/csit/tests/clamp/UIs/04__Create_Holmes_model.robot @@ -0,0 +1,50 @@ +*** Settings *** +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json +Library Selenium2Library +Library XvfbRobot + + +*** Test Cases *** +Get Requests health check ok + CreateSession clamp http://localhost:8080 + ${resp}= Get Request clamp /restservices/clds/v1/clds/healthcheck + Should Be Equal As Strings ${resp.status_code} 200 + +Open Browser +# Next line is to be enabled for Headless tests only (jenkins?). To see the tests desable the line. + Start Virtual Display 1920 1080 + Open Browser http://localhost:8080/designer/index.html browser=firefox + Set Selenium Speed .2 seconds + Set Window Size 1920 1080 + ${title}= Get Title + Should Be Equal CLDS ${title} + +Good Login to Clamp UI and Verify logged in + Input Text locator=username text=admin + Input Text locator=password text=password + Press Key locator=password key=\\13 + Wait Until Element Is Visible xpath=//*[@class="navbar-brand logo_name ng-binding"] timeout=60 + Element Text Should Be xpath=//*[@class="navbar-brand logo_name ng-binding"] expected=Hello:admin + +Create Model from Menu + Wait Until Element Is Visible xpath=//*[@id="navbar"]/ul/li[2]/a timeout=60 + Click Element xpath=//*[@id="navbar"]/ul/li[2]/a + Wait Until Element Is Visible locator=Create CL timeout=60 + Click Element locator=Create CL + Input Text locator=modelName text=HolmesModel + Select From List By Label id=templateName HolmesTemplate + Click Button locator=Create + +Save Model from Menu + Wait Until Element Is Visible xpath=//*[@id="navbar"]/ul/li[2]/a timeout=60 + Click Element xpath=//*[@id="navbar"]/ul/li[2]/a + Wait Until Element Is Visible locator=Save CL timeout=60 + Click Element locator=Save CL + Wait Until Element Is Visible xpath=//*[@id="alert_message_"] timeout=60 + Element Text Should Be xpath=//*[@id="alert_message_"] expected=Action Successful:SAVE + +Close Browser + Close Browser diff --git a/test/csit/tests/dcaegen2/testcases/dcae_ves.robot b/test/csit/tests/dcaegen2/testcases/dcae_ves.robot index 00c58071b..eee6ea569 100644 --- a/test/csit/tests/dcaegen2/testcases/dcae_ves.robot +++ b/test/csit/tests/dcaegen2/testcases/dcae_ves.robot @@ -1,188 +1,199 @@ -*** Settings ***
-Documentation Testing DCAE VES Listener with various event feeds from VoLTE, vDNS, vFW and cCPE use scenarios
-
-Library RequestsLibrary
-Library OperatingSystem
-Library Collections
-Library DcaeLibrary
-Resource resources/dcae_keywords.robot
-Test Setup Cleanup VES Events
-Suite Setup VES Collector Suite Setup DMaaP
-Suite Teardown VES Collector Suite Shutdown DMaaP
-
-
-
-
-*** Variables ***
-${VESC_URL_HTTPS} https://%{VESC_IP}:8443
-${VESC_URL} http://%{VESC_IP}:8080
-${VES_ANY_EVENT_PATH} /eventListener/v5
-${VES_BATCH_EVENT_PATH} /eventListener/v5/eventBatch
-${VES_THROTTLE_STATE_EVENT_PATH} /eventListener/v5/clientThrottlingState
-${HEADER_STRING} content-type=application/json
-${EVENT_DATA_FILE} %{WORKSPACE}/test/csit/tests/dcaegen2/testcases/assets/json_events/ves_volte_single_fault_event.json
-${EVENT_MEASURE_FILE} %{WORKSPACE}/test/csit/tests/dcaegen2/testcases/assets/json_events/ves_vfirewall_measurement.json
-${EVENT_DATA_FILE_BAD} %{WORKSPACE}/test/csit/tests/dcaegen2/testcases/assets/json_events/ves_volte_single_fault_event_bad.json
-${EVENT_BATCH_DATA_FILE} %{WORKSPACE}/test/csit/tests/dcaegen2/testcases/assets/json_events/ves_volte_fault_eventlist_batch.json
-${EVENT_THROTTLING_STATE_DATA_FILE} %{WORKSPACE}/test/csit/tests/dcaegen2/testcases/assets/json_events/ves_volte_fault_provide_throttle_state.json
-
-
-#DCAE Health Check
-${CONFIG_BINDING_URL} http://localhost:8443
-${CB_HEALTHCHECK_PATH} /healthcheck
-${CB_SERVICE_COMPONENT_PATH} /service_component/
-${VES_Service_Name1} dcae-controller-ves-collector
-${VES_Service_Name2} ves-collector-not-exist
-
-*** Comment out from R1 release ***
-DCAE Health Check
- [Tags] DCAE-HealthCheck
- [Documentation] Get DCAE Overall Status
- ${auth}= Create List ${GLOBAL_DCAE_USERNAME} ${GLOBAL_DCAE_PASSWORD}
- ${session}= Create Session dcae-health-check ${CONFIG_BINDING_URL} auth=${auth}
- ${resp}= Get Request dcae-health-check ${CB_HEALTHCHECK_PATH}
- Should Be Equal As Strings ${resp.status_code} 200
-
-
-Get VES Collector Service Status
- [Tags] DCAE-HealthCheck
- [Documentation] Get the status of a VES Collector Service Component based on service name
- ${urlpath}= Catenate SEPARATOR= ${CB_SERVICE_COMPONENT_PATH} ${VES_Service_Name1}
- Log Service component name for status query: ${urlpath}
- ${resp}= Get DCAE Service Component Status ${CONFIG_BINDING_URL} ${CB_SERVICE_COMPONENT_PATH} ${GLOBAL_DCAE_USERNAME} ${GLOBAL_DCAE_PASSWORD}
- Log Receive HTTP Status code ${resp.status_code}
- Should Be Equal As Strings ${resp.status_code} 200
- ${isEmpty}= Is Json Empty ${resp}
- Run Keyword If '${isEmpty}' == False Log ${resp.json()}
-
-
-
-#*** Comment out from R1 release ***
-Publish VES VoLTE Fault Provide Throttling State
- [Tags] DCAE-D1
- ${evtdata}= Get Event Data From File ${EVENT_THROTTLING_STATE_DATA_FILE}
- ${headers}= Create Header From String ${HEADER_STRING}
- ${resp}= Publish Event To VES Collector ${VES_VOLTE_URL} ${VES_THROTTLE_STATE_EVENT_PATH} ${headers} ${evtdata} ${GLOBAL_DCAE_USERNAME} ${GLOBAL_DCAE_PASSWORD}
- Should Be Equal As Strings ${resp.status_code} 204
-
-Publish VES Event With Invalid Method
- [Tags] DCAE-D1
- [Documentation] Use invalid Put instead of Post method to expect 405 response
- ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE}
- ${headers}= Create Header From String ${HEADER_STRING}
- Log Send HTTP Request with invalid method Put instead of Post
- ${resp}= Publish Event To VES Collector With Put Method ${VES_VOLTE_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} ${GLOBAL_DCAE_USERNAME} ${GLOBAL_DCAE_PASSWORD}
- Log Receive HTTP Status code ${resp.status_code}
- Should Be Equal As Strings ${resp.status_code} 405
-
-
-Publish VES Event With Invalid URL Path
- [Tags] DCAE-D1
- [Documentation] Use invalid url path to expect 404 response
- ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE}
- ${headers}= Create Header From String ${HEADER_STRING}
- Log Send HTTP Request with invalid /listener/v5/ instead of /eventlistener/v5 path
- ${resp}= Publish Event To VES Collector ${VES_VOLTE_URL} /listener/v5/ ${headers} ${evtdata} ${GLOBAL_DCAE_USERNAME} ${GLOBAL_DCAE_PASSWORD}
- Log Receive HTTP Status code ${resp.status_code}
- Should Be Equal As Strings ${resp.status_code} 404
-
-Publish VES Event With Invalid Login
- [Tags] DCAE-D1
- [Documentation] Use invalid user or password to expect 401 response
- ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE}
- ${headers}= Create Header From String ${HEADER_STRING}
- Log Send HTTP Request with invalid User: BadUserName
- ${resp}= Publish Event To VES Collector ${VES_VOLTE_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} BadUserName ${GLOBAL_DCAE_PASSWORD}
- Log Receive HTTP Status code ${resp.status_code}
- Should Be Equal As Strings ${resp.status_code} 401
-
-*** Test Cases ***
-VES Collector Health Check
- [Tags] DCAE-VESC-R1
- [Documentation] Ves Collector Health Check
- ${uuid}= Generate UUID
- ${session}= Create Session dcae ${VESC_URL}
- ${headers}= Create Dictionary Accept=*/* X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
- ${resp}= Get Request dcae /healthcheck headers=${headers}
- Should Be Equal As Strings ${resp.status_code} 200
-
-
-Publish Single VES VoLTE Fault Event
- [Tags] DCAE-VESC-R1
- [Documentation] Post single event and expect 200 Response
- ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE}
- ${headers}= Create Header From String ${HEADER_STRING}
- ${resp}= Publish Event To VES Collector No Auth ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata}
- Log Receive HTTP Status code ${resp.status_code}
- Should Be Equal As Strings ${resp.status_code} 200
- ${isEmpty}= Is Json Empty ${resp}
- Run Keyword If '${isEmpty}' == False Log ${resp.json()}
- ${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546015
- Should Be Equal As Strings ${ret} true
-
-Publish Single VES VNF Measurement Event
- [Tags] DCAE-VESC-R1
- [Documentation] Post single event and expect 200 Response
- ${evtdata}= Get Event Data From File ${EVENT_MEASURE_FILE}
- ${headers}= Create Header From String ${HEADER_STRING}
- ${resp}= Publish Event To VES Collector No Auth ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata}
- Log Receive HTTP Status code ${resp.status_code}
- Should Be Equal As Strings ${resp.status_code} 200
- ${isEmpty}= Is Json Empty ${resp}
- Run Keyword If '${isEmpty}' == False Log ${resp.json()}
- ${ret}= DMaaP Message Receive 0b2b5790-3673-480a-a4bd-5a00b88e5af6
- Should Be Equal As Strings ${ret} true
-
-Publish VES VoLTE Fault Batch Events
- [Tags] DCAE-VESC-R1
- [Documentation] Post batched events and expect 202 Response
- ${evtdata}= Get Event Data From File ${EVENT_BATCH_DATA_FILE}
- ${headers}= Create Header From String ${HEADER_STRING}
- ${resp}= Publish Event To VES Collector No Auth ${VESC_URL} ${VES_BATCH_EVENT_PATH} ${headers} ${evtdata}
- Should Be Equal As Strings ${resp.status_code} 200
- ${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546016
- Should Be Equal As Strings ${ret} true
-
-
-Publish Single VES VoLTE Fault Event With Bad Data
- [Tags] DCAE-VESC-R1
- [Documentation] Run with JSON Envent with missing comma to expect 400 response
- ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE_BAD}
- ${headers}= Create Header From String ${HEADER_STRING}
- Log Send HTTP Request with invalid Json Event Data
- ${resp}= Publish Event To VES Collector No Auth ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata}
- Log Receive HTTP Status code ${resp.status_code}
- Should Be Equal As Strings ${resp.status_code} 400
- ${isEmpty}= Is Json Empty ${resp}
- Run Keyword If '${isEmpty}' == False Log ${resp.json()}
-
-Publish VES Event With Invalid Method
- [Tags] DCAE-VESC-R1
- [Documentation] Use invalid Put instead of Post method to expect 405 response
- ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE}
- ${headers}= Create Header From String ${HEADER_STRING}
- Log Send HTTP Request with invalid method Put instead of Post
- ${resp}= Publish Event To VES Collector With Put Method No Auth ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata}
- Log Receive HTTP Status code ${resp.status_code}
- Should Be Equal As Strings ${resp.status_code} 404
-
-
-Publish VES Event With Invalid URL Path
- [Tags] DCAE-VESC-R1
- [Documentation] Use invalid url path to expect 404 response
- ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE}
- ${headers}= Create Header From String ${HEADER_STRING}
- Log Send HTTP Request with invalid /listener/v5/ instead of /eventListener/v5 path
- ${resp}= Publish Event To VES Collector No Auth ${VESC_URL} /listener/v5/ ${headers} ${evtdata}
- Log Receive HTTP Status code ${resp.status_code}
- Should Be Equal As Strings ${resp.status_code} 404
-
-
-
-
-
-
-
-
-
-
+*** Settings *** +Documentation Testing DCAE VES Listener with various event feeds from VoLTE, vDNS, vFW and cCPE use scenarios + +Library RequestsLibrary +Library OperatingSystem +Library Collections +Library DcaeLibrary +Resource resources/dcae_keywords.robot +Test Setup Cleanup VES Events +Suite Setup VES Collector Suite Setup DMaaP +Suite Teardown VES Collector Suite Shutdown DMaaP + + + + +*** Variables *** +${VESC_URL_HTTPS} https://%{VESC_IP}:8443 +${VESC_URL} http://%{VESC_IP}:8080 +${VES_ANY_EVENT_PATH} /eventListener/v5 +${VES_BATCH_EVENT_PATH} /eventListener/v5/eventBatch +${VES_THROTTLE_STATE_EVENT_PATH} /eventListener/v5/clientThrottlingState +${HEADER_STRING} content-type=application/json +${EVENT_DATA_FILE} %{WORKSPACE}/test/csit/tests/dcaegen2/testcases/assets/json_events/ves_volte_single_fault_event.json +${EVENT_MEASURE_FILE} %{WORKSPACE}/test/csit/tests/dcaegen2/testcases/assets/json_events/ves_vfirewall_measurement.json +${EVENT_DATA_FILE_BAD} %{WORKSPACE}/test/csit/tests/dcaegen2/testcases/assets/json_events/ves_volte_single_fault_event_bad.json +${EVENT_BATCH_DATA_FILE} %{WORKSPACE}/test/csit/tests/dcaegen2/testcases/assets/json_events/ves_volte_fault_eventlist_batch.json +${EVENT_THROTTLING_STATE_DATA_FILE} %{WORKSPACE}/test/csit/tests/dcaegen2/testcases/assets/json_events/ves_volte_fault_provide_throttle_state.json + + +#DCAE Health Check +${CONFIG_BINDING_URL} http://localhost:8443 +${CB_HEALTHCHECK_PATH} /healthcheck +${CB_SERVICE_COMPONENT_PATH} /service_component/ +${VES_Service_Name1} dcae-controller-ves-collector +${VES_Service_Name2} ves-collector-not-exist + + +*** Test Cases *** + +VES Collector Health Check + [Tags] DCAE-VESC-R1 + [Documentation] Ves Collector Health Check + ${uuid}= Generate UUID + ${session}= Create Session dcae ${VESC_URL} + ${headers}= Create Dictionary Accept=*/* X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} + ${resp}= Get Request dcae /healthcheck headers=${headers} + Should Be Equal As Strings ${resp.status_code} 200 + + +Publish Single VES VoLTE Fault Event + [Tags] DCAE-VESC-R1 + [Documentation] Post single event and expect 200 Response + ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE} + ${headers}= Create Header From String ${HEADER_STRING} + ${resp}= Publish Event To VES Collector No Auth ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} + Log Receive HTTP Status code ${resp.status_code} + Should Be Equal As Strings ${resp.status_code} 200 + ${isEmpty}= Is Json Empty ${resp} + Run Keyword If '${isEmpty}' == False Log ${resp.json()} + ${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546015 + Should Be Equal As Strings ${ret} true + +Publish Single VES VNF Measurement Event + [Tags] DCAE-VESC-R1 + [Documentation] Post single event and expect 200 Response + ${evtdata}= Get Event Data From File ${EVENT_MEASURE_FILE} + ${headers}= Create Header From String ${HEADER_STRING} + ${resp}= Publish Event To VES Collector No Auth ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} + Log Receive HTTP Status code ${resp.status_code} + Should Be Equal As Strings ${resp.status_code} 200 + ${isEmpty}= Is Json Empty ${resp} + Run Keyword If '${isEmpty}' == False Log ${resp.json()} + ${ret}= DMaaP Message Receive 0b2b5790-3673-480a-a4bd-5a00b88e5af6 + Should Be Equal As Strings ${ret} true + +Publish VES VoLTE Fault Batch Events + [Tags] DCAE-VESC-R1 + [Documentation] Post batched events and expect 202 Response + ${evtdata}= Get Event Data From File ${EVENT_BATCH_DATA_FILE} + ${headers}= Create Header From String ${HEADER_STRING} + ${resp}= Publish Event To VES Collector No Auth ${VESC_URL} ${VES_BATCH_EVENT_PATH} ${headers} ${evtdata} + Should Be Equal As Strings ${resp.status_code} 200 + ${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546016 + Should Be Equal As Strings ${ret} true + + +Publish Single VES VoLTE Fault Event With Bad Data + [Tags] DCAE-VESC-R1 + [Documentation] Run with JSON Envent with missing comma to expect 400 response + ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE_BAD} + ${headers}= Create Header From String ${HEADER_STRING} + Log Send HTTP Request with invalid Json Event Data + ${resp}= Publish Event To VES Collector No Auth ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} + Log Receive HTTP Status code ${resp.status_code} + Should Be Equal As Strings ${resp.status_code} 400 + ${isEmpty}= Is Json Empty ${resp} + Run Keyword If '${isEmpty}' == False Log ${resp.json()} + +Publish VES Event With Invalid Method + [Tags] DCAE-VESC-R1 + [Documentation] Use invalid Put instead of Post method to expect 405 response + ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE} + ${headers}= Create Header From String ${HEADER_STRING} + Log Send HTTP Request with invalid method Put instead of Post + ${resp}= Publish Event To VES Collector With Put Method No Auth ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} + Log Receive HTTP Status code ${resp.status_code} + Should Be Equal As Strings ${resp.status_code} 404 + + +Publish VES Event With Invalid URL Path + [Tags] DCAE-VESC-R1 + [Documentation] Use invalid url path to expect 404 response + ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE} + ${headers}= Create Header From String ${HEADER_STRING} + Log Send HTTP Request with invalid /listener/v5/ instead of /eventListener/v5 path + ${resp}= Publish Event To VES Collector No Auth ${VESC_URL} /listener/v5/ ${headers} ${evtdata} + Log Receive HTTP Status code ${resp.status_code} + Should Be Equal As Strings ${resp.status_code} 404 + + +Enable VESC HTTPS And Basic Auth + [Tags] DCAE-VESC-R1 + [Documentation] Enable VESC Https and Authentication, Disable Http and Run Health Check + Enable VESC Https Auth + + ${auth}= Create List ${VESC_HTTPS_USER} ${VESC_HTTPS_PD} + ${session}= Create Session dcaegen2-r1 ${VESC_URL_HTTPS} auth=${auth} disable_warnings=1 + ${headers}= Create Dictionary Accept=*/* X-FromAppId=${GLOBAL_APPLICATION_ID} + ${resp}= Get Request dcaegen2-r1 /healthcheck headers=${headers} + Should Be Equal As Strings ${resp.status_code} 200 + +Publish Single VES Fault Event Over HTTPS + [Tags] DCAE-VESC-R1 + [Documentation] Post single event and expect 200 Response + ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE} + ${headers}= Create Header From String ${HEADER_STRING} + Log Login User=${VESC_HTTPS_USER}, Pd=${VESC_HTTPS_PD} + ${resp}= Publish Event To VES Collector ${VESC_URL_HTTPS} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} sample1 sample1 + Log Receive HTTP Status code ${resp.status_code} + Should Be Equal As Strings ${resp.status_code} 200 + ${isEmpty}= Is Json Empty ${resp} + Run Keyword If '${isEmpty}' == False Log ${resp.json()} + ${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546015 + Should Be Equal As Strings ${ret} true + + +Publish Single VES Measurement Event Over HTTPS + [Tags] DCAE-VESC-R1 + [Documentation] Post single event and expect 200 Response + ${evtdata}= Get Event Data From File ${EVENT_MEASURE_FILE} + ${headers}= Create Header From String ${HEADER_STRING} + ${resp}= Publish Event To VES Collector ${VESC_URL_HTTPS} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} ${VESC_HTTPS_USER} ${VESC_HTTPS_PD} + Log Receive HTTP Status code ${resp.status_code} + Should Be Equal As Strings ${resp.status_code} 200 + ${isEmpty}= Is Json Empty ${resp} + Run Keyword If '${isEmpty}' == False Log ${resp.json()} + ${ret}= DMaaP Message Receive 0b2b5790-3673-480a-a4bd-5a00b88e5af6 + Should Be Equal As Strings ${ret} true + +Publish VES Fault Batch Events Over HTTPS + [Tags] DCAE-VESC-R1 + [Documentation] Post batched events and expect 202 Response + ${evtdata}= Get Event Data From File ${EVENT_BATCH_DATA_FILE} + ${headers}= Create Header From String ${HEADER_STRING} + ${resp}= Publish Event To VES Collector ${VESC_URL_HTTPS} ${VES_BATCH_EVENT_PATH} ${headers} ${evtdata} ${VESC_HTTPS_USER} ${VESC_HTTPS_PD} + Should Be Equal As Strings ${resp.status_code} 200 + ${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546016 + Should Be Equal As Strings ${ret} true + + +Publish VES Event With Invalid URL Path HTTPS + [Tags] DCAE-VESC-R1 + [Documentation] Use invalid url path to expect 404 response + ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE} + ${headers}= Create Header From String ${HEADER_STRING} + Log Send HTTP Request with invalid /eventlistener/v5/ instead of /eventListener/v5 path + ${resp}= Publish Event To VES Collector ${VESC_URL_HTTPS} /eventlistener/v5 ${headers} ${evtdata} ${VESC_HTTPS_USER} ${VESC_HTTPS_PD} + Log Receive HTTP Status code ${resp.status_code} + Should Be Equal As Strings ${resp.status_code} 404 + + + + + + + + + + + + + + + + + + + + diff --git a/test/csit/tests/dcaegen2/testcases/resources/DcaeLibrary.py b/test/csit/tests/dcaegen2/testcases/resources/DcaeLibrary.py index 650f8fef8..0242ad7ab 100644 --- a/test/csit/tests/dcaegen2/testcases/resources/DcaeLibrary.py +++ b/test/csit/tests/dcaegen2/testcases/resources/DcaeLibrary.py @@ -5,14 +5,14 @@ Created on Aug 18, 2017 '''
from robot.api import logger
from Queue import Queue
-import uuid, time, datetime,json, threading
+import uuid, time, datetime,json, threading,os, platform, subprocess,paramiko
import DcaeVariables
import DMaaP
class DcaeLibrary(object):
def __init__(self):
- pass
+ pass
def setup_dmaap_server(self, portNum=3904):
if DcaeVariables.HttpServerThread != None:
@@ -50,6 +50,28 @@ class DcaeLibrary(object): return "true"
logger.console("DMaaP server not started yet")
return "false"
+
+ def enable_vesc_https_auth(self):
+ if 'Windows' in platform.system():
+ try:
+ client = paramiko.SSHClient()
+ client.load_system_host_keys()
+ #client.set_missing_host_key_policy(paramiko.WarningPolicy)
+ client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
+
+ client.connect(os.environ['CSIT_IP'], port=22, username=os.environ['CSIT_USER'], password=os.environ['CSIT_PD'])
+ stdin, stdout, stderr = client.exec_command('%{WORKSPACE}/test/csit/tests/dcaegen2/testcases/resources/vesc_enable_https_auth.sh')
+ logger.console(stdout.read())
+ finally:
+ client.close()
+ return
+ ws = os.environ['WORKSPACE']
+ script2run = ws + "/test/csit/tests/dcaegen2/testcases/resources/vesc_enable_https_auth.sh"
+ logger.info("Running script: " + script2run)
+ logger.console("Running script: " + script2run)
+ subprocess.call(script2run)
+ time.sleep(5)
+ return
def dmaap_message_receive(self, evtobj, action='contain'):
@@ -129,7 +151,9 @@ if __name__ == '__main__': '''
lib = DcaeLibrary()
+ lib.enable_vesc_https_auth()
+
ret = lib.setup_dmaap_server()
print ret
- time.sleep(10000000000)
-
\ No newline at end of file + time.sleep(100000)
+
diff --git a/test/csit/tests/dcaegen2/testcases/resources/collector.properties b/test/csit/tests/dcaegen2/testcases/resources/collector.properties new file mode 100755 index 000000000..1c5c8411e --- /dev/null +++ b/test/csit/tests/dcaegen2/testcases/resources/collector.properties @@ -0,0 +1,74 @@ +############################################################################### +## +## Collector Server config +## +## - Default values are shown as commented settings. +## +############################################################################### +## +## HTTP(S) service +## +## Normally: +## +## - 8080 is http service +## - https is disabled by default (-1) +## +## - At this time, the server always binds to 0.0.0.0 +## +## The default port when header.authflag is disabled (0) +#collector.service.port=8080 + +## The secure port is required if header.authflag is set to 1 (true) +## Authentication is only supported via secure port +## When enabled - require valid keystore defined +collector.service.secure.port=8443 + +## The keystore must be setup per installation when secure port is configured +collector.keystore.file.location=../etc/keystore +collector.keystore.passwordfile=./etc/passwordfile +collector.keystore.alias=tomcat + + +############################################################################### +## Processing +## +## If there's a problem that prevents the collector from processing alarms, +## it's normally better to apply back pressure to the caller than to try to +## buffer beyond a reasonable size limit. With a limit, the server won't crash +## due to being out of memory, and the caller will get a 5xx reply saying the +## server is in trouble. +collector.inputQueue.maxPending=8096 + +## Schema Validation checkflag +## default no validation checkflag (-1) +## If enabled (1) - schemafile location must be specified +collector.schema.checkflag=1 +collector.schema.file={\"v1\":\"./etc/CommonEventFormat_27.2.json\",\"v2\":\"./etc/CommonEventFormat_27.2.json\",\"v3\":\"./etc/CommonEventFormat_27.2.json\",\"v4\":\"./etc/CommonEventFormat_27.2.json\",\"v5\":\"./etc/CommonEventFormat_28.3.json\"} + +## List all streamid per domain to be supported. The streamid should match to channel name on dmaapfile +collector.dmaap.streamid=fault=sec_fault|syslog=sec_syslog|heartbeat=sec_heartbeat|measurementsForVfScaling=sec_measurement|mobileFlow=sec_mobileflow|other=sec_other|stateChange=sec_statechange|thresholdCrossingAlert=sec_thresholdCrossingAlert|voiceQuality=ves_voicequality|sipSignaling=ves_sipsignaling +collector.dmaapfile=./etc/DmaapConfig.json + +## Custom ExceptionConfiguration +exceptionConfig=./etc/ExceptionConfig.json + +## authflag control authentication by the collector +## If enabled (1) - then authlist has to be defined +## When authflag is enabled, only secure port will be supported +## To disable enter 0 +header.authflag=1 +## Combination of userid,base64 encoded pwd list to be supported +## userid and pwd comma separated; pipe delimitation between each pair +header.authlist=sample1,c2FtcGxlMQ==|vdnsagg,dmRuc2FnZw== + +## Event transformation Flag - when set expects configurable transformation +## defined under ./etc/eventTransform.json +## Enabled by default; to disable set to 0 +event.transform.flag=0 + +############################################################################### +## +## Tomcat control +## +#tomcat.maxthreads=(tomcat default, which is usually 200) + diff --git a/test/csit/tests/dcaegen2/testcases/resources/dcae_keywords.robot b/test/csit/tests/dcaegen2/testcases/resources/dcae_keywords.robot index a30a1ba01..59d44e158 100644 --- a/test/csit/tests/dcaegen2/testcases/resources/dcae_keywords.robot +++ b/test/csit/tests/dcaegen2/testcases/resources/dcae_keywords.robot @@ -1,16 +1,13 @@ *** Settings ***
Documentation The main interface for interacting with DCAE. It handles low level stuff like managing the http request library and DCAE required fields
Library RequestsLibrary
-Library DcaeLibrary.py
+Library DcaeLibrary
Library OperatingSystem
Library Collections
Variables ../resources/DcaeVariables.py
Resource ../resources/dcae_properties.robot
-
-
*** Variables ***
${DCAE_HEALTH_CHECK_BODY} %{WORKSPACE}/test/csit/tests/dcae/testcases/assets/json_events/dcae_healthcheck.json
-
*** Keywords ***
Get DCAE Nodes
[Documentation] Get DCAE Nodes from Consul Catalog
@@ -26,8 +23,6 @@ Get DCAE Nodes ${len}= Get Length ${NodeList}
Should Not Be Equal As Integers ${len} 0
[return] ${NodeList}
-
-
DCAE Node Health Check
[Documentation] Perform DCAE Node Health Check
[Arguments] ${NodeName}
@@ -43,76 +38,58 @@ DCAE Node Health Check Should Not Be Equal As Integers ${len} 0
DCAE Check Health Status ${NodeName} ${StatusList[0]} Serf Health Status
#Run Keyword if ${len} > 1 DCAE Check Health Status ${NodeName} ${StatusList[1]} Serf Health Status
-
-
DCAE Check Health Status
[Arguments] ${NodeName} ${ItemStatus} ${CheckType}
Should Be Equal As Strings ${ItemStatus} passing
Log Node: ${NodeName} ${CheckType} check pass ok
-
VES Collector Suite Setup DMaaP
[Documentation] Start DMaaP Mockup Server
${ret}= Setup DMaaP Server
Should Be Equal As Strings ${ret} true
-
VES Collector Suite Shutdown DMaaP
[Documentation] Shutdown DMaaP Mockup Server
${ret}= Shutdown DMaap
Should Be Equal As Strings ${ret} true
-
-
-
-
Check DCAE Results
[Documentation] Parse DCAE JSON response and make sure all rows have healthTestStatus=GREEN
[Arguments] ${json}
@{rows}= Get From Dictionary ${json['returns']} rows
@{headers}= Get From Dictionary ${json['returns']} columns
-
# Retrieve column names from headers
${columns}= Create List
:for ${header} in @{headers}
- \ ${colName}= Get From Dictionary ${header} colName
+ \ ${colName}= Get From Dictionary ${header} colName
\ Append To List ${columns} ${colName}
-
- # Process each row making sure status=GREEN
+ # Process each row making sure status=GREEN
:for ${row} in @{rows}
\ ${cells}= Get From Dictionary ${row} cells
- \ ${dict}= Make A Dictionary ${cells} ${columns}
+ \ ${dict}= Make A Dictionary ${cells} ${columns}
\ Dictionary Should Contain Item ${dict} healthTestStatus GREEN
-
-
Make A Dictionary
[Documentation] Given a list of column names and a list of dictionaries, map columname=value
[Arguments] ${columns} ${names} ${valuename}=value
${dict}= Create Dictionary
- ${collength}= Get Length ${columns}
- ${namelength}= Get Length ${names}
+ ${collength}= Get Length ${columns}
+ ${namelength}= Get Length ${names}
:for ${index} in range 0 ${collength}
\ ${name}= Evaluate ${names}[${index}]
\ ${valued}= Evaluate ${columns}[${index}]
\ ${value}= Get From Dictionary ${valued} ${valueName}
\ Set To Dictionary ${dict} ${name} ${value}
[Return] ${dict}
-
-
Get Event Data From File
[Arguments] ${jsonfile}
${data}= OperatingSystem.Get File ${jsonfile}
#Should Not Be_Equal ${data} None
[return] ${data}
-
Json String To Dictionary
[Arguments] ${json_string}
${json_dict}= evaluate json.loads('''${json_string}''') json
[return] ${json_dict}
-
Dictionary To Json String
[Arguments] ${json_dict}
${json_string}= evaluate json.dumps(${json_dict}) json
[return] ${json_string}
-
-
Get DCAE Service Component Status
[Documentation] Get the status of a DCAE Service Component
[Arguments] ${url} ${urlpath} ${usr} ${passwd}
@@ -120,26 +97,23 @@ Get DCAE Service Component Status ${session}= Create Session dcae-service-component ${url} auth=${auth}
${resp}= Get Request dcae-service-component ${urlpath}
[return] ${resp}
-
Publish Event To VES Collector No Auth
[Documentation] Send an event to VES Collector
[Arguments] ${url} ${evtpath} ${httpheaders} ${evtdata}
Log Creating session ${url}
- ${session}= Create Session dcae-d1 ${url}
- ${resp}= Post Request dcae-d1 ${evtpath} data=${evtdata} headers=${httpheaders}
+ ${session}= Create Session dcaegen2-d1 ${url}
+ ${resp}= Post Request dcaegen2-d1 ${evtpath} data=${evtdata} headers=${httpheaders}
#Log Received response from dcae ${resp.json()}
[return] ${resp}
-
Publish Event To VES Collector
[Documentation] Send an event to VES Collector
[Arguments] ${url} ${evtpath} ${httpheaders} ${evtdata} ${user} ${pd}
${auth}= Create List ${user} ${pd}
Log Creating session ${url}
- ${session}= Create Session dcae-d1 ${url} auth=${auth}
- ${resp}= Post Request dcae-d1 ${evtpath} data=${evtdata} headers=${httpheaders}
+ ${session}= Create Session dcaegen2-d1 ${url} auth=${auth} disable_warnings=1
+ ${resp}= Post Request dcaegen2-d1 ${evtpath} data=${evtdata} headers=${httpheaders}
#Log Received response from dcae ${resp.json()}
[return] ${resp}
-
Publish Event To VES Collector With Put Method
[Documentation] Send an event to VES Collector
[Arguments] ${url} ${evtpath} ${httpheaders} ${evtdata} ${user} ${pd}
@@ -149,7 +123,6 @@ Publish Event To VES Collector With Put Method ${resp}= Put Request dcae-d1 ${evtpath} data=${evtdata} headers=${httpheaders}
#Log Received response from dcae ${resp.json()}
[return] ${resp}
-
Publish Event To VES Collector With Put Method No Auth
[Documentation] Send an event to VES Collector
[Arguments] ${url} ${evtpath} ${httpheaders} ${evtdata}
@@ -158,4 +131,3 @@ Publish Event To VES Collector With Put Method No Auth ${resp}= Put Request dcae-d1 ${evtpath} data=${evtdata} headers=${httpheaders}
#Log Received response from dcae ${resp.json()}
[return] ${resp}
-
\ No newline at end of file diff --git a/test/csit/tests/dcaegen2/testcases/resources/dcae_properties.robot b/test/csit/tests/dcaegen2/testcases/resources/dcae_properties.robot index be182d4aa..be072d73c 100644 --- a/test/csit/tests/dcaegen2/testcases/resources/dcae_properties.robot +++ b/test/csit/tests/dcaegen2/testcases/resources/dcae_properties.robot @@ -5,9 +5,11 @@ Documentation store all properties that can change or are used in multipl *** Variables ***
-${GLOBAL_APPLICATION_ID} robot-dcae
-${GLOBAL_DCAE_CONSUL_URL} http://135.205.228.129:8500
-${GLOBAL_DCAE_CONSUL_URL1} http://135.205.228.170:8500
+${GLOBAL_APPLICATION_ID} robot-dcaegen2
+${GLOBAL_DCAE_CONSUL_URL} http://135.205.228.129:8500
+${GLOBAL_DCAE_CONSUL_URL1} http://135.205.228.170:8500
${GLOBAL_DCAE_VES_URL} http://localhost:8443/eventlistener/v5
${GLOBAL_DCAE_USERNAME} console
${GLOBAL_DCAE_PASSWORD} ZjJkYjllMjljMTI2M2Iz
+${VESC_HTTPS_USER} sample1
+${VESC_HTTPS_PD} sample1
diff --git a/test/csit/tests/dcaegen2/testcases/resources/vesc_enable_https_auth.sh b/test/csit/tests/dcaegen2/testcases/resources/vesc_enable_https_auth.sh new file mode 100755 index 000000000..12989911b --- /dev/null +++ b/test/csit/tests/dcaegen2/testcases/resources/vesc_enable_https_auth.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# +# Copyright 2016-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. + +docker exec -it vesc /opt/app/VESCollector/bin/VESrestfulCollector.sh stop +sleep 2 +docker cp ${WORKSPACE}/test/csit/tests/dcaegen2/testcases/resources/collector.properties vesc:/opt/app/VESCollector/etc +sleep 10 +docker exec -id vesc /opt/app/VESCollector/bin/VESrestfulCollector.sh start +sleep 5 +echo "VES Collector Restarted" diff --git a/test/csit/tests/multicloud-vmware/nova/jsoninput/multicloud_create_server.json b/test/csit/tests/multicloud-vmware/nova/jsoninput/multicloud_create_server.json new file mode 100644 index 000000000..ecaaa12d1 --- /dev/null +++ b/test/csit/tests/multicloud-vmware/nova/jsoninput/multicloud_create_server.json @@ -0,0 +1,16 @@ +{ + "server": + { + "name": "server-csit-1", + "boot": + { + "type":2, + "imageId": "08edf57c-e65d-4778-957a-1524ff795c4b" + }, + "flavorId": "1", + "nicArray": + [{ + "portId": "71847500-8edf-42f9-be69-78432ccadc6e" + }] + } +}
\ No newline at end of file diff --git a/test/csit/tests/multicloud-vmware/nova/sanity-flavor.robot b/test/csit/tests/multicloud-vmware/nova/sanity-flavor.robot new file mode 100644 index 000000000..5adafb5af --- /dev/null +++ b/test/csit/tests/multicloud-vmware/nova/sanity-flavor.robot @@ -0,0 +1,62 @@ +*** settings *** +Resource ../../common.robot +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json +Library HttpLibrary.HTTP + + +*** Variables *** +@{return_ok_list}= 200 201 202 +${get_token_url} /api/multicloud-vio/v0/vmware_fake/identity/v3/auth/tokens + +#json files +${auth_info_json} ${SCRIPTS}/../tests/multicloud-vmware/provision/jsoninput/auth_info.json + +#global vars +${TOKEN} +${TENANTID} +${flavor1Id} + +*** Test Cases *** + +GetAuthToken + [Documentation] Sanity test - Get Auth Token + ${json_value}= json_from_file ${auth_info_json} + ${json_string}= string_from_json ${json_value} + ${headers} Create Dictionary Content-Type=application/json Accept=application/json + Create Session web_session http://${VIO_IP}:9004 headers=${headers} + ${resp}= POST Request web_session ${get_token_url} ${json_string} + ${responese_code}= Convert To String ${resp.status_code} + List Should Contain Value ${return_ok_list} ${responese_code} + ${response_json} json.loads ${resp.content} + ${TOKEN}= Convert To String ${response_json['token']['value']} + ${TENANTID}= Convert To String ${response_json['token']['project']['id']} + Set Global Variable ${TOKEN} + Set Global Variable ${TENANTID} + + +ListFlavorsFuncTest + [Documentation] get a list of flavors info rest test + ${headers} Create Dictionary Content-Type=application/json Accept=application/json X-Auth-Token=${TOKEN} + Create Session web_session http://${VIO_IP}:9004 headers=${headers} + ${resp}= GET Request web_session api/multicloud-vio/v0/vmware_fake/nova/${TENANTID}/flavors + ${response_code}= Convert To String ${resp.status_code} + List Should Contain Value ${return_ok_list} ${response_code} + ${response_json} json.loads ${resp.content} + #Log To Console ${response_json} + ${flavor1Id}= Convert To String ${response_json['flavors'][0]['id']} + Set Global Variable ${flavor1Id} + #Log To Console ${flavor1Id} + +GetFlavorFuncTest + [Documentation] get the specific flavor info rest test + ${headers} Create Dictionary Content-Type=application/json Accept=application/json X-Auth-Token=${TOKEN} + Create Session web_session http://${VIO_IP}:9004 headers=${headers} + ${resp}= GET Request web_session api/multicloud-vio/v0/vmware_fake/nova/${TENANTID}/flavors/${flavor1Id} + ${response_code}= Convert To String ${resp.status_code} + List Should Contain Value ${return_ok_list} ${response_code} + ${response_json} json.loads ${resp.content} + #Log To Console ${response_json} + diff --git a/test/csit/tests/multicloud-vmware/nova/sanity-host.robot b/test/csit/tests/multicloud-vmware/nova/sanity-host.robot new file mode 100644 index 000000000..444c68e1a --- /dev/null +++ b/test/csit/tests/multicloud-vmware/nova/sanity-host.robot @@ -0,0 +1,83 @@ +*** settings *** +Resource ../../common.robot +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json +Library HttpLibrary.HTTP + + +*** Variables *** +@{return_ok_list}= 200 201 202 +${get_token_url} /api/multicloud-vio/v0/vmware_fake/identity/v3/auth/tokens + +#json files +${auth_info_json} ${SCRIPTS}/../tests/multicloud-vmware/provision/jsoninput/auth_info.json + +#global vars +${TOKEN} +${TENANTID} +${host1Id} + +*** Test Cases *** + +GetAuthToken + [Documentation] Sanity test - Get Auth Token + ${json_value}= json_from_file ${auth_info_json} + ${json_string}= string_from_json ${json_value} + ${headers} Create Dictionary Content-Type=application/json Accept=application/json + Create Session web_session http://${VIO_IP}:9004 headers=${headers} + ${resp}= POST Request web_session ${get_token_url} ${json_string} + ${responese_code}= Convert To String ${resp.status_code} + List Should Contain Value ${return_ok_list} ${responese_code} + ${response_json} json.loads ${resp.content} + ${TOKEN}= Convert To String ${response_json['token']['value']} + ${TENANTID}= Convert To String ${response_json['token']['project']['id']} + Set Global Variable ${TOKEN} + Set Global Variable ${TENANTID} + +TestListHosts + [Documentation] Sanity Test - List Hosts + ${headers} Create Dictionary Content-Type=application/json Accept=application/json X-Auth-Token=${TOKEN} + Create Session web_session http://${VIO_IP}:9004 headers=${headers} + ${resp}= Get Request web_session api/multicloud-vio/v0/vmware_fake/nova/${TENANTID}/os-hypervisors/detail + ${response_code}= Convert To String ${resp.status_code} + List Should Contain Value ${return_ok_list} ${response_code} + ${response_json} json.loads ${resp.content} + #Log To Console ${response_json} + ${host1Id}= Convert To String ${response_json['hypervisors'][0]['service']['id']} + Set Global Variable ${host1Id} + +TestGetHost + [Documentation] Sanity Test - Get Host + ${headers} Create Dictionary Content-Type=application/json Accept=application/json X-Auth-Token=${TOKEN} + Create Session web_session http://${VIO_IP}:9004 headers=${headers} + ${resp}= Get Request web_session api/multicloud-vio/v0/vmware_fake/nova/${TENANTID}/os-hypervisors/${host1Id} + ${response_code}= Convert To String ${resp.status_code} + List Should Contain Value ${return_ok_list} ${response_code} + ${response_json} json.loads ${resp.content} + #Log To Console ${response_json} + +TestHostUptime + [Documentation] Sanity Test - Host Uptime + ${headers} Create Dictionary Content-Type=application/json Accept=application/json X-Auth-Token=${TOKEN} + Create Session web_session http://${VIO_IP}:9004 headers=${headers} + ${resp}= Get Request web_session api/multicloud-vio/v0/vmware_fake/nova/${TENANTID}/os-hypervisors/uptime + ${response_code}= Convert To String ${resp.status_code} + List Should Contain Value ${return_ok_list} ${response_code} + ${response_json} json.loads ${resp.content} + #Log To Console ${response_json} + + +TestHostAggregates + [Documentation] Sanity Test - Host Aggregates + ${headers} Create Dictionary Content-Type=application/json Accept=application/json X-Auth-Token=${TOKEN} + Create Session web_session http://${VIO_IP}:9004 headers=${headers} + ${resp}= Get Request web_session api/multicloud-vio/v0/vmware_fake/nova/${TENANTID}/os-aggregates + ${response_code}= Convert To String ${resp.status_code} + List Should Contain Value ${return_ok_list} ${response_code} + ${response_json} json.loads ${resp.content} + #Log To Console ${response_json} + + + diff --git a/test/csit/tests/multicloud-vmware/nova/sanity-server.robot b/test/csit/tests/multicloud-vmware/nova/sanity-server.robot new file mode 100755 index 000000000..7a092e6f0 --- /dev/null +++ b/test/csit/tests/multicloud-vmware/nova/sanity-server.robot @@ -0,0 +1,105 @@ +*** settings *** +Resource ../../common.robot +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json +Library HttpLibrary.HTTP + + +*** Variables *** +@{return_ok_list}= 200 201 202 +@{delete_ok_list}= 200 204 +${get_token_url} /api/multicloud-vio/v0/vmware_fake/identity/v3/auth/tokens + +#json files +${auth_info_json} ${SCRIPTS}/../tests/multicloud-vmware/provision/jsoninput/auth_info.json +${multicloud_create_server_json} ${SCRIPTS}/../tests/multicloud-vmware/nova/jsoninput/multicloud_create_server.json + +#global vars +${TOKEN} +${TENANTID} +${server1Id} + +*** Test Cases *** + +GetAuthToken + [Documentation] Sanity test - Get Auth Token + ${json_value}= json_from_file ${auth_info_json} + ${json_string}= string_from_json ${json_value} + ${headers} Create Dictionary Content-Type=application/json Accept=application/json + Create Session web_session http://${VIO_IP}:9004 headers=${headers} + ${resp}= POST Request web_session ${get_token_url} ${json_string} + ${responese_code}= Convert To String ${resp.status_code} + List Should Contain Value ${return_ok_list} ${responese_code} + ${response_json} json.loads ${resp.content} + ${TOKEN}= Convert To String ${response_json['token']['value']} + ${TENANTID}= Convert To String ${response_json['token']['project']['id']} + Set Global Variable ${TOKEN} + Set Global Variable ${TENANTID} + +CreateServerFuncTest + [Documentation] Sanity Test - Create Server + ${json_value}= json_from_file ${multicloud_create_server_json} + ${json_string}= string_from_json ${json_value} + ${headers} Create Dictionary Content-Type=application/json Accept=application/json X-Auth-Token=${TOKEN} + Create Session web_session http://${VIO_IP}:9004 headers=${headers} + Set Request Body ${json_string} + #Log To Console ${json_string} + ${resp}= Post Request web_session api/multicloud-vio/v0/vmware_fake/nova/${TENANTID}/servers ${json_string} + ${response_code}= Convert To String ${resp.status_code} + List Should Contain Value ${return_ok_list} ${response_code} + ${response_json} json.loads ${resp.content} + #Log To Console ${response_json} + ${server1Id}= Convert To String ${response_json['server']['id']} + Set Global Variable ${server1Id} + + +GetServersFuncTest + [Documentation] Sanity Test - Get Servers + ${headers} Create Dictionary Content-Type=application/json Accept=application/json X-Auth-Token=${TOKEN} + Create Session web_session http://${VIO_IP}:9004 headers=${headers} + ${resp}= Get Request web_session api/multicloud-vio/v0/vmware_fake/nova/${TENANTID}/servers + ${response_code}= Convert To String ${resp.status_code} + List Should Contain Value ${return_ok_list} ${response_code} + ${response_json} json.loads ${resp.content} + #Log To Console ${response_json} + #Log To Console ${server1Id} + +GetServerDetailFuncTest + [Documentation] Sanity Test - Get Server Detail + ${headers} Create Dictionary Content-Type=application/json Accept=application/json X-Auth-Token=${TOKEN} + Create Session web_session http://${VIO_IP}:9004 headers=${headers} + ${resp}= Get Request web_session api/multicloud-vio/v0/vmware_fake/nova/${TENANTID}/servers/detail + ${response_code}= Convert To String ${resp.status_code} + List Should Contain Value ${return_ok_list} ${response_code} + ${response_json} json.loads ${resp.content} + #Log To Console ${response_json} + +GetServerFuncTest + [Documentation] Sanity Test - Get Server + ${headers} Create Dictionary Content-Type=application/json Accept=application/json X-Auth-Token=${TOKEN} + Create Session web_session http://${VIO_IP}:9004 headers=${headers} + ${resp}= Get Request web_session api/multicloud-vio/v0/vmware_fake/nova/${TENANTID}/servers/${server1Id} + ${response_code}= Convert To String ${resp.status_code} + List Should Contain Value ${return_ok_list} ${response_code} + ${response_json} json.loads ${resp.content} + #Log To Console ${response_json} + +ServerActionFuncTest + [Documentation] Sanity Test - Server Action + ${headers} Create Dictionary Content-Type=application/json Accept=application/json X-Auth-Token=${TOKEN} + Create Session web_session http://${VIO_IP}:9004 headers=${headers} + ${resp}= Get Request web_session api/multicloud-vio/v0/vmware_fake/nova/${TENANTID}/servers/${server1Id}/action + ${response_code}= Convert To String ${resp.status_code} + List Should Contain Value ${return_ok_list} ${response_code} + ${response_json} json.loads ${resp.content} + #Log To Console ${response_json} + +DeleteServerFuncTest + [Documentation] Sanity Test - Delete Server + ${headers} Create Dictionary Content-Type=application/json Accept=application/json X-Auth-Token=${TOKEN} + Create Session web_session http://${VIO_IP}:9004 headers=${headers} + ${resp}= Delete Request web_session api/multicloud-vio/v0/vmware_fake/nova/${TENANTID}/servers/${server1Id} + ${response_code}= Convert To String ${resp.status_code} + List Should Contain Value ${delete_ok_list} ${response_code} diff --git a/test/csit/tests/multicloud-vmware/provision/jsoninput/auth_info.json b/test/csit/tests/multicloud-vmware/provision/jsoninput/auth_info.json new file mode 100644 index 000000000..6d42f84d4 --- /dev/null +++ b/test/csit/tests/multicloud-vmware/provision/jsoninput/auth_info.json @@ -0,0 +1,10 @@ +{ + "auth": + { + "scope": {"project": {"id": "a71c87345ad14533aa6496fca69d4840"}}, + "identity": + { + "password": {"user": {"domain": {"name": "Default"}, "password": "vmware", "name": "admin"}}, "methods": ["password"] + } + } +} diff --git a/test/csit/tests/multicloud-vmware/provision/sanity_test_image.robot b/test/csit/tests/multicloud-vmware/provision/sanity_test_image.robot new file mode 100644 index 000000000..0a6f2f5e8 --- /dev/null +++ b/test/csit/tests/multicloud-vmware/provision/sanity_test_image.robot @@ -0,0 +1,78 @@ +*** settings *** +Resource ../../common.robot +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json +Library HttpLibrary.HTTP + + +*** Variables *** +@{return_ok_list}= 200 201 202 +@{delete_ok_list}= 200 204 +${get_token_url} /api/multicloud-vio/v0/vmware_fake/identity/v3/auth/tokens +${get_image_url} /api/multicloud-vio/v0/vmware_fake/glance/v2/images +${get_image_schema_url} /api/multicloud-vio/v0/vmware_fake/glance/v2/schemas/image + + +#json files +${auth_info_json} ${SCRIPTS}/../tests/multicloud-vmware/provision/jsoninput/auth_info.json + +#global vars +${TOKEN} +${IMAGEID} + +*** Test Cases *** + +GetAuthToken + [Documentation] Sanity test - Get Auth Token + ${json_value}= json_from_file ${auth_info_json} + ${json_string}= string_from_json ${json_value} + ${headers} Create Dictionary Content-Type=application/json Accept=application/json + Create Session web_session http://${VIO_IP}:9004 headers=${headers} + ${resp}= POST Request web_session ${get_token_url} ${json_string} + ${responese_code}= Convert To String ${resp.status_code} + List Should Contain Value ${return_ok_list} ${responese_code} + ${response_json} json.loads ${resp.content} + ${TOKEN}= Convert To String ${response_json['token']['value']} + ${TENANTID}= Convert To String ${response_json['token']['project']['id']} + Set Global Variable ${TOKEN} + + + + + +TestCaseShoeImageSchema + [Documentation] Sanity test - Show Image Schema + ${headers} Create Dictionary Content-Type=application/json Accept=application/json X-Auth-Token=${TOKEN} + Create Session web_session http://${VIO_IP}:9004 headers=${headers} + ${resp}= Get Request web_session ${get_image_schema_url} + ${responese_code}= Convert To String ${resp.status_code} + List Should Contain Value ${return_ok_list} ${responese_code} + + + + +TestCaseListImages + [Documentation] Sanity test - List Images + ${headers} Create Dictionary Content-Type=application/json Accept=application/json X-Auth-Token=${TOKEN} + Create Session web_session http://${VIO_IP}:9004 headers=${headers} + ${resp}= Get Request web_session ${get_image_url} + ${responese_code}= Convert To String ${resp.status_code} + List Should Contain Value ${return_ok_list} ${responese_code} + ${response_json} json.loads ${resp.content} + ${IMAGEID}= Convert To String ${response_json['images'][0]['id']} + Set Global Variable ${IMAGEID} + + + + +TestCaseShowImage + [Documentation] Sanity test - Show Image + ${headers} Create Dictionary Content-Type=application/json Accept=application/json X-Auth-Token=${TOKEN} + Create Session web_session http://${VIO_IP}:9004 headers=${headers} + ${resp}= Get Request web_session ${get_image_url}/${IMAGEID} + ${responese_code}= Convert To String ${resp.status_code} + List Should Contain Value ${return_ok_list} ${responese_code} + ${response_json} json.loads ${resp.content} + Should Be Equal ${response_json['status']} active diff --git a/test/csit/tests/multicloud-vmware/provision/sanity_test_neutron.robot b/test/csit/tests/multicloud-vmware/provision/sanity_test_neutron.robot new file mode 100644 index 000000000..d38b9983b --- /dev/null +++ b/test/csit/tests/multicloud-vmware/provision/sanity_test_neutron.robot @@ -0,0 +1,62 @@ +*** settings *** +Resource ../../common.robot +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json +Library HttpLibrary.HTTP + + +*** Variables *** +@{return_ok_list}= 200 201 202 +@{delete_ok_list}= 200 204 +${get_token_url} /api/multicloud-vio/v0/vmware_fake/identity/v3/auth/tokens +${get_networks_url} /api/multicloud-vio/v0/vmware_fake/neutron/networks + +#json files +${auth_info_json} ${SCRIPTS}/../tests/multicloud-vmware/provision/jsoninput/auth_info.json + +#global vars +${TOKEN} +${NETWORKID} + +*** Test Cases *** + +GetAuthToken + [Documentation] Sanity test - Get Auth Token + ${json_value}= json_from_file ${auth_info_json} + ${json_string}= string_from_json ${json_value} + ${headers} Create Dictionary Content-Type=application/json Accept=application/json + Create Session web_session http://${VIO_IP}:9004 headers=${headers} + ${resp}= POST Request web_session ${get_token_url} ${json_string} + ${responese_code}= Convert To String ${resp.status_code} + List Should Contain Value ${return_ok_list} ${responese_code} + ${response_json} json.loads ${resp.content} + ${TOKEN}= Convert To String ${response_json['token']['value']} + ${TENANTID}= Convert To String ${response_json['token']['project']['id']} + Set Global Variable ${TOKEN} + + +TestCaseListNetworks + [Documentation] Sanity test - List Networks + ${headers} Create Dictionary Content-Type=application/json Accept=application/json X-Auth-Token=${TOKEN} + Create Session web_session http://${VIO_IP}:9004 headers=${headers} + ${resp}= Get Request web_session ${get_networks_url} + ${responese_code}= Convert To String ${resp.status_code} + List Should Contain Value ${return_ok_list} ${responese_code} + ${response_json} json.loads ${resp.content} + ${NETWORKID}= Convert To String ${response_json['networks'][0]['id']} + Set Global Variable ${NETWORKID} + + + + +TestCaseShowNetwork + [Documentation] Sanity test - Show Network + ${headers} Create Dictionary Content-Type=application/json Accept=application/json X-Auth-Token=${TOKEN} + Create Session web_session http://${VIO_IP}:9004 headers=${headers} + ${resp}= Get Request web_session ${get_networks_url}/${NETWORKID} + ${responese_code}= Convert To String ${resp.status_code} + List Should Contain Value ${return_ok_list} ${responese_code} + ${response_json} json.loads ${resp.content} + Should Be Equal ${response_json['network']['status']} ACTIVE diff --git a/test/csit/tests/multicloud-vmware/provision/sanity_test_tenant.robot b/test/csit/tests/multicloud-vmware/provision/sanity_test_tenant.robot new file mode 100644 index 000000000..86d569ee9 --- /dev/null +++ b/test/csit/tests/multicloud-vmware/provision/sanity_test_tenant.robot @@ -0,0 +1,59 @@ +*** settings *** +Resource ../../common.robot +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json +Library HttpLibrary.HTTP + + +*** Variables *** +@{return_ok_list}= 200 201 202 +@{delete_ok_list}= 200 204 +${get_token_url} /api/multicloud-vio/v0/vmware_fake/identity/v3/auth/tokens +${get_project_url} /api/multicloud-vio/v0/vmware_fake/identity/projects + +#json files +${auth_info_json} ${SCRIPTS}/../tests/multicloud-vmware/provision/jsoninput/auth_info.json + +#global vars +${TOKEN} +${TENANTID} + +*** Test Cases *** + +GetAuthToken + [Documentation] Sanity test - Get Auth Token + ${json_value}= json_from_file ${auth_info_json} + ${json_string}= string_from_json ${json_value} + ${headers} Create Dictionary Content-Type=application/json Accept=application/json + Create Session web_session http://${VIO_IP}:9004 headers=${headers} + ${resp}= POST Request web_session ${get_token_url} ${json_string} + ${responese_code}= Convert To String ${resp.status_code} + List Should Contain Value ${return_ok_list} ${responese_code} + ${response_json} json.loads ${resp.content} + ${TOKEN}= Convert To String ${response_json['token']['value']} + ${TENANTID}= Convert To String ${response_json['token']['project']['id']} + Set Global Variable ${TOKEN} + Set Global Variable ${TENANTID} + + +TestCaseListTenants + [Documentation] Sanity test - List Tenants + ${headers} Create Dictionary Content-Type=application/json Accept=application/json X-Auth-Token=${TOKEN} + Create Session web_session http://${VIO_IP}:9004 headers=${headers} + ${resp}= Get Request web_session ${get_project_url} + ${responese_code}= Convert To String ${resp.status_code} + List Should Contain Value ${return_ok_list} ${responese_code} + ${response_json} json.loads ${resp.content} + + + +TestCaseShowTenants + [Documentation] Sanity test - Show Tenant + ${headers} Create Dictionary Content-Type=application/json Accept=application/json X-Auth-Token=${TOKEN} + Create Session web_session http://${VIO_IP}:9004 headers=${headers} + ${resp}= Get Request web_session ${get_project_url}/${TENANTID} + ${responese_code}= Convert To String ${resp.status_code} + List Should Contain Value ${return_ok_list} ${responese_code} + ${response_json} json.loads ${resp.content} diff --git a/test/csit/tests/multicloud-vmware/provision/sanity_test_vio.robot b/test/csit/tests/multicloud-vmware/provision/sanity_test_vio.robot new file mode 100644 index 000000000..d353f1da0 --- /dev/null +++ b/test/csit/tests/multicloud-vmware/provision/sanity_test_vio.robot @@ -0,0 +1,22 @@ +*** settings *** +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json + +*** Variables *** +@{return_ok_list}= 200 201 202 +${queryswagger_vio_url} /api/multicloud-vio/v0/swagger.json + + +*** Test Cases *** +VioSwaggerTest + [Documentation] query swagger info rest test + ${headers} Create Dictionary Content-Type=application/json Accept=application/json + Create Session web_session http://${VIO_IP}:9004 headers=${headers} + ${resp}= Get Request web_session ${queryswagger_vio_url} + ${responese_code}= Convert To String ${resp.status_code} + List Should Contain Value ${return_ok_list} ${responese_code} + ${response_json} json.loads ${resp.content} + ${swagger_version}= Convert To String ${response_json['swagger']} + Should Be Equal ${swagger_version} 2.0 diff --git a/test/csit/tests/so/sanity-check/data/activateService.json b/test/csit/tests/so/sanity-check/data/activateService.json new file mode 100644 index 000000000..e2f749f78 --- /dev/null +++ b/test/csit/tests/so/sanity-check/data/activateService.json @@ -0,0 +1,23 @@ +{ +"requestDetails": { +"modelInfo": { +"modelType": "service", +"modelInvariantId": "ff3514e3-5a33-55df-13ab-12abad84e7ff", +"modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe", +"modelName": "Test", +"modelVersion": "1.0" +}, +"requestInfo": { +"source": "VID", +"requestorId": "az2016" +}, +"requestParameters": { +"userParams": [ +{ +"name": "aic_zone", +"value": "someValue" +} +] +} +} +} diff --git a/test/csit/tests/so/sanity-check/data/createNetwork.json b/test/csit/tests/so/sanity-check/data/createNetwork.json new file mode 100644 index 000000000..901e51747 --- /dev/null +++ b/test/csit/tests/so/sanity-check/data/createNetwork.json @@ -0,0 +1,35 @@ +{ + "requestDetails": { + "modelInfo": { + "modelType": "network", + "modelName": "CONTRAIL30_BASIC" + }, + "cloudConfiguration": { + "lcpCloudRegionId": "mdt1", + "tenantId": "8b1df54faa3b49078e3416e21370a3ba" + }, + "requestInfo": { + "instanceName": "GN_EVPN_direct_net_0_ST_Subnets_Ipv4", + "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "source": "VID", + "suppressRollback": true + }, + "relatedInstanceList": [ + { + "relatedInstance": { + "instanceId": " {serviceInstanceId} ", + "modelInfo": { + "modelType": "service", + "modelInvariantId": "ff3514e3-5a33-55df-13ab-12abad84e7ff", + "modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe", + "modelName": "{parent\tservice\tmodel\tname}", + "modelVersion": "1.0" + } + } + } + ], + "requestParameters": { + "userParams": [] + } + } +} diff --git a/test/csit/tests/so/sanity-check/data/createVF.json b/test/csit/tests/so/sanity-check/data/createVF.json new file mode 100644 index 000000000..4969d5425 --- /dev/null +++ b/test/csit/tests/so/sanity-check/data/createVF.json @@ -0,0 +1,59 @@ +{ + "requestDetails": { + "modelInfo": { + "modelType": "vfModule", + "modelInvariantId": "ff5256d2-5a33-55df-13ab-12abad84e7ff", + "modelNameVersionId": "fe6478e5-ea33-3346-ac12-ab121484a3fe", + "modelName": "vSAMP12..base..module-0", + "modelVersion": "1" + }, + "cloudConfiguration": { + "lcpCloudRegionId": "mdt1", + "tenantId": "88a6ca3ee0394ade9403f075db23167e" + }, + "requestInfo": { + "instanceName": "MSOTEST103a-vSAMP12_base_module-0", + "source": "VID", + "suppressRollback": true + }, + "relatedInstanceList": [ + { + "relatedInstance": { + "instanceId": "17ef4658-bd1f-4ef0-9ca0-ea76e2bf122c", + "instanceName": "MSOTESTVOL103a-vSAMP12_base_module-0_vol", + "modelInfo": { + "modelType": "volumeGroup" + } + } + }, + { + "relatedInstance": { + "instanceId": " {serviceInstanceId} ", + "modelInfo": { + "modelType": "service", + "modelInvariantId": "ff3514e3-5a33-55df-13ab-12abad84e7ff", + "modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe", + "modelName": "{parent\tservice\tmodel\tname}", + "modelVersion": "1.0" + } + } + }, + { + "relatedInstance": { + "instanceId": " {vnfInstanceId} ", + "modelInfo": { + "modelType": "vnf", + "modelInvariantId": "ff5256d1-5a33-55df-13ab-12abad84e7ff", + "modelNameVersionId": "fe6478e4-ea33-3346-ac12-ab121484a3fe", + "modelName": " vSAMP12 ", + "modelVersion": "1.0", + "modelCustomizationName": "vSAMP12 1" + } + } + } + ], + "requestParameters": { + "userParams": [] + } + } +} diff --git a/test/csit/tests/so/sanity-check/data/createVG.json b/test/csit/tests/so/sanity-check/data/createVG.json new file mode 100644 index 000000000..13bf3e996 --- /dev/null +++ b/test/csit/tests/so/sanity-check/data/createVG.json @@ -0,0 +1,47 @@ +{ + "requestDetails": { + "modelInfo": { + "modelType": "volumeGroup", + "modelInvariantId": "ff5256d2-5a33-55df-13ab-12abad84e7ff", + "modelNameVersionId": "fe6478e5-ea33-3346-ac12-ab121484a3fe", + "modelName": "vSAMP12..base..module-0", + "modelVersion": "1" + }, + "cloudConfiguration": { + "lcpCloudRegionId": "mdt1", + "tenantId": "88a6ca3ee0394ade9403f075db23167e" + }, + "requestInfo": { + "instanceName": "MSOTESTVOL103a-vSAMP12_base_module-0_vol", + "source": "VID", + "suppressRollback": true + }, + "relatedInstanceList": [ + { + "relatedInstance": { + "instanceId": " {serviceInstanceId} ", + "modelInfo": { + "modelType": "service", + "modelInvariantId": "ff3514e3-5a33-55df-13ab-12abad84e7ff", + "modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe", + "modelName": "{parent\tservice\tmodel\tname}", + "modelVersion": "1.0" + } + } + }, + { + "relatedInstance": { + "instanceId": " {vnfInstanceId} ", + "modelInfo": { + "modelType": "vnf", + "modelInvariantId": "ff5256d1-5a33-55df-13ab-12abad84e7ff", + "modelNameVersionId": "fe6478e4-ea33-3346-ac12-ab121484a3fe", + "modelName": "vSAMP12", + "modelVersion": "1.0", + "modelCustomizationName": "vSAMP12 1" + } + } + } + ] + } +} diff --git a/test/csit/tests/so/sanity-check/data/deactivateService.json b/test/csit/tests/so/sanity-check/data/deactivateService.json new file mode 100644 index 000000000..e2f749f78 --- /dev/null +++ b/test/csit/tests/so/sanity-check/data/deactivateService.json @@ -0,0 +1,23 @@ +{ +"requestDetails": { +"modelInfo": { +"modelType": "service", +"modelInvariantId": "ff3514e3-5a33-55df-13ab-12abad84e7ff", +"modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe", +"modelName": "Test", +"modelVersion": "1.0" +}, +"requestInfo": { +"source": "VID", +"requestorId": "az2016" +}, +"requestParameters": { +"userParams": [ +{ +"name": "aic_zone", +"value": "someValue" +} +] +} +} +} diff --git a/test/csit/tests/so/sanity-check/data/deleteNetwork.json b/test/csit/tests/so/sanity-check/data/deleteNetwork.json new file mode 100644 index 000000000..4bee07800 --- /dev/null +++ b/test/csit/tests/so/sanity-check/data/deleteNetwork.json @@ -0,0 +1,15 @@ +{ + "requestDetails": { + "modelInfo": { + "modelType": "network", + "modelName": "CONTRAIL30_BASIC" + }, + "cloudConfiguration": { + "lcpCloudRegionId": "mdt1", + "tenantId": "8b1df54faa3b49078e3416e21370a3ba" + }, + "requestInfo": { + "source": "VID" + } + } +} diff --git a/test/csit/tests/so/sanity-check/data/deleteVF.json b/test/csit/tests/so/sanity-check/data/deleteVF.json new file mode 100644 index 000000000..ac6023e81 --- /dev/null +++ b/test/csit/tests/so/sanity-check/data/deleteVF.json @@ -0,0 +1,17 @@ +{ + "requestDetails": { + "modelInfo": { + "modelType": "vfModule", + "modelInvariantId": "ff5256d2-5a33-55df-13ab-12abad84e7ff", + "modelName": "vSAMP12..base..module-0", + "modelVersion": "1" + }, + "cloudConfiguration": { + "lcpCloudRegionId": "mdt1", + "tenantId": "88a6ca3ee0394ade9403f075db23167e" + }, + "requestInfo": { + "source": "VID" + } + } +} diff --git a/test/csit/tests/so/sanity-check/data/deleteVG.json b/test/csit/tests/so/sanity-check/data/deleteVG.json new file mode 100644 index 000000000..cb238659c --- /dev/null +++ b/test/csit/tests/so/sanity-check/data/deleteVG.json @@ -0,0 +1,15 @@ +{ + "requestDetails": { + "modelInfo": { + "modelType": "volumeGroup", + "modelName": "vSAMP12..base..module-0" + }, + "cloudConfiguration": { + "lcpCloudRegionId": "mdt1", + "tenantId": "88a6ca3ee0394ade9403f075db23167e" + }, + "requestInfo": { + "source": "VID" + } + } +} diff --git a/test/csit/tests/so/sanity-check/data/replaceVF.json b/test/csit/tests/so/sanity-check/data/replaceVF.json new file mode 100644 index 000000000..231169960 --- /dev/null +++ b/test/csit/tests/so/sanity-check/data/replaceVF.json @@ -0,0 +1,60 @@ +{ + "requestDetails": { + "modelInfo": { + "modelType": "vfModule", + "modelInvariantId": "ff5256d2-5a33-55df-13ab-12abad84e7ff", + "modelNameVersionId": "fe6478e5-ea33-3346-ac12-ab121484a3fe", + "modelName": "vSAMP12..base..module-0", + "modelVersion": "2" + }, + "cloudConfiguration": { + "lcpCloudRegionId": "mdt1", + "tenantId": "88a6ca3ee0394ade9403f075db23167e" + }, + "requestInfo": { + "source": "VID", + "suppressRollback": true, + "requestorId": "az2016" + }, + "relatedInstanceList": [ + { + "relatedInstance": { + "instanceId": "17ef4658-bd1f-4ef0-9ca0-ea76e2bf122c", + "instanceName": "MSOTESTVOL103a-vSAMP12_base_module-0_vol", + "modelInfo": { + "modelType": "volumeGroup" + } + } + }, + { + "relatedInstance": { + "instanceId": " {serviceInstanceId} ", + "modelInfo": { + "modelType": "service", + "modelInvariantId": "ff3514e3-5a33-55df-13ab-12abad84e7ff", + "modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe", + "modelName": "{parent\tservice\tmodel\tname}", + "modelVersion": "2.0" + } + } + }, + { + "relatedInstance": { + "instanceId": " {vnfInstanceId} ", + "modelInfo": { + "modelType": "vnf", + "modelInvariantId": "ff5256d1-5a33-55df-13ab-12abad84e7ff", + "modelNameVersionId": "fe6478e4-ea33-3346-ac12-ab121484a3fe", + "modelName": " vSAMP12 ", + "modelVersion": "2.0", + "modelCustomizationName": "vSAMP12 1", + "modelCustomizationId": "c539433a-84a6-4082-a12e-5c9b00c3b960" + } + } + } + ], + "requestParameters": { + "userParams": [] + } + } +} diff --git a/test/csit/tests/so/sanity-check/data/replaceVnf.json b/test/csit/tests/so/sanity-check/data/replaceVnf.json new file mode 100644 index 000000000..18063750c --- /dev/null +++ b/test/csit/tests/so/sanity-check/data/replaceVnf.json @@ -0,0 +1,36 @@ +{ + "requestDetails": { + "modelInfo": { + "modelType": "", + "modelInvariantId": "ff5256d1-5a33-55df-13ab-12abad84e7ff", + "modelNameVersionId": "fe6478e4-ea33-3346-ac12-ab121484a3fe", + "modelName": "vSAMP12", + "modelVersion": "1.0", + "modelCustomizationName": "vSAMP12 1" + }, + "cloudConfiguration": { + "lcpCloudRegionId": "mdt1", + "tenantId": "88a6ca3ee0394ade9403f075db23167e" + }, + "requestInfo": { + "source": "VID", + "suppressRollback": false, + "requestorId": "az2016" + }, + "relatedInstanceList": [{ + "relatedInstance": { + "instanceId": " {serviceInstanceId} ", + "modelInfo": { + "modelType": "service", + "modelInvariantId": "ff3514e3-5a33-55df-13ab-12abad84e7ff", + "modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe", + "modelName": " {parent service model name} ", + "modelVersion": "2.0" + } + } + }], + "requestParameters": { + "rebuildVolumeGroups": false + } + } +} diff --git a/test/csit/tests/so/sanity-check/data/updateNetwork.json b/test/csit/tests/so/sanity-check/data/updateNetwork.json new file mode 100644 index 000000000..4d7639099 --- /dev/null +++ b/test/csit/tests/so/sanity-check/data/updateNetwork.json @@ -0,0 +1,34 @@ +{ + "requestDetails": { + "modelInfo": { + "modelType": "network", + "modelName": "CONTRAIL30_BASIC" + }, + "cloudConfiguration": { + "lcpCloudRegionId": "mdt1", + "tenantId": "8b1df54faa3b49078e3416e21370a3ba" + }, + "requestInfo": { + "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "source": "VID", + "suppressRollback": true + }, + "relatedInstanceList": [ + { + "relatedInstance": { + "instanceId": " {serviceInstanceId} ", + "modelInfo": { + "modelType": "service", + "modelInvariantId": "ff3514e3-5a33-55df-13ab-12abad84e7ff", + "modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe", + "modelName": "{parent\tservice\tmodel\tname}", + "modelVersion": "1.0" + } + } + } + ], + "requestParameters": { + "userParams": [] + } + } +} diff --git a/test/csit/tests/so/sanity-check/data/updateVF.json b/test/csit/tests/so/sanity-check/data/updateVF.json new file mode 100644 index 000000000..671cc7919 --- /dev/null +++ b/test/csit/tests/so/sanity-check/data/updateVF.json @@ -0,0 +1,61 @@ +{ + "requestDetails": { + "modelInfo": { + "modelType": "vfModule", + "modelInvariantId": "ff5256d2-5a33-55df-13ab-12abad84e7ff", + "modelNameVersionId": "fe6478e5-ea33-3346-ac12-ab121484a3fe", + "modelName": "vSAMP12..base..module-0", + "modelVersion": "1" + }, + "cloudConfiguration": { + "lcpCloudRegionId": "mdt1", + "tenantId": "88a6ca3ee0394ade9403f075db23167e" + }, + "requestInfo": { + "source": "VID", + "suppressRollback": true, + "requestorId": "az2016" + }, + "relatedInstanceList": [ + { + "relatedInstance": { + "instanceId": "17ef4658-bd1f-4ef0-9ca0-ea76e2bf122c", + "instanceName": "MSOTESTVOL103a-vSAMP12_base_module-0_vol", + "modelInfo": { + "modelType": "volumeGroup" + } + } + }, + { + "relatedInstance": { + "instanceId": " {serviceInstanceId} ", + "modelInfo": { + "modelType": "service", + "modelInvariantId": "ff3514e3-5a33-55df-13ab-12abad84e7ff", + "modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe", + "modelName": "{parent\tservice\tmodel\tname}", + "modelVersion": "2.0" + } + } + }, + { + "relatedInstance": { + "instanceId": " {vnfInstanceId} ", + "modelInfo": { + "modelType": "vnf", + "modelInvariantId": "ff5256d1-5a33-55df-13ab-12abad84e7ff", + "modelNameVersionId": "fe6478e4-ea33-3346-ac12-ab121484a3fe", + "modelName": " vSAMP12 ", + "modelVersion": "2.0", + "modelCustomizationName": "vSAMP12 1", + "modelCustomizationId": "c539433a-84a6-4082-a12e-5c9b00c3b960" + } + } + } + ], + "requestParameters": { + "usePreload": true, + "userParams": [] + } + } +} diff --git a/test/csit/tests/so/sanity-check/data/updateVnf.json b/test/csit/tests/so/sanity-check/data/updateVnf.json new file mode 100644 index 000000000..d6c39de90 --- /dev/null +++ b/test/csit/tests/so/sanity-check/data/updateVnf.json @@ -0,0 +1,39 @@ +{ + "requestDetails": { + "modelInfo": { + "modelType": "vnf", + "modelInvariantId": "ff5256d1-5a33-55df-13ab-12abad84e7ff", + "modelNameVersionId": "fe6478e4-ea33-3346-ac12-ab121484a3fe", + "modelName": "vSAMP12", + "modelVersion": "2.0", + "modelCustomizationName": "vSAMP12 1", + "modelCustomizationId": "c539433a-84a6-4082-a12e-5c9b00c3b960" + }, + "cloudConfiguration": { + "lcpCloudRegionId": "mdt1", + "tenantId": "88a6ca3ee0394ade9403f075db23167e" + }, + "requestInfo": { + "source": "VID", + "suppressRollback": false, + "requestorId": "az2016" + }, + "relatedInstanceList": [ + { + "relatedInstance": { + "instanceId": " {serviceInstanceId} ", + "modelInfo": { + "modelType": "service", + "modelInvariantId": "ff3514e3-5a33-55df-13ab-12abad84e7ff", + "modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe", + "modelName": " {parent service model name} ", + "modelVersion": "1.0" + } + } + } + ], + "requestParameters": { + "usePreload": true + } + } +} diff --git a/test/csit/tests/so/sanity-check/sanity_test_so.robot b/test/csit/tests/so/sanity-check/sanity_test_so.robot index 27a16fc38..065414569 100644 --- a/test/csit/tests/so/sanity-check/sanity_test_so.robot +++ b/test/csit/tests/so/sanity-check/sanity_test_so.robot @@ -36,7 +36,84 @@ Delete ServiceInstance for invalid user &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQxOnBhc3N3b3JkMTI== Content-Type=application/json Accept=application/json ${resp}= Delete Request refrepo /ecomp/mso/infra/serviceInstances/v3/ff305d54-75b4-431b-adb2-eb6b9e5ff000 data=${data} headers=${headers} Run Keyword If '${resp.status_code}' == '400' or '${resp.status_code}' == '404' or '${resp.status_code}' == '405' log to console \nexecuted with expected result + +Activate ServiceInstance + Create Session refrepo http://${REPO_IP}:8080 + ${data}= Get Binary File ${CURDIR}${/}data${/}activateService.json + &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json + ${resp}= Post Request refrepo /ecomp/mso/infra/serviceInstances/v5/ff305d54-75b4-431b-adb2-eb6b9e5ff000/activate data=${data} headers=${headers} + Run Keyword If '${resp.status_code}' == '400' or '${resp.status_code}' == '404' or '${resp.status_code}' == '405' log to console \nexecuted with expected result + +Deactivate ServiceInstance + Create Session refrepo http://${REPO_IP}:8080 + ${data}= Get Binary File ${CURDIR}${/}data${/}deactivateService.json + &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json + ${resp}= Post Request refrepo /ecomp/mso/infra/serviceInstances/v5/ff305d54-75b4-431b-adb2-eb6b9e5ff000/deactivate data=${data} headers=${headers} + Run Keyword If '${resp.status_code}' == '400' or '${resp.status_code}' == '404' or '${resp.status_code}' == '405' log to console \nexecuted with expected result + +Create Volume Group instance + Create Session refrepo http://${REPO_IP}:8080 + ${data}= Get Binary File ${CURDIR}${/}data${/}createVG.json + &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json + ${resp}= Post Request refrepo /ecomp/mso/infra/serviceInstances/v3/ff305d54-75b4-431b-adb2-eb6b9e5ff000/vnfs/aca51b0a-710d-4155-bc7c-7cef19d9a94e/volumeGroups data=${data} headers=${headers} + Run Keyword If '${resp.status_code}' == '400' or '${resp.status_code}' == '404' or '${resp.status_code}' == '405' log to console \nexecuted with expected result + +Delete Volume Group instance + Create Session refrepo http://${REPO_IP}:8080 + ${data}= Get Binary File ${CURDIR}${/}data${/}deleteVG.json + &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json + ${resp}= Delete Request refrepo /ecomp/mso/infra/serviceInstances/v3/ff305d54-75b4-431b-adb2-eb6b9e5ff000/vnfs/aca51b0a-710d-4155-bc7c-7cef19d9a94e/volumeGroups/ff305d54-75b4-ff1b-cdb2-eb6b9e5460ff data=${data} headers=${headers} + Run Keyword If '${resp.status_code}' == '400' or '${resp.status_code}' == '404' or '${resp.status_code}' == '405' log to console \nexecuted with expected result +Create VF Module instance + Create Session refrepo http://${REPO_IP}:8080 + ${data}= Get Binary File ${CURDIR}${/}data${/}createVF.json + &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json + ${resp}= Post Request refrepo /ecomp/mso/infra/serviceInstances/v3/ff305d54-75b4-431b-adb2-eb6b9e5ff000/vnfs/aca51b0a-710d-4155-bc7c-7cef19d9a94e/vfModules data=${data} headers=${headers} + Run Keyword If '${resp.status_code}' == '400' or '${resp.status_code}' == '404' or '${resp.status_code}' == '405' log to console \nexecuted with expected result + +Update VF Module instance + Create Session refrepo http://${REPO_IP}:8080 + ${data}= Get Binary File ${CURDIR}${/}data${/}updateVF.json + &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json + ${resp}= Post Request refrepo /ecomp/mso/infra/serviceInstances/v5/ff305d54-75b4-431b-adb2-eb6b9e5ff000/vnfs/aca51b0a-710d-4155-bc7c-7cef19d9a94e/vfModules/ff305d54-75b4-ff1b-bdb2-eb6b9e5460ff data=${data} headers=${headers} + Run Keyword If '${resp.status_code}' == '400' or '${resp.status_code}' == '404' or '${resp.status_code}' == '405' log to console \nexecuted with expected result + +Delete VF Module instance + Create Session refrepo http://${REPO_IP}:8080 + ${data}= Get Binary File ${CURDIR}${/}data${/}deleteVF.json + &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json + ${resp}= Delete Request refrepo /ecomp/mso/infra/serviceInstances/v3/ff305d54-75b4-431b-adb2-eb6b9e5ff000/vnfs/aca51b0a-710d-4155-bc7c-7cef19d9a94e/vfModules/ff305d54-75b4-ff1b-bdb2-eb6b9e5460ff data=${data} headers=${headers} + Run Keyword If '${resp.status_code}' == '400' or '${resp.status_code}' == '404' or '${resp.status_code}' == '405' log to console \nexecuted with expected result + +Replace VF Module instance + Create Session refrepo http://${REPO_IP}:8080 + ${data}= Get Binary File ${CURDIR}${/}data${/}replaceVF.json + &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json + ${resp}= Post Request refrepo /ecomp/mso/infra/serviceInstances/v5/ff305d54-75b4-431b-adb2-eb6b9e5ff000/vnfs/aca51b0a-710d-4155-bc7c-7cef19d9a94e/vfModules/ff305d54-75b4-ff1b-bdb2-eb6b9e5460ff/replace data=${data} headers=${headers} + Run Keyword If '${resp.status_code}' == '400' or '${resp.status_code}' == '404' or '${resp.status_code}' == '405' log to console \nexecuted with expected result + +Create Network instance + Create Session refrepo http://${REPO_IP}:8080 + ${data}= Get Binary File ${CURDIR}${/}data${/}createNetwork.json + &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json + ${resp}= Post Request refrepo /ecomp/mso/infra/serviceInstances/v3/ff305d54-75b4-431b-adb2-eb6b9e5ff000/networks data=${data} headers=${headers} + Run Keyword If '${resp.status_code}' == '400' or '${resp.status_code}' == '404' or '${resp.status_code}' == '405' log to console \nexecuted with expected result + +Update Network instance + Create Session refrepo http://${REPO_IP}:8080 + ${data}= Get Binary File ${CURDIR}${/}data${/}updateNetwork.json + &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json + ${resp}= Put Request refrepo /ecomp/mso/infra/serviceInstances/v3/ff305d54-75b4-431b-adb2-eb6b9e5ff000/networks/2b125640-bd1a-4ef0-9ca0-ea76e2a22801 data=${data} headers=${headers} + Run Keyword If '${resp.status_code}' == '400' or '${resp.status_code}' == '404' or '${resp.status_code}' == '405' log to console \nexecuted with expected result + +Delete Network instance + Create Session refrepo http://${REPO_IP}:8080 + ${data}= Get Binary File ${CURDIR}${/}data${/}deleteNetwork.json + &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json + ${resp}= Post Request refrepo /ecomp/mso/infra/serviceInstances/v3/ff305d54-75b4-431b-adb2-eb6b9e5ff000/networks/2b125640-bd1a-4ef0-9ca0-ea76e2a22801 data=${data} headers=${headers} + Run Keyword If '${resp.status_code}' == '400' or '${resp.status_code}' == '404' or '${resp.status_code}' == '405' log to console \nexecuted with expected result + SO ServiceInstance health check Create Session refrepo http://${REPO_IP}:8080 &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json @@ -47,7 +124,14 @@ Create VnfInstance for invalid input Create Session refrepo http://${REPO_IP}:8080 ${data}= Get Binary File ${CURDIR}${/}data${/}createVnf.json &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json - ${resp}= Post Request refrepo /ecomp/mso/infra/serviceInstances/v3/ff305d54-75b4-431b-adb2-eb6b9e5ff000/vnfs data=${data} headers=${headers} + ${resp}= Delete Request refrepo /ecomp/mso/infra/serviceInstances/v3/ff305d54-75b4-431b-adb2-eb6b9e5ff000/vnfs data=${data} headers=${headers} + Run Keyword If '${resp.status_code}' == '400' or '${resp.status_code}' == '404' or '${resp.status_code}' == '405' log to console \nexecuted with expected result + +Update VnfInstance for invalid input + Create Session refrepo http://${REPO_IP}:8080 + ${data}= Get Binary File ${CURDIR}${/}data${/}updateVnf.json + &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json + ${resp}= Delete Request refrepo /ecomp/mso/infra/serviceInstances/v5/ff305d54-75b4-431b-adb2-eb6b9e5ff000/vnfs/aca51b0a-710d-4155-bc7c-7cef19d9a94e data=${data} headers=${headers} Run Keyword If '${resp.status_code}' == '400' or '${resp.status_code}' == '404' or '${resp.status_code}' == '405' log to console \nexecuted with expected result Create VnfInstance for invalid credential @@ -63,13 +147,26 @@ Delete VnfInstance for invalid input &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json ${resp}= Delete Request refrepo /ecomp/mso/infra/serviceInstances/v3/ff305d54-75b4-431b-adb2-eb6b9e5ff000/vnfs/aca51b0a-710d-4155-bc7c-7cef19d9a94e data=${data} headers=${headers} Run Keyword If '${resp.status_code}' == '400' or '${resp.status_code}' == '404' or '${resp.status_code}' == '405' log to console \nexecuted with expected result + +Replace VnfInstance + Create Session refrepo http://${REPO_IP}:8080 + ${data}= Get Binary File ${CURDIR}${/}data${/}replaceVnf.json + &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQxOnBhc3N3b3JkMTI= Content-Type=application/json Accept=application/json + ${resp}= Post Request refrepo /ecomp/mso/infra/serviceInstances/v5/ff305d54-75b4-431b-adb2-eb6b9e5ff000/vnfs/aca51b0a-710d-4155-bc7c-c7cef19d94e/replace data=${data} headers=${headers} + Run Keyword If '${resp.status_code}' == '400' or '${resp.status_code}' == '404' or '${resp.status_code}' == '405' log to console \nexecuted with expected result Get Orchestration Requests Create Session refrepo http://${REPO_IP}:8080 &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json ${resp}= Get Request refrepo /ecomp/mso/infra/orchestrationRequests/v3 headers=${headers} Should Not Contain ${resp.content} null - + +Get Orchestration Requests Filter criteria + Create Session refrepo http://${REPO_IP}:8080 + &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json + ${resp}= Get Request refrepo /ecomp/mso/infra/orchestrationRequests/v3?filter=serviceInstanceId:EQUALS:bc305d54-75b4-431b-adb2-eb6b9e546014 headers=${headers} + Run Keyword If '${resp.status_code}' == '400' or '${resp.status_code}' == '404' or '${resp.status_code}' == '405' log to console \nexecuted with expected result + Create E2EService Create Session refrepo http://${REPO_IP}:8080 ${data}= Get Binary File ${CURDIR}${/}data${/}createE2eservice.json @@ -110,4 +207,4 @@ Delete E2EService with invalid input data ${data}= Get Binary File ${CURDIR}${/}data${/}deleteE2eserviceInvalid.json &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json ${resp}= Delete Request refrepo /ecomp/mso/infra/e2eServiceInstances/v3/ff305d54-75b4-431b-adb2-eb6b9e5ff000 data=${data} headers=${headers} - Run Keyword If '${resp.status_code}' == '400' or '${resp.status_code}' == '404' or '${resp.status_code}' == '405' log to console \nexecuted with expected result
\ No newline at end of file + Run Keyword If '${resp.status_code}' == '400' or '${resp.status_code}' == '404' or '${resp.status_code}' == '405' log to console \nexecuted with expected result diff --git a/test/csit/tests/usecase-ui/server/test.robot b/test/csit/tests/usecase-ui/server/test.robot new file mode 100644 index 000000000..cae75c4f6 --- /dev/null +++ b/test/csit/tests/usecase-ui/server/test.robot @@ -0,0 +1,14 @@ +*** settings *** +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json +Library HttpLibrary.HTTP + +*** Variables *** +@{return_ok_list}= 200 201 202 204 + +*** Test Cases *** +MonitorSwaggerTest + [Documentation] query Monitor swagger info rest test + Should Be Equal 2.0 2.0 diff --git a/test/csit/tests/vfc/gvnfm-vnflcm/jsoninput/create_vnf.json b/test/csit/tests/vfc/gvnfm-vnflcm/jsoninput/create_vnf.json new file mode 100644 index 000000000..554c4173e --- /dev/null +++ b/test/csit/tests/vfc/gvnfm-vnflcm/jsoninput/create_vnf.json @@ -0,0 +1,5 @@ +{ + "vnfdId": "111", + "vnfInstanceName": "vFW_01", + "vnfInstanceDescription": "vFW in Nanjing TIC Edge" +}
\ No newline at end of file diff --git a/test/csit/tests/vfc/gvnfm-vnflcm/test.robot b/test/csit/tests/vfc/gvnfm-vnflcm/test.robot index 47ff25f53..6a019624c 100644 --- a/test/csit/tests/vfc/gvnfm-vnflcm/test.robot +++ b/test/csit/tests/vfc/gvnfm-vnflcm/test.robot @@ -1,16 +1,26 @@ *** settings *** +Resource ../../common.robot Library Collections Library RequestsLibrary Library OperatingSystem Library json +Library HttpLibrary.HTTP *** Variables *** -@{return_ok_list}= 200 201 202 +@{return_ok_list}= 200 201 202 204 ${queryswagger_url} /api/vnflcm/v1/swagger.json +${create_vnf_url} /api/vnflcm/v1/vnf_instances +${delete_vnf_url} /api/vnflcm/v1/vnf_instances + +#json files +${create_vnf_json} ${SCRIPTS}/../tests/vfc/gvnfm-vnflcm/jsoninput/create_vnf.json + +#global variables +${vnfInstId} *** Test Cases *** VnflcmSwaggerTest - [Documentation] query swagger info vnflcm + [Documentation] query swagger info vnflcm by MSB ${headers} Create Dictionary Content-Type=application/json Accept=application/json Create Session web_session http://${VNFLCM_IP}:8801 headers=${headers} ${resp}= Get Request web_session ${queryswagger_url} @@ -18,4 +28,4 @@ VnflcmSwaggerTest List Should Contain Value ${return_ok_list} ${responese_code} ${response_json} json.loads ${resp.content} ${swagger_version}= Convert To String ${response_json['swagger']} - Should Be Equal ${swagger_version} 2.0 + Should Be Equal ${swagger_version} 2.0
\ No newline at end of file diff --git a/test/csit/tests/vfc/nfvo-driver-ems/test.robot b/test/csit/tests/vfc/nfvo-driver-ems/test.robot index a35a54288..e8414a579 100644..100755 --- a/test/csit/tests/vfc/nfvo-driver-ems/test.robot +++ b/test/csit/tests/vfc/nfvo-driver-ems/test.robot @@ -12,4 +12,18 @@ ${queryswagger_url} /api/emsdriver/v1/swagger EMSDriverSwaggerTest [Documentation] query swagger info of emsdriver ${headers} Create Dictionary Content-Type=application/json Accept=application/json - Should Be Equal 2.0 2.0 + Create Session web_session http://${EMS_DRV_IP}:8206 headers=${headers} + ${resp}= Get Request web_session ${queryswagger_url} + ${responese_code}= Convert To String ${resp.status_code} + List Should Contain Value ${return_ok_list} ${responese_code} + ${response_json} json.loads ${resp.content} + ${swagger_version}= Convert To String ${response_json['swagger']} + Should Be Equal ${swagger_version} 2.0 + +EMSDriverSwaggerByMSBTest + [Documentation] query swagger info of emsdriver by MSB + ${headers} Create Dictionary Content-Type=application/json Accept=application/json + Create Session web_session http://${MSB_IAG_IP}:80 headers=${headers} + ${resp}= Get Request web_session ${queryswagger_url} + ${responese_code}= Convert To String ${resp.status_code} + Should Be Equal 2.0 2.0
\ No newline at end of file diff --git a/test/csit/tests/vfc/nfvo-resmanagement/test.robot b/test/csit/tests/vfc/nfvo-resmanagement/test.robot index 526fb304e..2f2475535 100644 --- a/test/csit/tests/vfc/nfvo-resmanagement/test.robot +++ b/test/csit/tests/vfc/nfvo-resmanagement/test.robot @@ -1,4 +1,5 @@ *** settings *** +Resource ../../common.robot Library Collections Library RequestsLibrary Library simplejson @@ -20,4 +21,4 @@ SwaggerFuncTest List Should Contain Value ${return_ok_list} ${responese_code} ${response_json} json.loads ${resp.content} ${swagger_version}= Convert To String ${response_json['swagger']} - Should Be Equal ${swagger_version} 2.0 + Should Be Equal ${swagger_version} 2.0
\ No newline at end of file diff --git a/test/csit/tests/vnfsdk-marketplace/provision/enterprise2DC.csar b/test/csit/tests/vnfsdk-marketplace/provision/enterprise2DC.csar Binary files differindex f27947955..f18d52d60 100644 --- a/test/csit/tests/vnfsdk-marketplace/provision/enterprise2DC.csar +++ b/test/csit/tests/vnfsdk-marketplace/provision/enterprise2DC.csar |