aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLasse Kaihlavirta <l.kaihlavirt@partner.samsung.com>2020-11-25 16:30:48 +0200
committerLasse Kaihlavirta <l.kaihlavirt@partner.samsung.com>2020-12-01 11:03:35 +0200
commit6a19ed180fc5492449aa31802b5739e68390d954 (patch)
tree2f22934720bcaa2c8a79ef38089fb29223d6d9cd
parenta94201cdbbe0c1ceb2fa0e676a61627e4bc7b657 (diff)
Align SDNC healthcheck CSIT to master
- update the tested docker image versions - remove test cases referring to obsoleted VNF-API - remove references to obsoleted admportal image - reduce timeouts significantly - improve readiness checks - fail the suite on any setup failures Issue-ID: CCSDK-2915 Signed-off-by: Lasse Kaihlavirta <l.kaihlavirt@partner.samsung.com> Change-Id: I8ff49054d5895bf19eb35729e5c1db7919c22f81
-rwxr-xr-xplans/sdnc/healthcheck/setup.sh60
-rw-r--r--tests/sdnc/healthcheck/test1.robot17
2 files changed, 16 insertions, 61 deletions
diff --git a/plans/sdnc/healthcheck/setup.sh b/plans/sdnc/healthcheck/setup.sh
index a11a3aa5..99753dfb 100755
--- a/plans/sdnc/healthcheck/setup.sh
+++ b/plans/sdnc/healthcheck/setup.sh
@@ -15,17 +15,16 @@
# limitations under the License.
#
# Modifications copyright (c) 2017 AT&T Intellectual Property
+# Modifications copyright (c) 2020 Samsung Electronics Co., Ltd.
#
# Place the scripts in run order:
-SCRIPTS="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-source ${WORKSPACE}/scripts/sdnc/script1.sh
-
+set -x
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.8-STAGING-latest
-export CCSDK_DOCKER_IMAGE_VERSION=0.7-STAGING-latest
+export DOCKER_IMAGE_VERSION=2.1-STAGING-latest
+export CCSDK_DOCKER_IMAGE_VERSION=1.1-STAGING-latest
export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1)
@@ -55,9 +54,6 @@ docker tag $NEXUS_DOCKER_REPO/onap/sdnc-ansible-server-image:$DOCKER_IMAGE_VERSI
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 $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
-
docker pull $NEXUS_DOCKER_REPO/onap/sdnc-ueb-listener-image:$DOCKER_IMAGE_VERSION
docker tag $NEXUS_DOCKER_REPO/onap/sdnc-ueb-listener-image:$DOCKER_IMAGE_VERSION onap/sdnc-ueb-listener-image:latest
@@ -69,36 +65,17 @@ docker tag $NEXUS_DOCKER_REPO/onap/sdnc-dmaap-listener-image:$DOCKER_IMAGE_VERSI
# start SDNC containers with docker compose and configuration from docker-compose.yml
docker-compose up -d
-# WAIT 10 minutes maximum and test every 5 seconds if SDNC is up using HealthCheck API
-TIME_OUT=1000
-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-sdnc" -H "X-TransactionId: csit-sdnc" -H "Accept: application/json" -H "Content-Type: application/json" http://localhost:8282/restconf/operations/SLI-API:healthcheck ); echo $response
+# WAIT 5 minutes maximum and check karaf.log for readiness every 10 seconds
- if [ "$response" == "200" ]; then
- echo SDNC started in $TIME seconds
- break;
- fi
+TIME_OUT=300
+INTERVAL=10
- echo Sleep: $INTERVAL seconds before testing if SDNC 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=1500
-INTERVAL=60
TIME=0
while [ "$TIME" -lt "$TIME_OUT" ]; do
- response=$(docker exec -ti sdnc_controller_container /opt/opendaylight/current/bin/client system:start-level)
- if grep -q 'Level 100' <<< ${response}; then
+docker exec sdnc_controller_container cat /opt/opendaylight/data/log/karaf.log | grep 'warp coils'
+
+ if [ $? == 0 ] ; then
echo SDNC karaf started in $TIME seconds
break;
fi
@@ -109,24 +86,19 @@ while [ "$TIME" -lt "$TIME_OUT" ]; do
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: karaf session not started in $TIME_OUT seconds, setup failed
+ exit 1;
fi
-response=$(docker exec -ti sdnc_controller_container /opt/opendaylight/current/bin/client system:start-level)
-
-if grep -q 'Level 100' <<< ${response} ; then
- num_failed_bundles=$(docker exec sdnc_controller_container /opt/opendaylight/current/bin/client bundle:list | grep Failure | wc -l)
- failed_bundles=$(docker exec sdnc_controller_container /opt/opendaylight/current/bin/client bundle:list | grep Failure)
- echo There is/are $num_failed_bundles failed bundles out of $num_bundles installed bundles.
- fi
+num_bundles=$(docker exec -i sdnc_controller_container /opt/opendaylight/current/bin/client bundle:list | tail -1 | cut -d' ' -f1)
+num_failed_bundles=$(docker exec -i sdnc_controller_container /opt/opendaylight/current/bin/client bundle:list | grep Failure | wc -l)
+failed_bundles=$(docker exec -i sdnc_controller_container /opt/opendaylight/current/bin/client bundle:list | grep Failure)
+echo There is/are $num_failed_bundles failed bundles out of $num_bundles installed bundles.
if [ "$num_failed_bundles" -ge 1 ]; then
echo "The following bundle(s) are in a failed state: "
echo " $failed_bundles"
fi
-# Sleep additional 5 minutes (300 secs) to give application time to finish
-sleep 300
-
# Pass any variables required by Robot test suites in ROBOT_VARIABLES
ROBOT_VARIABLES="-v SCRIPTS:${SCRIPTS}"
diff --git a/tests/sdnc/healthcheck/test1.robot b/tests/sdnc/healthcheck/test1.robot
index c002a189..3648a8e4 100644
--- a/tests/sdnc/healthcheck/test1.robot
+++ b/tests/sdnc/healthcheck/test1.robot
@@ -8,7 +8,6 @@ Library String
*** Variables ***
${SDN_APIDOCS_URI} /apidoc/apis
${SDN_HEALTHCHECK_OPERATION_PATH} /operations/SLI-API:healthcheck
-${PRELOAD_VNF_TOPOLOGY_OPERATION_PATH} /operations/VNF-API:preload-vnf-topology-operation
*** Test Cases ***
@@ -26,19 +25,3 @@ Check SLI-API
${resp}= Get Request sdnc ${SDN_APIDOCS_URI} headers=${headers}
Log ${resp.text}
Should Contain ${resp.text} SLI-API
-
-Check VNF-API
- Create Session sdnc http://localhost:8282
- &{headers}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/json Accept=application/json
- ${resp}= Get Request sdnc ${SDN_APIDOCS_URI} headers=${headers}
- Log ${resp.text}
- Should Contain ${resp.text} VNF-API
-
-Test Preload
- Create Session sdnc http://localhost:8282/restconf
- ${data}= Get File ${CURDIR}${/}data${/}preload.json
- &{headers}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/json Accept=application/json
- ${resp}= Post Request sdnc ${PRELOAD_VNF_TOPOLOGY_OPERATION_PATH} data=${data} headers=${headers}
- Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 200
- Should Be Equal As Strings ${resp.json()['output']['response-code']} 200