[CSIT] fix /operations/GENERIC-RESOURCE-API path for RFC8040 conformance 30/134730/11
authordemskeq8 <alexander.dehn@highstreet-technologies.com>
Wed, 31 May 2023 12:26:25 +0000 (14:26 +0200)
committerdemskeq8 <alexander.dehn@highstreet-technologies.com>
Thu, 1 Jun 2023 14:18:18 +0000 (16:18 +0200)
remove tailing '/'

enable csit tests for GENERIC-RESOURCE-API

Issue-ID: SDNC-1812
Signed-off-by: demskeq8 <alexander.dehn@highstreet-technologies.com>
Change-Id: Ie6a82d18973b6e58fa20c1284640baed69eb577e

Former-commit-id: dcfccebc367687ba878674287a89c0b7834594af

csit/plans/sdnc/setup.sh
csit/prepare-csit.sh
csit/run-csit.sh
csit/sdnc-csit-robot.env [new file with mode: 0755]
csit/sdnc-csit.env
csit/tests/sdnc/resources/sdnc-keywords.robot
csit/tests/sdnc/resources/sdnc-properties.robot
csit/tests/sdnc/sdnc_csit.robot

index 9178358..3212f98 100644 (file)
@@ -39,8 +39,10 @@ mkdir ${WORKSPACE}/archives/pnf-simulator
 git clone "https://gerrit.onap.org/r/integration/simulators/pnf-simulator" ${WORKSPACE}/archives/pnf-simulator
 
 # Fix docker-compose to add nexus repo for onap dockers
+PNF_SIM_REGISTRY=nexus3.onap.org:10001
+PNF_SIM_VERSION=1.0.5
 mv ${WORKSPACE}/archives/pnf-simulator/netconfsimulator/docker-compose.yml ${WORKSPACE}/archives/pnf-simulator/netconfsimulator/docker-compose.yml.orig
-cat ${WORKSPACE}/archives/pnf-simulator/netconfsimulator/docker-compose.yml.orig | sed -e "s/image: onap/image: nexus3.onap.org:10001\/onap/" > ${WORKSPACE}/archives/pnf-simulator/netconfsimulator/docker-compose.yml
+cat ${WORKSPACE}/archives/pnf-simulator/netconfsimulator/docker-compose.yml.orig | sed -re "s/image: onap\/org.onap.integration.simulators.(.*$)/image: $PNF_SIM_REGISTRY\/onap\/org.onap.integration.simulators.\1:$PNF_SIM_VERSION/"  > ${WORKSPACE}/archives/pnf-simulator/netconfsimulator/docker-compose.yml
 
 # Remove carriage returns (if any) from netopeer start script
 mv ${WORKSPACE}/archives/pnf-simulator/netconfsimulator/netconf/initialize_netopeer.sh ${WORKSPACE}/archives/pnf-simulator/netconfsimulator/netconf/initialize_netopeer.sh.orig
index dc59c58..550a023 100755 (executable)
@@ -43,7 +43,7 @@ fi
 # install eteutils
 mkdir -p ${ROBOT_VENV}/src/onap
 rm -rf ${ROBOT_VENV}/src/onap/testsuite
-pip install --upgrade --extra-index-url="https://nexus3.onap.org/repository/PyPi.staging/simple" 'robotframework-onap==0.5.1.*' --pre
+#pip install --upgrade --extra-index-url="https://nexus3.onap.org/repository/PyPi.staging/simple" 'robotframework-onap==0.5.1.*' --pre
 
 pip freeze
 
index 31b8e29..ba3fb9a 100755 (executable)
@@ -157,10 +157,8 @@ source_safely "${WORKSPACE}/sdnc-csit.env"
 if [[ -z $ROBOT_IMAGE ]]; then
   # Run installation of prerequired libraries
   source_safely "${WORKSPACE}/prepare-csit.sh"
-
-
-# Activate the virtualenv containing all the required libraries installed by prepare-csit.sh
-source_safely "${ROBOT_VENV}/bin/activate"
+  # Activate the virtualenv containing all the required libraries installed by prepare-csit.sh
+  source_safely "${ROBOT_VENV}/bin/activate"
 fi
 
 WORKDIR=$(mktemp -d --suffix=-robot-workdir)
@@ -211,6 +209,7 @@ if [[ -z $SDNC_RELEASE_WITHOUT_ROBOT ]] ; then
         else
             echo "*** TRACE **** python is running in a container"
             docker run --rm --net="host" \
+            --env-file ${WORKSPACE}/sdnc-csit-robot.env \
             -v ${WORKSPACE}:${WORKSPACE} -v ${WORKDIR}:${WORKDIR} $ROBOT_IMAGE  \
             python3 -B -m robot.run -N ${TESTPLAN} -v WORKSPACE:/tmp --outputdir ${WORKDIR} ${ROBOT_VARIABLES} ${TESTOPTIONS} ${SUITES}
         fi
diff --git a/csit/sdnc-csit-robot.env b/csit/sdnc-csit-robot.env
new file mode 100755 (executable)
index 0000000..32ea055
--- /dev/null
@@ -0,0 +1,5 @@
+WORKSPACE
+ODL_PASSWORD
+ODL_USER
+REQUEST_DATA_PATH
+SDNC_CONTAINER_NAME
index 5f3509d..cd271f2 100755 (executable)
@@ -32,3 +32,6 @@ export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort
 if [ "$MTU" == "" ]; then
          export MTU="1450"
 fi
+# Define ROBOT_IMAGE to run robot testcases within this container
+# skips all robotframework related local python installation
+export ROBOT_IMAGE=${ROBOT_IMAGE:-nexus3.onap.org:10001/onap/testsuite:1.12.1}
index 76d1140..8c417bc 100644 (file)
@@ -5,7 +5,7 @@ Resource          ./sdnc-properties.robot
 Library           Collections
 Library           RequestsLibrary
 Library           OperatingSystem
-Library           HttpLibrary.HTTP
+Library           HttpLibrary.HTTP
 
 
 *** Keywords ***
@@ -21,9 +21,7 @@ Send Post File And Validate Response
     Create SDNC RESTCONF Session
     ${body}=      Get File     ${path}
     &{headers}=  Create Dictionary    Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==    Content-Type=application/json    Accept=application/json
-    ${resp}=  POST On Session  sdnc_restconf  ${url}  headers=${headers}  data=${body}  expected_status=200
-    ${respjson}=    Parse Json    ${resp.content}
-    Should Be Equal As Strings    ${respjson['output']['response-code']}        ${resp_code}
+    ${resp}=  POST On Session  sdnc_restconf  ${url}  headers=${headers}  data=${body}  expected_status=${resp_code}
 
 
 Send Empty Post Request And Validate Response
index 6be1225..1480d67 100644 (file)
@@ -7,18 +7,18 @@ ${SDNC_CONTAINER_NAME}          %{SDNC_CONTAINER_NAME}
 ${GRA_DATA_DIRECTORY}           %{WORKSPACE}/tests/sdnc/resources/grafiles
 # ${SDNC_RESTCONF_URL}            http://localhost:8282/restconf
 ${SDNC_RESTCONF_URL}            http://localhost:8282/rests
-${SDNC_HEALTHCHECK}             /operations/SLI-API:healthcheck/
+${SDNC_HEALTHCHECK}             /operations/SLI-API:healthcheck
 # ${SDNC_KEYSTORE_CONFIG_PATH}    /config/netconf-keystore:keystore
 # ${SDNC_NETWORK_TOPOLOGY}        /config/network-topology:network-topology
 # ${SDNC_MOUNT_PATH}              /config/network-topology:network-topology/topology/topology-netconf/node/PNFDemo
 # ${PNFSIM_MOUNT_PATH}            /config/network-topology:network-topology/topology/topology-netconf/node/PNFDemo/yang-ext:mount/turing-machine:turing-machine
 ${SDNC_KEYSTORE_CONFIG_PATH}    /data/netconf-keystore:keystore?content=config
 ${SDNC_NETWORK_TOPOLOGY}        /data/network-topology:network-topology?content=config
-${SDNC_MOUNT_PATH}              /data/network-topology:network-topology/topology/topology-netconf/node/PNFDemo?content=config
-${PNFSIM_MOUNT_PATH}            /data/network-topology:network-topology/topology/topology-netconf/node/PNFDemo/yang-ext:mount/turing-machine:turing-machine?content=config
-${GRA_PRELOAD_NETWORK}          /operations/GENERIC-RESOURCE-API:preload-network-topology-operation/
-${GRA_PRELOAD_VFMODULE}         /operations/GENERIC-RESOURCE-API:preload-vf-module-topology-operation/
-${GRA_SERVICE_TOPOLOGY}         /operations/GENERIC-RESOURCE-API:service-topology-operation/
-${GRA_NETWORK_TOPOLOGY}         /operations/GENERIC-RESOURCE-API:network-topology-operation/
-${GRA_VNF_TOPOLOGY}             /operations/GENERIC-RESOURCE-API:vnf-topology-operation/
-${GRA_VFMODULE_TOPOLOGY}        /operations/GENERIC-RESOURCE-API:vf-module-topology-operation/
+${SDNC_MOUNT_PATH}              /data/network-topology:network-topology/topology=topology-netconf/node=PNFDemo
+${PNFSIM_MOUNT_PATH}            /data/network-topology:network-topology/topology=topology-netconf/node=PNFDemo/yang-ext:mount/turing-machine:turing-machine?content=config
+${GRA_PRELOAD_NETWORK}          /operations/GENERIC-RESOURCE-API:preload-network-topology-operation
+${GRA_PRELOAD_VFMODULE}         /operations/GENERIC-RESOURCE-API:preload-vf-module-topology-operation
+${GRA_SERVICE_TOPOLOGY}         /operations/GENERIC-RESOURCE-API:service-topology-operation
+${GRA_NETWORK_TOPOLOGY}         /operations/GENERIC-RESOURCE-API:network-topology-operation
+${GRA_VNF_TOPOLOGY}             /operations/GENERIC-RESOURCE-API:vnf-topology-operation
+${GRA_VFMODULE_TOPOLOGY}        /operations/GENERIC-RESOURCE-API:vf-module-topology-operation
index 63a1c12..6b49b0f 100644 (file)
@@ -26,57 +26,48 @@ Check SDNC NETCONF/TLS Connection to PNF Simulator
 Check Dropping NETCONF/TLS Connection
     [Tags]      SDNC-PNFSIM-TLS-DISCONNECT-CHECK
     [Documentation]    Checking PNF Simulator Mount Delete from SDNC
-   Send Delete Request And Validate PNF Mount Deleted  ${SDNC_MOUNT_PATH}  200
-
-#Load network preload data
-#    [Tags]     SDNC-GRA-PRELOAD-NETWORK
-#    [Documentation]    Loading network preload data
-#    Send Post File And Validate Response    ${GRA_PRELOAD_NETWORK}    ${GRA_DATA_DIRECTORY}/preload-network.json     200
-
-#Load vf-module preload data
-#    [Tags]     SDNC-GRA-PRELOAD-VF-MODULE
-#    [Documentation]    Loading vf-module preload data
-#    Send Post File And Validate Response    ${GRA_PRELOAD_VFMODULE}   ${GRA_DATA_DIRECTORY}/preload-vf-module.json   200
-
-#Check GRA service assign
-#    [Tags]     SDNC-GRA-SERVICE-ASSIGN
-#    [Documentation]    Testing GRA service assign
-#    Send Post File And Validate Response    ${GRA_SERVICE_TOPOLOGY}   ${GRA_DATA_DIRECTORY}/svc-topology-assign.json   200
-
-#Check GRA network assign
-#    [Tags]     SDNC-GRA-NETWORK-ASSIGN
-#    [Documentation]    Testing GRA network assign
-#    Send Post File And Validate Response    ${GRA_NETWORK_TOPOLOGY}   ${GRA_DATA_DIRECTORY}/network-topology-assign.json   200
-
-#Check GRA vnf assign
-#    [Tags]     SDNC-GRA-VNF-ASSIGN
-#    [Documentation]    Testing GRA vnf assign
-#    Send Post File And Validate Response    ${GRA_VNF_TOPOLOGY}   ${GRA_DATA_DIRECTORY}/vnf-topology-assign.json   200
-
-#Check GRA vf-module assign
-#    [Tags]     SDNC-GRA-VF-MODULE-ASSIGN
-#    [Documentation]    Testing GRA vf-module assign
-#    Send Post File And Validate Response    ${GRA_VFMODULE_TOPOLOGY}   ${GRA_DATA_DIRECTORY}/vf-module-topology-assign.json   200
-
-#Check GRA vf-module unassign
-#    [Tags]     SDNC-GRA-VF-MODULE-UNASSIGN
-#    [Documentation]    Testing GRA vf-module unassign
-#    Send Post File And Validate Response    ${GRA_VFMODULE_TOPOLOGY}   ${GRA_DATA_DIRECTORY}/vf-module-topology-unassign.json   200
-
-#Check GRA vnf unassign
-#    [Tags]     SDNC-GRA-VNF-UNASSIGN
-#    [Documentation]    Testing GRA vnf unassign
-#    Send Post File And Validate Response    ${GRA_VNF_TOPOLOGY}   ${GRA_DATA_DIRECTORY}/vnf-topology-unassign.json   200
-
-#Check GRA network unassign
-#    [Tags]     SDNC-GRA-NETWORK-UNASSIGN
-#    [Documentation]    Testing GRA network unassign
-#    Send Post File And Validate Response    ${GRA_NETWORK_TOPOLOGY}   ${GRA_DATA_DIRECTORY}/network-topology-unassign.json   200
-
-#Check GRA service delete
-#    [Tags]     SDNC-GRA-SERVICE-DELETE
-#    [Documentation]    Testing GRA service delete
-#    Send Post File And Validate Response    ${GRA_SERVICE_TOPOLOGY}   ${GRA_DATA_DIRECTORY}/svc-topology-delete.json   200
+   Send Delete Request And Validate PNF Mount Deleted  ${SDNC_MOUNT_PATH}  204
+
+Load network preload data
+    [Tags]     SDNC-GRA-PRELOAD-NETWORK
+    [Documentation]    Loading network preload data
+    Send Post File And Validate Response    ${GRA_PRELOAD_NETWORK}    ${GRA_DATA_DIRECTORY}/preload-network.json     200
+Load vf-module preload data
+    [Tags]     SDNC-GRA-PRELOAD-VF-MODULE
+    [Documentation]    Loading vf-module preload data
+    Send Post File And Validate Response    ${GRA_PRELOAD_VFMODULE}   ${GRA_DATA_DIRECTORY}/preload-vf-module.json   200
+Check GRA service assign
+    [Tags]     SDNC-GRA-SERVICE-ASSIGN
+    [Documentation]    Testing GRA service assign
+    Send Post File And Validate Response    ${GRA_SERVICE_TOPOLOGY}   ${GRA_DATA_DIRECTORY}/svc-topology-assign.json   200
+Check GRA network assign
+    [Tags]     SDNC-GRA-NETWORK-ASSIGN
+    [Documentation]    Testing GRA network assign
+    Send Post File And Validate Response    ${GRA_NETWORK_TOPOLOGY}   ${GRA_DATA_DIRECTORY}/network-topology-assign.json   200
+Check GRA vnf assign
+    [Tags]     SDNC-GRA-VNF-ASSIGN
+    [Documentation]    Testing GRA vnf assign
+    Send Post File And Validate Response    ${GRA_VNF_TOPOLOGY}   ${GRA_DATA_DIRECTORY}/vnf-topology-assign.json   200
+Check GRA vf-module assign
+    [Tags]     SDNC-GRA-VF-MODULE-ASSIGN
+    [Documentation]    Testing GRA vf-module assign
+    Send Post File And Validate Response    ${GRA_VFMODULE_TOPOLOGY}   ${GRA_DATA_DIRECTORY}/vf-module-topology-assign.json   200
+Check GRA vf-module unassign
+    [Tags]     SDNC-GRA-VF-MODULE-UNASSIGN
+    [Documentation]    Testing GRA vf-module unassign
+    Send Post File And Validate Response    ${GRA_VFMODULE_TOPOLOGY}   ${GRA_DATA_DIRECTORY}/vf-module-topology-unassign.json   200
+Check GRA vnf unassign
+    [Tags]     SDNC-GRA-VNF-UNASSIGN
+    [Documentation]    Testing GRA vnf unassign
+    Send Post File And Validate Response    ${GRA_VNF_TOPOLOGY}   ${GRA_DATA_DIRECTORY}/vnf-topology-unassign.json   200
+Check GRA network unassign
+    [Tags]     SDNC-GRA-NETWORK-UNASSIGN
+    [Documentation]    Testing GRA network unassign
+    Send Post File And Validate Response    ${GRA_NETWORK_TOPOLOGY}   ${GRA_DATA_DIRECTORY}/network-topology-unassign.json   200
+Check GRA service delete
+    [Tags]     SDNC-GRA-SERVICE-DELETE
+    [Documentation]    Testing GRA service delete
+    Send Post File And Validate Response    ${GRA_SERVICE_TOPOLOGY}   ${GRA_DATA_DIRECTORY}/svc-topology-delete.json   200