aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/csit/plans/aai/resources/setup.sh16
-rwxr-xr-xtest/csit/plans/appc/healthcheck/db_query.sh66
-rwxr-xr-xtest/csit/plans/appc/healthcheck/setup.sh6
-rw-r--r--test/csit/plans/vfc-nfvo-driver-vnfm-svnfm/sanity-check/setup.sh11
-rw-r--r--test/csit/plans/vfc-nfvo-driver-vnfm-svnfm/sanity-check/teardown.sh2
-rw-r--r--test/csit/plans/vfc-nfvo-driver-vnfm-svnfm/sanity-check/testplan.txt2
-rw-r--r--test/csit/tests/aai/resources/suite1/pserver.robot39
-rw-r--r--test/csit/tests/appc/healthcheck/test1.robot5
-rw-r--r--test/csit/tests/cli/startup/startup_check.robot2
9 files changed, 116 insertions, 33 deletions
diff --git a/test/csit/plans/aai/resources/setup.sh b/test/csit/plans/aai/resources/setup.sh
index ee2046078..30b4b29b8 100644
--- a/test/csit/plans/aai/resources/setup.sh
+++ b/test/csit/plans/aai/resources/setup.sh
@@ -24,16 +24,14 @@ NEXUS_PASSWD=$(cat /opt/config/nexus_password.txt)
NEXUS_DOCKER_REPO=$(cat /opt/config/nexus_docker_repo.txt)
DOCKER_IMAGE_VERSION=$(cat /opt/config/docker_version.txt)
DOCKER_REGISTRY=${NEXUS_DOCKER_REPO}
-DOCKER_IMAGE_VERSION=$(cat /opt/config/docker_version.txt)
-
-docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO
+DOCKER_IMAGE_VERSION=1.1-STAGING-latest
function wait_for_container() {
CONTAINER_NAME="$1";
START_TEXT="$2";
- TIMEOUT=160
+ TIMEOUT=240
# wait for the real startup
AMOUNT_STARTUP=$(docker logs ${CONTAINER_NAME} 2>&1 | grep "$START_TEXT" | wc -l)
@@ -43,6 +41,7 @@ function wait_for_container() {
AMOUNT_STARTUP=$(docker logs ${CONTAINER_NAME} 2>&1 | grep "$START_TEXT" | wc -l)
if [ "$TIMEOUT" = "0" ];
then
+ docker logs ${CONTAINER_NAME};
echo "ERROR: $CONTAINER_NAME deployment failed."
exit 1
fi
@@ -54,6 +53,7 @@ function wait_for_container() {
DOCKER_COMPOSE_CMD="docker-compose";
export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1);
export DOCKER_REGISTRY="nexus3.onap.org:10001";
+export AAI_HAPROXY_IMAGE="${AAI_HAPROXY_IMAGE:-aaionap/haproxy}";
export HBASE_IMAGE="${HBASE_IMAGE:-harisekhon/hbase}";
docker pull ${DOCKER_REGISTRY}/openecomp/aai-resources:${DOCKER_IMAGE_VERSION};
@@ -74,9 +74,10 @@ wait_for_container ${HBASE_CONTAINER_NAME} ' Started SelectChannelConnector@0.0.
# Start the resources microservice
RESOURCES_CONTAINER_NAME=$(${DOCKER_COMPOSE_CMD} up -d aai-resources.api.simpledemo.openecomp.org 2>&1 | grep 'Creating' | grep -v 'volume' | grep -v 'network' | awk '{ print $2; }' | head -1);
wait_for_container ${RESOURCES_CONTAINER_NAME} '0.0.0.0:8447';
+docker logs ${CONTAINER_NAME};
# Start the traversal microservice
-GRAPH_CONTAINER_NAME=$($DOCKER_COMPOSE_CMD up -d aai-traversal.api.simpledemo.openecomp.org 2>&1 | grep 'Creating' | awk '{ print $2; }' | head -1);
+GRAPH_CONTAINER_NAME=$(${DOCKER_COMPOSE_CMD} up -d aai-traversal.api.simpledemo.openecomp.org 2>&1 | grep 'Creating' | awk '{ print $2; }' | head -1);
wait_for_container ${GRAPH_CONTAINER_NAME} '0.0.0.0:8446';
# Start the haproxy to route requests between resources and traversal
@@ -84,12 +85,11 @@ HAPROXY_CONTAINER_NAME=$(${DOCKER_COMPOSE_CMD} up -d aai.api.simpledemo.openecom
echo "A&AI Microservices, resources and traversal, are up and running along with HAProxy";
-docker exec -it $GRAPH_CONTAINER_NAME "/opt/app/aai-traversal/scripts/install/updateQueryData.sh" && {
+docker exec $GRAPH_CONTAINER_NAME "/opt/app/aai-traversal/scripts/install/updateQueryData.sh" && {
echo "Successfully loaded the widget related data into db";
} || {
echo "Unable to load widget related data into db";
}
-HAPROXY_IP=$(${SCRIPTS}/get-instance-ip.sh ${HAPROXY_CONTAINER_NAME});
# Set the host ip for robot from the haproxy
-ROBOT_VARIABLES="-v HOST_IP:${HAPROXY_IP}"
+ROBOT_VARIABLES="-v HOST_IP:`ip addr show docker0 | head -3 | tail -1 | cut -d' ' -f6 | cut -d'/' -f1`"
diff --git a/test/csit/plans/appc/healthcheck/db_query.sh b/test/csit/plans/appc/healthcheck/db_query.sh
new file mode 100755
index 000000000..87e0ac397
--- /dev/null
+++ b/test/csit/plans/appc/healthcheck/db_query.sh
@@ -0,0 +1,66 @@
+#!/usr/bin/env bash
+###############################################################################
+# Copyright 2017 Huawei Technologies Co., Ltd.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+###############################################################################
+SCRIPTS="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+echo $SCRIPTS
+
+sdnctl_num_tables=$(docker exec -i sdnc_db_container mysql -s -D sdnctl -u sdnctl -pgamma <<<'show tables;' 2>/dev/null | grep -v ERROR | wc -l)
+
+appcctl_num_tables=$(docker exec -i sdnc_db_container mysql -s -D appcctl -u appcctl -pappcctl <<<'show tables;' 2>/dev/null | grep -v ERROR | wc -l)
+
+
+
+docker exec -i sdnc_db_container mysql -s -D sdnctl -u sdnctl -pgamma <<<"show tables" 2>/dev/null | ( while read table_name; do
+export $table_name="$(docker exec -i sdnc_db_container mysql -s -D sdnctl -u sdnctl -pgamma <<<"select count(*) from $table_name" 2>/dev/null)"
+done
+
+if [ "$sdnctl_num_tables" -ge "1" ]; then
+ echo "There are $sdnctl_num_tables tables in the sdnctl database. "
+else
+ echo "Database sdnctl is not available."
+ exit 1;
+fi
+
+if [ "$appcctl_num_tables" -ge "1" ]; then
+ echo "There is $appcctl_num_tables table in the appcctl database. "
+else
+ echo "Database appcctl is not available."
+ exit 1;
+fi
+
+if [ "$NODE_TYPES" -eq "0" ]; then
+ echo "There is no data in table NODE_TYPES. "
+ exit 1;
+fi
+
+if [ "$SVC_LOGIC" -eq "0" ] ; then
+ echo "There is no data in table SVC_LOGIC. "
+ exit 1;
+fi
+
+if [ "$VNF_DG_MAPPING" -eq "0" ]; then
+ echo "There is no data in table VNF_DG_MAPPING. "
+ exit 1;
+fi
+
+echo "Expected table data is present."
+exit 0 )
+
+if [ "$?" -eq "1" ]; then
+ exit 1;
+fi
+
+exit 0
diff --git a/test/csit/plans/appc/healthcheck/setup.sh b/test/csit/plans/appc/healthcheck/setup.sh
index b91baa3a9..3c57cefac 100755
--- a/test/csit/plans/appc/healthcheck/setup.sh
+++ b/test/csit/plans/appc/healthcheck/setup.sh
@@ -22,6 +22,10 @@ source ${WORKSPACE}/test/csit/scripts/appc/script1.sh
export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1)
+if [ "$MTU" == "" ]; then
+ export MTU="1450"
+fi
+
# Clone APPC repo to get docker-compose for APPC
mkdir -p $WORKSPACE/archives/appc
@@ -42,7 +46,7 @@ docker pull nexus3.onap.org:10001/openecomp/dgbuilder-sdnc-image:1.1-STAGING-lat
docker tag nexus3.onap.org:10001/openecomp/dgbuilder-sdnc-image:1.1-STAGING-latest openecomp/dgbuilder-sdnc-image:latest
# start APPC containers with docker compose and configuration from docker-compose.yml
-/opt/docker/docker-compose up -d
+docker-compose up -d
# WAIT 5 minutes maximum and test every 5 seconds if APPC is up using HealthCheck API
TIME_OUT=500
diff --git a/test/csit/plans/vfc-nfvo-driver-vnfm-svnfm/sanity-check/setup.sh b/test/csit/plans/vfc-nfvo-driver-vnfm-svnfm/sanity-check/setup.sh
index de4fbd266..3f79bb024 100644
--- a/test/csit/plans/vfc-nfvo-driver-vnfm-svnfm/sanity-check/setup.sh
+++ b/test/csit/plans/vfc-nfvo-driver-vnfm-svnfm/sanity-check/setup.sh
@@ -70,5 +70,14 @@ echo "================================================"
docker cp vfc-ztevmanagerdriver:/service/vfc/nfvo/driver/vnfm/svnfm/zte/vmanager/docker/instance_run.sh ./
cat instance_run.sh
+# Start svnfm-huawei
+docker run -d --name vfc-svnfm-huawei -e MSB_ADDR=${MSB_IAG_IP}:80 nexus3.onap.org:10001/onap/vfc/nfvo/svnfm/huawei
+SERVICE_IP=`get-instance-ip.sh vfc-svnfm-huawei`
+for i in {1..10}; do
+ curl -sS ${SERVICE_IP}:8482 && break
+ echo sleep $i
+ sleep $i
+done
+
# Pass any variables required by Robot test suites in ROBOT_VARIABLES
-ROBOT_VARIABLES="-v MSB_IAG_IP:${MSB_IAG_IP} -v MSB_DISCOVERY_IP:${MSB_DISCOVERY_IP} -v ZTEVMANAGERDRIVER_IP:${ZTEVMANAGERDRIVER_IP}"
+ROBOT_VARIABLES="-v MSB_IAG_IP:${MSB_IAG_IP} -v MSB_DISCOVERY_IP:${MSB_DISCOVERY_IP} -v ZTEVMANAGERDRIVER_IP:${ZTEVMANAGERDRIVER_IP} -v MSB_IP:${MSB_IAG_IP} -v SERVICE_IP:${SERVICE_IP}"
diff --git a/test/csit/plans/vfc-nfvo-driver-vnfm-svnfm/sanity-check/teardown.sh b/test/csit/plans/vfc-nfvo-driver-vnfm-svnfm/sanity-check/teardown.sh
index 1020cf1af..e440068fb 100644
--- a/test/csit/plans/vfc-nfvo-driver-vnfm-svnfm/sanity-check/teardown.sh
+++ b/test/csit/plans/vfc-nfvo-driver-vnfm-svnfm/sanity-check/teardown.sh
@@ -21,4 +21,4 @@ kill-instance.sh msb_discovery
kill-instance.sh msb_consul
kill-instance.sh vfc-ztevmanagerdriver
-# kill-instance.sh vfc-svnfm-huawei
+kill-instance.sh vfc-svnfm-huawei
diff --git a/test/csit/plans/vfc-nfvo-driver-vnfm-svnfm/sanity-check/testplan.txt b/test/csit/plans/vfc-nfvo-driver-vnfm-svnfm/sanity-check/testplan.txt
index e5691f4b8..7eb861eda 100644
--- a/test/csit/plans/vfc-nfvo-driver-vnfm-svnfm/sanity-check/testplan.txt
+++ b/test/csit/plans/vfc-nfvo-driver-vnfm-svnfm/sanity-check/testplan.txt
@@ -3,4 +3,4 @@
vfc/nfvo-driver-svnfm/ztevmanager.robot
-# vfc/nfvo-driver-svnfm/huawei.robot
+vfc/nfvo-driver-svnfm/huawei.robot
diff --git a/test/csit/tests/aai/resources/suite1/pserver.robot b/test/csit/tests/aai/resources/suite1/pserver.robot
index 5a1d9d3ba..55e57bccb 100644
--- a/test/csit/tests/aai/resources/suite1/pserver.robot
+++ b/test/csit/tests/aai/resources/suite1/pserver.robot
@@ -5,62 +5,61 @@ Library requests
Library Collections
*** Variables ***
-${TARGETURL} https://${HOST_IP}:8443/v11/cloud-infrastructure/pservers/pserver/pserver-test1
+${TARGETURL} https://${HOST_IP}:8443/aai/v11/cloud-infrastructure/pservers/pserver/pserver-test1
${PSERVERDATA} {"hostname": "pserver-test1"}
*** Test Cases ***
Run AAI Put Pserver
- [Documentation] Create an index and verify success
+ [Documentation] Create an pserver object
${resp}= PutWithCert ${TARGETURL} ${PSERVERDATA}
+ log ${TARGETURL}
+ log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 201
Run AAI Get Pserver
- [Documentation] Get the document that was just created
+ [Documentation] Get the pserver object just created
${resp} GetWithCert ${TARGETURL}
- ${content}= Evaluate $resp.json()
+ log ${resp}
+ log ${resp.json()}
Should Be Equal As Strings ${resp.status_code} 200
- ${resource_version}= Evaluate $resp.json()['resource-version']
+ ${resource_version}= Evaluate $resp.json().get('resource-version')
+ Set Global Variable ${resource_version}
Run AAI Delete Pserver
- [Documentation] Delete the index
+ [Documentation] Delete the pserver just created
${resp}= DeleteWithCert ${TARGETURL}?resource-version=${resource_version}
+ log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 204
*** Keywords ***
PutWithCert
[Arguments] ${url} ${data}
- ${auth}= Create List AAI AAI
- ${uuid}= Generate UUID
- ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${uuid} X-FromAppId=integration-aai
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=integration-aai X-FromAppId=integration-aai Authorization=Basic QUFJOkFBSQ==
${certinfo}= Evaluate ('${CURDIR}/aai.crt', '${CURDIR}/aai.key')
- ${resp}= Evaluate requests.put('${url}', data='${data}', auth=${auth}, headers=${headers}, cert=${certinfo}, verify=False) requests
+ ${resp}= Evaluate requests.put('${url}', data='${data}', headers=${headers}, cert=${certinfo}, verify=False) requests
[return] ${resp}
PostWithCert
[Arguments] ${url} ${data}
${auth}= Create List AAI AAI
- ${uuid}= Generate UUID
- ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${uuid} X-FromAppId=integration-aai
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=integration-aai X-FromAppId=integration-aai Authorization=Basic QUFJOkFBSQ==
${certinfo}= Evaluate ('${CURDIR}/aai.crt', '${CURDIR}/aai.key')
- ${resp}= Evaluate requests.post('${url}', data='${data}', auth=${auth}, headers=${headers}, cert=${certinfo}, verify=False) requests
+ ${resp}= Evaluate requests.post('${url}', data='${data}', headers=${headers}, cert=${certinfo}, verify=False) requests
[return] ${resp}
GetWithCert
[Arguments] ${url}
- ${auth}= Create List AAI AAI
- ${uuid}= Generate UUID
- ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${uuid} X-FromAppId=integration-aai
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=integration-aai X-FromAppId=integration-aai Authorization=Basic QUFJOkFBSQ==
${certinfo}= Evaluate ('${CURDIR}/aai.crt', '${CURDIR}/aai.key')
- ${resp}= Evaluate requests.get('${url}', auth=${auth}, headers=${headers}, cert=${certinfo}, verify=False) requests
+ ${resp}= Evaluate requests.get('${url}', headers=${headers}, cert=${certinfo}, verify=False) requests
[return] ${resp}
DeleteWithCert
[Arguments] ${url}
${auth}= Create List AAI AAI
- ${uuid}= Generate UUID
- ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${uuid} X-FromAppId=integration-aai
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=integration-aai X-FromAppId=integration-aai Authorization=Basic QUFJOkFBSQ==
${certinfo}= Evaluate ('${CURDIR}/aai.crt', '${CURDIR}/aai.key')
- ${resp}= Evaluate requests.delete('${url}', auth=${auth}, headers=${headers}, cert=${certinfo}, verify=False) requests
+ ${resp}= Evaluate requests.delete('${url}', headers=${headers}, cert=${certinfo}, verify=False) requests
[return] ${resp}
diff --git a/test/csit/tests/appc/healthcheck/test1.robot b/test/csit/tests/appc/healthcheck/test1.robot
index 05eee5b84..8bd49860b 100644
--- a/test/csit/tests/appc/healthcheck/test1.robot
+++ b/test/csit/tests/appc/healthcheck/test1.robot
@@ -6,6 +6,7 @@ Library Process
${bundle_query} ${SCRIPTS}/bundle_query.sh
${health_check} ${SCRIPTS}/health_check.sh
+${db_query} ${SCRIPTS}/db_query.sh
*** Test Cases ***
@@ -19,4 +20,8 @@ Query bundle test case for APPC
${result_bq}= Run Process bash ${bundle_query} > log_bq.txt shell=yes
Should Be Equal As Integers ${result_bq.rc} 0
+Query database test case for APPC
+ [Documentation] Query database
+ ${result_db}= Run Process bash ${db_query} > log_db.txt shell=yes
+ Should Be Equal As Integers ${result_db.rc} 0
diff --git a/test/csit/tests/cli/startup/startup_check.robot b/test/csit/tests/cli/startup/startup_check.robot
index a10467078..053a6d115 100644
--- a/test/csit/tests/cli/startup/startup_check.robot
+++ b/test/csit/tests/cli/startup/startup_check.robot
@@ -20,7 +20,7 @@ Check Cli help
${cli_cmd_output}= Run Process ${cli_exec} --help shell=yes
Log ${cli_cmd_output.stdout}
Should Be Equal As Strings ${cli_cmd_output.rc} 0
- Should Contain ${cli_cmd_output.stdout} ONAP Command-line interface
+ Should Contain ${cli_cmd_output.stdout} CLI version
Check Cli Version Default
[Documentation] check cli default version