From 1f080ab55640d6cd754b83822cdd9793a68976e2 Mon Sep 17 00:00:00 2001 From: Rahul Yadav Date: Fri, 29 Mar 2019 16:34:32 +0000 Subject: [PATCH] CSIT for SDNC Netconf Configuration This commit have 2 csits for sdnc 1. Checking keystore after SDNC installation 2. Checking PNF mount after SDNC installation Change-Id: I69782b3bc426dac02c691392ae679aeedcf81ee3 Signed-off-by: Rahul Yadav Issue-ID: SDNC-660 --- .../certs/certs.properties | 2 + .../sdnc_netconf_tls_post_deploy/certs/keys0.zip | Bin 0 -> 5057 bytes plans/sdnc/sdnc_netconf_tls_post_deploy/setup.sh | 156 +++++++++++++++++++++ .../sdnc/sdnc_netconf_tls_post_deploy/teardown.sh | 32 +++++ .../sdnc/sdnc_netconf_tls_post_deploy/testplan.txt | 4 + .../sdnc/sdnc_netconf_tls_post_deploy/_init_.robot | 2 + .../sdnc_netconf_tls_post_deploy/data/mount.xml | 14 ++ .../sdnc_post_deploy_cert_check.robot | 39 ++++++ 8 files changed, 249 insertions(+) create mode 100644 plans/sdnc/sdnc_netconf_tls_post_deploy/certs/certs.properties create mode 100644 plans/sdnc/sdnc_netconf_tls_post_deploy/certs/keys0.zip create mode 100644 plans/sdnc/sdnc_netconf_tls_post_deploy/setup.sh create mode 100644 plans/sdnc/sdnc_netconf_tls_post_deploy/teardown.sh create mode 100644 plans/sdnc/sdnc_netconf_tls_post_deploy/testplan.txt create mode 100644 tests/sdnc/sdnc_netconf_tls_post_deploy/_init_.robot create mode 100644 tests/sdnc/sdnc_netconf_tls_post_deploy/data/mount.xml create mode 100644 tests/sdnc/sdnc_netconf_tls_post_deploy/sdnc_post_deploy_cert_check.robot diff --git a/plans/sdnc/sdnc_netconf_tls_post_deploy/certs/certs.properties b/plans/sdnc/sdnc_netconf_tls_post_deploy/certs/certs.properties new file mode 100644 index 00000000..f8f3fa72 --- /dev/null +++ b/plans/sdnc/sdnc_netconf_tls_post_deploy/certs/certs.properties @@ -0,0 +1,2 @@ +keys0.zip +***** diff --git a/plans/sdnc/sdnc_netconf_tls_post_deploy/certs/keys0.zip b/plans/sdnc/sdnc_netconf_tls_post_deploy/certs/keys0.zip new file mode 100644 index 0000000000000000000000000000000000000000..48b4d90a10272ae8bd87645bf7dc7058fa298327 GIT binary patch literal 5057 zcmbW5cQl+^+r~%lf(Q~}j268_bOzBoqxTR)5TchvC;I3m7^3%Rqa=Eb=tLQUA$o7o z>zkbS&H2u^)_K==)_3pq?7g3VervD&$F;Bf(on|0BnSMeP2ZPle{B9UVFTy@c2F-D z9&R0NA^^^d$xvgPpWm<5&65CthPjRb0Q@m&{K3El-~wK1g{b~!)L;PsB!4oVzqElm zxN<#rcKw4Eb&mT7>2GLIZRN3QF|xTI>{hRunJ9tB2Huguj8sovkaR#FWzl72v7q^0 zi=`CT7g$v*W$d~R6@%yeZoFy2I5)5QyUOM9_ya;)+a>UG$v3V7b{L>IT1q&qecBlawl7e{hOTK+i8 z0dud!pd>TTosI6SuLZp-GsiD`xL695p&Ouj;aidpp%38iGG^wDiCuUI8kw|?Y=YPo zvAWZVLKLMe*=LvwWZ#SU>&21}&F3jRqN@V;vrwgVIcj55f(|P`Yl!e-66zLoWAm1m1}uIMt?WCU$5GH~22El&^yZj))>&S51i`LA1$ zVx_5Y9K07hmCrfUW5|z9zMTQ90H)IYE80C~2kOl{2vODv?;p}W8G^CQtT@U*fh)~Vtj=hX-6!9q0=fMQL^A|6<31$3|_qknnzwk zdD60&72h_CiV8Gh81u?T(>4rhES zN}N4z&(f(_U%!G=l5RO_bQ**G0dRiZ?8n!s1t1dO`J8b|HkG&>e zB2aPO4b^QF-P?VeNlWS&pwVV~860%4cF@paIpwZNZ7@$t9-427EF9eTaR%4my*ise zfwlVwnv%8o^4iulg>xFlrl5yeVm%~NIOZQs6=qZTcCWh;Vl|`p(eV{Z-_zyl(*vp|z6os&lO8~Ik3kJ(rMeDVv->b3D0OGuQ-gg=0%mWely#E^dFh@MzU3qx1t+uHN@d~_c@?QNi8-4F8o*6Fs_VwAaOH4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fL@&We>s*xBh(4Y>LykZ9D^w5c7{c|8%%Hj`ajdkdS$B#Q_sSjVPZ#3wY}#Q# z<<&fF4<<*bk94LWx9Gjazei%B<)p7;!vZ_dG+fj$>&X__;D2!=iAyum+ca^FEOj-Rf(FbXz3YuE;3u)U&R(qPbRU#T!CwSQku@nbzMmP}vFzPN4W7ulR%zX< zfbgq+)sm(j@8#)1E?bw5hIPu!&&hMM>_LlzJ_A$ilwTHVbDga_2r+(r`~qHNI4htFTXdqPc3^v| zi%h8`RrB&LO8bO)#{pR0eoOj`Jqt`*K&6WIIb*4ORtbBa;)v6bQa9~meoqM4&YWlk zSwn=n<=^E`W;!e9O@O0rh3wvjH{U`V+m6@2OF{#<5z0?sua7DHX0~llgl{_R70=xlEI;VX3JlPL?~-Ytdfa+ite~i zwYKOs8_9xC{J63}R+Ki`Sd1;ad3v`{D^+z>)!QU^>b09)&Rq9Os=;t=Wp4yLpYXL$ z(1C%i*;jIu?L{5+US9p0bs@B4eV4fL#U!THR@7R__to);(a-Z+N-rgmyrx|Fh&wlv zVb3A19p$5$6oG4B`V`5z_p;}UFA9*ZJ^JEq*GwpsP3h1c#vS#VzQYTsOJQI{G;Kw? zPmz1L_Droty)wgsFR!kt@oUlJqh&1i!ViojN)HV4^-VZK=2OG@H<78iWwAzBUyq|- z`2z`^p*u#@G~7WH+Bv1C6dRHD(t>^g2NLvY7k7R=`>2lOsVE!(;Me1>p^S!3j`80U zqu=Szj?}N+Kh2N+&HSAp{k5a}l_34Dya1U$ng2Xb`hDWx^uL;z|4kqI*+u^Q#Q&lH wgC6m(^j}8kuXpv!2>q^_0Ac*!^#7+V(on|w>AQYrZa>ExGys5y?APDF08pGkhyVZp literal 0 HcmV?d00001 diff --git a/plans/sdnc/sdnc_netconf_tls_post_deploy/setup.sh b/plans/sdnc/sdnc_netconf_tls_post_deploy/setup.sh new file mode 100644 index 00000000..92470d29 --- /dev/null +++ b/plans/sdnc/sdnc_netconf_tls_post_deploy/setup.sh @@ -0,0 +1,156 @@ +#!/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 +# +# Place the scripts in run order: +SCRIPTS="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +source ${WORKSPACE}/scripts/sdnc/script1.sh +export DOCKER_SDNC_REPO=darby321 +export DOCKER_SDNC_TAG=testimage1 +export DOCKER_USERNAME=darby321 +export DOCKER_PASSWORD=Darragh1993 +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.5-STAGING-latest +export CCSDK_DOCKER_IMAGE_VERSION=0.4-STAGING-latest + +export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1) + +if [ "$MTU" == "" ]; then + export MTU="1450" +fi + +# Clone SDNC repo to get docker-compose for SDNC +mkdir -p $WORKSPACE/archives/integration +cd $WORKSPACE/archives +git clone -b master --single-branch --depth=1 http://gerrit.onap.org/r/integration.git integration +cd $WORKSPACE/archives/integration +git pull +HOST_IP_ADDR=localhost +# Clone SDNC repo to get docker-compose for SDNC +mkdir -p $WORKSPACE/archives/sdnc +cd $WORKSPACE/archives +git clone -b master --single-branch --depth=1 http://gerrit.onap.org/r/sdnc/oam.git sdnc +cd $WORKSPACE/archives/sdnc +git pull +unset http_proxy https_proxy +cd $WORKSPACE/archives/sdnc/installation/src/main/yaml + +docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD $DOCKER_SDNC_REPO +docker pull $DOCKER_SDNC_REPO/sdnc-image:$DOCKER_SDNC_TAG +docker tag $DOCKER_SDNC_REPO/sdnc-image:$DOCKER_SDNC_TAG onap/sdnc-image:latest +docker logout $DOCKER_SDNC_REPO + +sed -i "s/DMAAP_TOPIC_ENV=.*/DMAAP_TOPIC_ENV="AUTO"/g" docker-compose.yml +docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO + +#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 $NEXUS_DOCKER_REPO/onap/sdnc-ansible-server-image:$DOCKER_IMAGE_VERSION +docker tag $NEXUS_DOCKER_REPO/onap/sdnc-ansible-server-image:$DOCKER_IMAGE_VERSION onap/sdnc-ansible-server-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 $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 + +docker pull $NEXUS_DOCKER_REPO/onap/sdnc-dmaap-listener-image:$DOCKER_IMAGE_VERSION + +docker tag $NEXUS_DOCKER_REPO/onap/sdnc-dmaap-listener-image:$DOCKER_IMAGE_VERSION onap/sdnc-dmaap-listener-image:latest + +CERT_SUBPATH=plans/sdnc/sdnc_netconf_tls_post_deploy/certs +export SDNC_CERT_PATH=${WORKSPACE}/${CERT_SUBPATH} +sed -i 's/sdnc_controller_container/sdnc_controller_container\n volumes: \n - $SDNC_CERT_PATH:\/opt\/opendaylight\/current\/certs/' docker-compose.yml +# start SDNC containers with docker compose and configuration from docker-compose.yml +docker-compose up -d + +cd $WORKSPACE/archives/integration/test/mocks/pnfsimulator +./simulator.sh start& + +# 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 + + if [ "$response" == "200" ]; then + echo SDNC started in $TIME seconds + break; + fi + + 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 + +export PNF_IP=$(ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+') +sed -i "s/pnfaddr/$PNF_IP/g" $WORKSPACE/tests/sdnc/sdnc_netconf_tls_post_deploy/data/mount.xml + +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 +docker exec sdnc_controller_container rm -f /opt/opendaylight/current/etc/host.key +response=$(docker exec sdnc_controller_container /opt/opendaylight/current/bin/client system:start-level) +docker exec sdnc_controller_container rm -f /opt/opendaylight/current/etc/host.key + + if [ "$response" == "Level 100" ] ; then + echo SDNC karaf started in $TIME seconds + break; + fi + + 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: karaf session not started in $TIME_OUT seconds... Could cause problems for testing activities... +fi + +response=$(docker exec sdnc_controller_container /opt/opendaylight/current/bin/client system:start-level) + + if [ "$response" == "Level 100" ] ; 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 + +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 200 + +# Pass any variables required by Robot test suites in ROBOT_VARIABLES +ROBOT_VARIABLES="-v SCRIPTS:${SCRIPTS}" \ No newline at end of file diff --git a/plans/sdnc/sdnc_netconf_tls_post_deploy/teardown.sh b/plans/sdnc/sdnc_netconf_tls_post_deploy/teardown.sh new file mode 100644 index 00000000..97696ace --- /dev/null +++ b/plans/sdnc/sdnc_netconf_tls_post_deploy/teardown.sh @@ -0,0 +1,32 @@ +#!/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 sdnc_controller_container +kill-instance.sh sdnc_dgbuilder_container +kill-instance.sh sdnc_portal_container +kill-instance.sh sdnc_db_container +kill-instance.sh sdnc_ueblistener_container +kill-instance.sh sdnc_dmaaplistener_container +kill-instance.sh sdnc_ansible_container +kill-instance.sh netopeer +kill-instance.sh sftp-server +kill-instance.sh ftpes-server-vsftpd +kill-instance.sh ftpes-server-pure-ftpd + +# $WORKSPACE/archives/appc deleted with archives folder when tests starts so we keep it at the end for debugging diff --git a/plans/sdnc/sdnc_netconf_tls_post_deploy/testplan.txt b/plans/sdnc/sdnc_netconf_tls_post_deploy/testplan.txt new file mode 100644 index 00000000..a0bffe5c --- /dev/null +++ b/plans/sdnc/sdnc_netconf_tls_post_deploy/testplan.txt @@ -0,0 +1,4 @@ +# Test suites are relative paths under [integration/csit.git]/tests/. +# Place the suites in run order. +sdnc/sdnc_netconf_tls_post_deploy + diff --git a/tests/sdnc/sdnc_netconf_tls_post_deploy/_init_.robot b/tests/sdnc/sdnc_netconf_tls_post_deploy/_init_.robot new file mode 100644 index 00000000..d7353060 --- /dev/null +++ b/tests/sdnc/sdnc_netconf_tls_post_deploy/_init_.robot @@ -0,0 +1,2 @@ +1 *** Settings *** +2 Documentation SDNC - keystorecheck diff --git a/tests/sdnc/sdnc_netconf_tls_post_deploy/data/mount.xml b/tests/sdnc/sdnc_netconf_tls_post_deploy/data/mount.xml new file mode 100644 index 00000000..108369bc --- /dev/null +++ b/tests/sdnc/sdnc_netconf_tls_post_deploy/data/mount.xml @@ -0,0 +1,14 @@ + + netopeer2 + + ODL_private_key_0 + netconf + + pnfaddr + 6513 + false + + TLS + + 2 + diff --git a/tests/sdnc/sdnc_netconf_tls_post_deploy/sdnc_post_deploy_cert_check.robot b/tests/sdnc/sdnc_netconf_tls_post_deploy/sdnc_post_deploy_cert_check.robot new file mode 100644 index 00000000..f1814144 --- /dev/null +++ b/tests/sdnc/sdnc_netconf_tls_post_deploy/sdnc_post_deploy_cert_check.robot @@ -0,0 +1,39 @@ +*** Settings *** +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json +Library String + +*** Variables *** +${SDNC_KEYSTORE_CONFIG_PATH} /config/netconf-keystore:keystore +${SDNC_MOUNT_PATH} /config/network-topology:network-topology/topology/topology-netconf/node/netopeer2 +${PNFSIM_MOUNT_PATH} /config/network-topology:network-topology/topology/topology-netconf/node/netopeer2/yang-ext:mount/mynetconf:netconflist + + *** Test Cases *** + Test SDNC Keystore + [Documentation] Checking keystore after SDNC installation + Create Session sdnc http://localhost:8282/restconf + &{headers}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/json Accept=application/json + ${resp}= Get Request sdnc ${SDNC_KEYSTORE_CONFIG_PATH} headers=${headers} + Should Be Equal As Strings ${resp.status_code} 200 + ${keystoreContent}= Convert To String ${resp.content} + Log to console ************************* + Log to console ${resp.content} + Log to console ************************* + + Test SDNC PNF Mount + [Documentation] Checking PNF mount after SDNC installation + Create Session sdnc http://localhost:8282/restconf + ${mount}= Get File ${CURDIR}${/}data${/}mount.xml + Log to console ${mount} + &{headers}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/xml Accept=application/xml + ${resp}= Put Request sdnc ${SDNC_MOUNT_PATH} data=${mount} headers=${headers} + Should Be Equal As Strings ${resp.status_code} 201 + Sleep 30 + &{headers1}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/json Accept=application/json + ${resp1}= Get Request sdnc ${PNFSIM_MOUNT_PATH} headers=${headers1} + Should Be Equal As Strings ${resp1.status_code} 200 + Log to console ${resp1.content} + Should Contain ${resp1.content} netconf-id + Should Contain ${resp1.content} netconf-param \ No newline at end of file -- 2.16.6