From 125390ba301915c0829ad4c0b7eff0c935b6956c Mon Sep 17 00:00:00 2001 From: efiacor Date: Wed, 6 May 2020 01:14:00 +0100 Subject: Seperating usecase test suite dependencies # Refactoring BulkPM Dataplane test suite Signed-off-by: efiacor Change-Id: I4b2ad0dc5147e10ffc55f4ec210a29f073cd865b Issue-ID: INT-832 Signed-off-by: efiacor --- tests/usecases-5G-bulkpm/5G-bulkpm/BulkpmE2E.robot | 125 +++++++++++++ tests/usecases-5G-bulkpm/5G-bulkpm/__init__.robot | 2 + .../assets/json_events/FileExistNotification.json | 33 ++++ .../5G-bulkpm/assets/metadata.schema.json | 74 ++++++++ .../5G-bulkpm/resources/JsonValidatorLibrary.py | 40 ++++ .../5G-bulkpm/resources/bulkpm_keywords.robot | 39 ++++ .../5G-bulkpm/resources/xNFLibrary.py | 30 +++ .../config-over-netconf/__init__.robot | 2 + .../config-over-netconf/config_over_netconf.robot | 69 +++++++ .../config-over-netconf/data/blueprint_archive.zip | Bin 0 -> 10768 bytes .../config-over-netconf/data/config-assign.json | 25 +++ .../config-over-netconf/data/config-deploy.json | 25 +++ .../config-over-netconf/data/mount.xml | 14 ++ .../pnf-sw-upgrade/.gitignore | 22 +++ .../pnf-sw-upgrade/__init__.robot | 2 + .../pnf-sw-upgrade/data/blueprint_archive.zip | Bin 0 -> 18151 bytes .../data/distributeServiceTemplate.json | 35 ++++ .../pnf-sw-upgrade/data/mount.json | 18 ++ .../serviceInstantiationActivationRequest.json | 43 +++++ .../data/serviceInstantiationDownloadRequest.json | 43 +++++ .../pnf-sw-upgrade/pnf-sw-upgrade.robot | 196 ++++++++++++++++++++ tests/usecases/5G-bulkpm/BulkpmE2E.robot | 123 ------------- tests/usecases/5G-bulkpm/__init__.robot | 2 - .../assets/json_events/FileExistNotification.json | 33 ---- .../usecases/5G-bulkpm/assets/metadata.schema.json | 74 -------- .../5G-bulkpm/resources/JsonValidatorLibrary.py | 38 ---- .../5G-bulkpm/resources/bulkpm_keywords.robot | 39 ---- tests/usecases/5G-bulkpm/resources/xNFLibrary.py | 25 --- tests/usecases/config-over-netconf/__init__.robot | 2 - .../config-over-netconf/config_over_netconf.robot | 69 ------- .../config-over-netconf/data/blueprint_archive.zip | Bin 10768 -> 0 bytes .../config-over-netconf/data/config-assign.json | 25 --- .../config-over-netconf/data/config-deploy.json | 25 --- tests/usecases/config-over-netconf/data/mount.xml | 14 -- tests/usecases/pnf-sw-upgrade/.gitignore | 22 --- tests/usecases/pnf-sw-upgrade/__init__.robot | 2 - .../pnf-sw-upgrade/data/blueprint_archive.zip | Bin 18151 -> 0 bytes .../data/distributeServiceTemplate.json | 35 ---- tests/usecases/pnf-sw-upgrade/data/mount.json | 18 -- .../serviceInstantiationActivationRequest.json | 43 ----- .../data/serviceInstantiationDownloadRequest.json | 43 ----- tests/usecases/pnf-sw-upgrade/pnf-sw-upgrade.robot | 202 --------------------- 42 files changed, 837 insertions(+), 834 deletions(-) create mode 100644 tests/usecases-5G-bulkpm/5G-bulkpm/BulkpmE2E.robot create mode 100644 tests/usecases-5G-bulkpm/5G-bulkpm/__init__.robot create mode 100644 tests/usecases-5G-bulkpm/5G-bulkpm/assets/json_events/FileExistNotification.json create mode 100644 tests/usecases-5G-bulkpm/5G-bulkpm/assets/metadata.schema.json create mode 100644 tests/usecases-5G-bulkpm/5G-bulkpm/resources/JsonValidatorLibrary.py create mode 100644 tests/usecases-5G-bulkpm/5G-bulkpm/resources/bulkpm_keywords.robot create mode 100644 tests/usecases-5G-bulkpm/5G-bulkpm/resources/xNFLibrary.py create mode 100644 tests/usecases-config-over-netconf/config-over-netconf/__init__.robot create mode 100644 tests/usecases-config-over-netconf/config-over-netconf/config_over_netconf.robot create mode 100644 tests/usecases-config-over-netconf/config-over-netconf/data/blueprint_archive.zip create mode 100644 tests/usecases-config-over-netconf/config-over-netconf/data/config-assign.json create mode 100644 tests/usecases-config-over-netconf/config-over-netconf/data/config-deploy.json create mode 100644 tests/usecases-config-over-netconf/config-over-netconf/data/mount.xml create mode 100755 tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/.gitignore create mode 100644 tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/__init__.robot create mode 100644 tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/blueprint_archive.zip create mode 100644 tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/distributeServiceTemplate.json create mode 100755 tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/mount.json create mode 100644 tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/serviceInstantiationActivationRequest.json create mode 100644 tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/serviceInstantiationDownloadRequest.json create mode 100644 tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/pnf-sw-upgrade.robot delete mode 100644 tests/usecases/5G-bulkpm/BulkpmE2E.robot delete mode 100644 tests/usecases/5G-bulkpm/__init__.robot delete mode 100644 tests/usecases/5G-bulkpm/assets/json_events/FileExistNotification.json delete mode 100644 tests/usecases/5G-bulkpm/assets/metadata.schema.json delete mode 100644 tests/usecases/5G-bulkpm/resources/JsonValidatorLibrary.py delete mode 100644 tests/usecases/5G-bulkpm/resources/bulkpm_keywords.robot delete mode 100644 tests/usecases/5G-bulkpm/resources/xNFLibrary.py delete mode 100644 tests/usecases/config-over-netconf/__init__.robot delete mode 100644 tests/usecases/config-over-netconf/config_over_netconf.robot delete mode 100644 tests/usecases/config-over-netconf/data/blueprint_archive.zip delete mode 100644 tests/usecases/config-over-netconf/data/config-assign.json delete mode 100644 tests/usecases/config-over-netconf/data/config-deploy.json delete mode 100644 tests/usecases/config-over-netconf/data/mount.xml delete mode 100755 tests/usecases/pnf-sw-upgrade/.gitignore delete mode 100644 tests/usecases/pnf-sw-upgrade/__init__.robot delete mode 100644 tests/usecases/pnf-sw-upgrade/data/blueprint_archive.zip delete mode 100644 tests/usecases/pnf-sw-upgrade/data/distributeServiceTemplate.json delete mode 100755 tests/usecases/pnf-sw-upgrade/data/mount.json delete mode 100644 tests/usecases/pnf-sw-upgrade/data/serviceInstantiationActivationRequest.json delete mode 100644 tests/usecases/pnf-sw-upgrade/data/serviceInstantiationDownloadRequest.json delete mode 100644 tests/usecases/pnf-sw-upgrade/pnf-sw-upgrade.robot (limited to 'tests') diff --git a/tests/usecases-5G-bulkpm/5G-bulkpm/BulkpmE2E.robot b/tests/usecases-5G-bulkpm/5G-bulkpm/BulkpmE2E.robot new file mode 100644 index 00000000..fe3b1cec --- /dev/null +++ b/tests/usecases-5G-bulkpm/5G-bulkpm/BulkpmE2E.robot @@ -0,0 +1,125 @@ +*** Settings *** +Documentation Testing E2E VES,Dmaap,DFC,DR with File Ready event feed from xNF +Library RequestsLibrary +Library OperatingSystem +Library Collections +Library Process +Resource resources/bulkpm_keywords.robot +Library resources/JsonValidatorLibrary.py +Library resources/xNFLibrary.py + + +*** Variables *** +${VESC_URL} http://%{VESC_IP}:%{VESC_PORT} +${GLOBAL_APPLICATION_ID} robot-ves +${VES_ANY_EVENT_PATH} /eventListener/v7 +${HEADER_STRING} content-type=application/json +${EVENT_DATA_FILE} %{WORKSPACE}/tests/usecases-5G-bulkpm/5G-bulkpm/assets/json_events/FileExistNotification.json + +${TARGETURL_TOPICS} http://${DMAAP_MR_IP}:3904/topics +${TARGETURL_SUBSCR} http://${DMAAP_MR_IP}:3904/events/unauthenticated.VES_NOTIFICATION_OUTPUT/OpenDcae-c12/C12?timeout=1000 +${CLI_EXEC_CLI} curl -k https://${DR_PROV_IP}:8443/internal/prov +${CLI_EXEC_CLI_FILECONSUMER} docker exec fileconsumer-node /bin/sh -c "ls /opt/app/subscriber/delivery | grep .xml" +${CLI_EXEC_CLI_DFC_LOG} docker exec dcaegen2-datafile-collector /bin/sh -c "cat /var/log/ONAP/application.log" > %{WORKSPACE}/archives/dfc_docker.log +${CLI_EXEC_CLI_DFC_LOG_GREP} grep "Datafile file published" %{WORKSPACE}/archives/dfc_docker.log +${CLI_EXEC_CLI_FILECONSUMER_CP} docker cp fileconsumer-node:/opt/app/subscriber/delivery/A20181002.0000-1000-0015-1000_5G.xml.M %{WORKSPACE} +${CLI_EXEC_RENAME_METADATA} mv %{WORKSPACE}/A20181002.0000-1000-0015-1000_5G.xml.M %{WORKSPACE}/archives/metadata.json +${CLI_EXEC_CLI_PMMAPPER_LOG} docker exec dcaegen2-pm-mapper /bin/sh -c "cat /var/log/ONAP/dcaegen2/services/pm-mapper/pm-mapper_output.log" > %{WORKSPACE}/archives/pmmapper_docker.log +${CLI_EXEC_CLI_PMMAPPER_LOG_GREP} grep "XML validation successful Event" %{WORKSPACE}/archives/pmmapper_docker.log +${CLI_EXEC_CLI_PMMAPPER_LOG_GREP_VES} grep "Successfully published VES events to messagerouter" %{WORKSPACE}/archives/pmmapper_docker.log +${metadataSchemaPath} %{WORKSPACE}/tests/usecases-5G-bulkpm/5G-bulkpm/assets/metadata.schema.json +${metadataJsonPath} %{WORKSPACE}/archives/metadata.json + +*** Test Cases *** + +Send VES File Ready Event to VES Collector + [Tags] Bulk_PM_E2E_01 + [Documentation] Send VES File Ready Event + ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE} + ${headers}= Create Header From String ${HEADER_STRING} + ${resp}= Publish Event To VES Collector ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} + Sleep 15s + ${resp}= Publish Event To VES Collector ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} + Sleep 5s + ${resp}= Publish Event To VES Collector ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} + Sleep 5s + ${resp}= Publish Event To VES Collector ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} + Sleep 5s + Log Receive HTTP Status code ${resp.status_code} + Should Be Equal As Strings ${resp.status_code} 202 + +Check VES Notification Topic is existing in Message Router + [Tags] Bulk_PM_E2E_02 + [Documentation] Get the VES Notification topic on message router + [Timeout] 1 minute + Sleep 10s + ${resp}= GetCall ${TARGETURL_TOPICS} + log ${TARGETURL_TOPICS} + log 'JSON Response Code :'${resp} + ${topics}= Evaluate $resp.json().get('topics') + log ${topics} + ${ListLength}= Get Length ${topics} + log ${ListLength} + List Should Contain Value ${topics} unauthenticated.VES_NOTIFICATION_OUTPUT + +Verify Data File Collector successfully publishes the PM XML file to the Data Router + [Tags] Bulk_PM_E2E_03 + [Documentation] Check that DFC publishes the PM XML to the Data Router + ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_DFC_LOG} shell=yes + Log ${cli_cmd_output.stdout} + Should Be Equal As Strings ${cli_cmd_output.rc} 0 + ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_DFC_LOG_GREP} shell=yes + Log ${cli_cmd_output.stdout} + Should Be Equal As Strings ${cli_cmd_output.rc} 0 + Should Contain ${cli_cmd_output.stdout} Datafile file published + + +Verify Default Feed And File Consumer Subscription On Datarouter + [Tags] Bulk_PM_E2E_04 + [Documentation] Verify Default Feed And File Consumer Subscription On Datarouter + ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI} shell=yes + Log ${cli_cmd_output.stdout} + Should Be Equal As Strings ${cli_cmd_output.rc} 0 + Should Contain ${cli_cmd_output.stdout} https://dmaap-dr-prov/publish/1 + Should Contain ${cli_cmd_output.stdout} http://datarouter-subscriber:7070 + + +Verify Fileconsumer Receive PM file from Data Router + [Tags] Bulk_PM_E2E_05 + [Documentation] Check PM XML file exists on the File Consumer Simulator + ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_FILECONSUMER} shell=yes + Log ${cli_cmd_output.stdout} + Should Be Equal As Strings ${cli_cmd_output.rc} 0 + Should Contain ${cli_cmd_output.stdout} A20181002.0000-1000-0015-1000_5G.xml + +Verify File Consumer Receive valid metadata from Data Router + [Tags] Bulk_PM_E2E_06 + [Documentation] Check PM XML file is delivered to the FileConsumer Simulator with valid metadata + ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_FILECONSUMER} shell=yes + Log ${cli_cmd_output.stdout} + Should Be Equal As Strings ${cli_cmd_output.rc} 0 + Should Contain ${cli_cmd_output.stdout} A20181002.0000-1000-0015-1000_5G.xml.M + ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_FILECONSUMER_CP} shell=yes + ${cli_cmd_output}= Run Process ${CLI_EXEC_RENAME_METADATA} shell=yes + ${validation_result}= Validate ${metadataSchemaPath} ${metadataJsonPath} + Should Be Equal As Strings ${validation_result} 0 + +Verify PM-Mapper successfully receives uncompressed the PM XML file + [Tags] Bulk_PM_E2E_07 + [Documentation] Check that PM-Mapper receives the uncompressed PM XML file + ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_PMMAPPER_LOG} shell=yes + Log ${cli_cmd_output.stdout} + Should Be Equal As Strings ${cli_cmd_output.rc} 0 + ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_PMMAPPER_LOG_GREP} shell=yes + Log ${cli_cmd_output.stdout} + Should Be Equal As Strings ${cli_cmd_output.rc} 0 + Should Contain ${cli_cmd_output.stdout} XML validation successful Event + +Verify PM-Mapper successfully publishes VES event the Message Router + [Tags] Bulk_PM_E2E_08 + [Documentation] Check that PM-Mapper publishes VES onto the Message Router + ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_PMMAPPER_LOG} shell=yes + Log ${cli_cmd_output.stdout} + Should Be Equal As Strings ${cli_cmd_output.rc} 0 + ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_PMMAPPER_LOG_GREP_VES} shell=yes + Should Contain ${cli_cmd_output.stdout} Successfully published VES events to messagerouter \ No newline at end of file diff --git a/tests/usecases-5G-bulkpm/5G-bulkpm/__init__.robot b/tests/usecases-5G-bulkpm/5G-bulkpm/__init__.robot new file mode 100644 index 00000000..7114fd44 --- /dev/null +++ b/tests/usecases-5G-bulkpm/5G-bulkpm/__init__.robot @@ -0,0 +1,2 @@ +*** Settings *** +Documentation 5G Bulk PM E2E Testcases diff --git a/tests/usecases-5G-bulkpm/5G-bulkpm/assets/json_events/FileExistNotification.json b/tests/usecases-5G-bulkpm/5G-bulkpm/assets/json_events/FileExistNotification.json new file mode 100644 index 00000000..02f092df --- /dev/null +++ b/tests/usecases-5G-bulkpm/5G-bulkpm/assets/json_events/FileExistNotification.json @@ -0,0 +1,33 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "vesEventListenerVersion": "7.0.1", + "domain": "notification", + "eventName": "Noti_RnNode-Ericsson_FileReady", + "eventId": "FileReady_1797490e-10ae-4d48-9ea7-3d7d790b25e1", + "lastEpochMicrosec": 8745745764578, + "priority": "Normal", + "reportingEntityName": "otenb5309", + "sequence": 0, + "sourceName": "oteNB5309", + "startEpochMicrosec": 8745745764578, + "timeZoneOffset": "UTC+05.30" + }, + "notificationFields": { + "changeIdentifier": "PM_MEAS_FILES", + "changeType": "FileReady", + "notificationFieldsVersion": "2.0", + "arrayOfNamedHashMap": [ + { "name": "A20181002.0000-1000-0015-1000_5G.xml.gz", + "hashMap":{ + "location": "sftp://admin:admin@sftp:22/A20181002.0000-1000-0015-1000_5G.xml.gz", + "compression": "gzip", + "fileFormatType": "org.3GPP.32.435#measCollec", + "fileFormatVersion": "V10" + } + } + ] + } +} +} \ No newline at end of file diff --git a/tests/usecases-5G-bulkpm/5G-bulkpm/assets/metadata.schema.json b/tests/usecases-5G-bulkpm/5G-bulkpm/assets/metadata.schema.json new file mode 100644 index 00000000..a41b3544 --- /dev/null +++ b/tests/usecases-5G-bulkpm/5G-bulkpm/assets/metadata.schema.json @@ -0,0 +1,74 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "metadata.schema.json", + "title": "DataRouter PM File Metadata", + "description": "Metadata for 3GPP PM files that are placed on the DMaaP Data Router by the Data File Collector (VES 7.1)", + "type": "object", + + "properties": { + "productName": { + "description": "from the FileReady event eventName", + "type": "string" + }, + + "vendorName": { + "description": "from the FileReady event eventName", + "type": "string" + }, + + "lastEpochMicrosec": { + "description": "the latest unix epoch time associated with the FileReady event", + "type": "string" + }, + + "sourceName": { + "description": "the name of the entity experiencing the event", + "type": "string" + }, + + "startEpochMicrosec": { + "description": "the earliest unix epoch time associated with the FileReady event", + "type": "string" + }, + + "timeZoneOffset": { + "description": "the timezone offset from UTC", + "type": "string", + "pattern": "^(?:(?:[a-zA-Z]{3})[+-](?:[01][0-9]|2[0-3]).[0-5][0-9])$" + }, + + "location": { + "description": "follows the format ://://, the IP address is the node ip address, the port of the protocol server", + "type": "string" + }, + + "compression": { + "description": "specifies if the file is compressed", + "type": "string", + "enum": [ "gzip" ] + }, + + "fileFormatType": { + "description": "the file format", + "type": "string" + }, + + "fileFormatVersion": { + "description": "the version of the file format", + "type": "string" + } + }, + + "required": [ + "productName", + "vendorName", + "lastEpochMicrosec", + "sourceName", + "startEpochMicrosec", + "timeZoneOffset", + "location", + "compression", + "fileFormatType", + "fileFormatVersion" + ] +} diff --git a/tests/usecases-5G-bulkpm/5G-bulkpm/resources/JsonValidatorLibrary.py b/tests/usecases-5G-bulkpm/5G-bulkpm/resources/JsonValidatorLibrary.py new file mode 100644 index 00000000..ed376ff2 --- /dev/null +++ b/tests/usecases-5G-bulkpm/5G-bulkpm/resources/JsonValidatorLibrary.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- + +import logging + +from jsonschema import validate, ValidationError, SchemaError +from simplejson import load + + +class JsonValidatorLibrary(object): + + def __init__(self): + pass + + @staticmethod + def validate(schema_path, json_path): + logging.info("Schema path: " + schema_path) + logging.info("JSON path: " + json_path) + schema = None + data = None + try: + schema = load(open(schema_path, 'r')) + data = load(open(json_path, 'r')) + except (IOError, ValueError, OSError) as e: + logging.error(e.message) + return 1 + + try: + validate(data, schema) + except (ValidationError, SchemaError) as e: + logging.error(e.message) + return 1 + + # logger.log("JSON validation successful") + print("JSON validation successful") + return 0 + + +if __name__ == '__main__': + lib = JsonValidatorLibrary() +# sys.exit(JsonValidatorLibrary().validate(sys.argv[1], sys.argv[2])) diff --git a/tests/usecases-5G-bulkpm/5G-bulkpm/resources/bulkpm_keywords.robot b/tests/usecases-5G-bulkpm/5G-bulkpm/resources/bulkpm_keywords.robot new file mode 100644 index 00000000..9ef56c83 --- /dev/null +++ b/tests/usecases-5G-bulkpm/5G-bulkpm/resources/bulkpm_keywords.robot @@ -0,0 +1,39 @@ + *** Settings *** +Documentation The main interface for interacting with VES. It handles low level stuff like managing the http request library and VES required fields +Library RequestsLibrary +Library ../resources/xNFLibrary.py +Library ../resources/JsonValidatorLibrary.py +Library OperatingSystem +Library Collections +Library requests +Library Collections +Library String + +*** Variables *** + +*** Keywords *** + +Get Event Data From File + [Arguments] ${jsonfile} + ${data}= OperatingSystem.Get File ${jsonfile} + #Should Not Be_Equal ${data} None + [return] ${data} + +Publish Event To VES Collector + [Documentation] Send an event to VES Collector + [Arguments] ${url} ${evtpath} ${httpheaders} ${evtdata} + Log Creating session ${url} + ${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} +PostCall + [Arguments] ${url} ${data} + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= Evaluate requests.post('${url}',data='${data}', headers=${headers},verify=False) requests + [Return] ${resp} + +GetCall + [Arguments] ${url} + ${resp}= Evaluate requests.get('${url}') requests + [Return] ${resp} diff --git a/tests/usecases-5G-bulkpm/5G-bulkpm/resources/xNFLibrary.py b/tests/usecases-5G-bulkpm/5G-bulkpm/resources/xNFLibrary.py new file mode 100644 index 00000000..b70d8095 --- /dev/null +++ b/tests/usecases-5G-bulkpm/5G-bulkpm/resources/xNFLibrary.py @@ -0,0 +1,30 @@ +''' +Created on Aug 18, 2017 + +@author: sw6830 +''' +import time +import uuid + +from robot.api import logger + + +class xNFLibrary(object): + + def __init__(self): + pass + + @staticmethod + def create_header_from_string(dict_str): + logger.info("Enter create_header_from_string: dictStr") + return dict(u.split("=") for u in dict_str.split(",")) + + @staticmethod + def Generate_UUID(self): + """generate a uuid""" + return uuid.uuid4() + + +if __name__ == '__main__': + lib = xNFLibrary() + time.sleep(100000) diff --git a/tests/usecases-config-over-netconf/config-over-netconf/__init__.robot b/tests/usecases-config-over-netconf/config-over-netconf/__init__.robot new file mode 100644 index 00000000..614d5c17 --- /dev/null +++ b/tests/usecases-config-over-netconf/config-over-netconf/__init__.robot @@ -0,0 +1,2 @@ +1 *** Settings *** +2 Documentation PNF - config-over-netconf diff --git a/tests/usecases-config-over-netconf/config-over-netconf/config_over_netconf.robot b/tests/usecases-config-over-netconf/config-over-netconf/config_over_netconf.robot new file mode 100644 index 00000000..21c03c6f --- /dev/null +++ b/tests/usecases-config-over-netconf/config-over-netconf/config_over_netconf.robot @@ -0,0 +1,69 @@ +*** 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/pnf-simulator +${PNFSIM_MOUNT_PATH} /config/network-topology:network-topology/topology/topology-netconf/node/pnf-simulator/yang-ext:mount/mynetconf:netconflist +${BP_UPLOAD_URL} /api/v1/execution-service/upload +${BP_PROCESS_URL} /api/v1/execution-service/process +${BP_ARCHIVE_PATH} ${CURDIR}/data/blueprint_archive.zip + + +*** 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 BP-PROC upload blueprint archive + [Documentation] Upload Blueprint archive to BP processor + Create Session blueprint http://localhost:8000 + ${bp_archive}= Get Binary File ${BP_ARCHIVE_PATH} + &{bp_file}= create Dictionary file ${bp_archive} + &{headers}= Create Dictionary Authorization=Basic Y2NzZGthcHBzOmNjc2RrYXBwcw== + ${resp}= Post Request blueprint ${BP_UPLOAD_URL} files=${bp_file} headers=${headers} + Should Be Equal As Strings ${resp.status_code} 200 + +Test BP-PROC CONFIG-ASSIGN + [Documentation] Send config-assign request to BP-Proc + Create Session blueprint http://localhost:8000 + ${config-assign}= Get File ${CURDIR}${/}data${/}config-assign.json + Log to console ${config-assign} + &{headers}= Create Dictionary Authorization=Basic Y2NzZGthcHBzOmNjc2RrYXBwcw== Content-Type=application/json Accept=application/json + ${resp}= Post Request blueprint ${BP_PROCESS_URL} data=${config-assign} headers=${headers} + Should Be Equal As Strings ${resp.status_code} 200 + +Test BP-PROC CONFIG-DEPLOY + [Documentation] Send config-deploy request to BP-Proc + Create Session blueprint http://localhost:8000 + ${config-deploy}= Get File ${CURDIR}${/}data${/}config-deploy.json + Log to console ${config-deploy} + &{headers}= Create Dictionary Authorization=Basic Y2NzZGthcHBzOmNjc2RrYXBwcw== Content-Type=application/json Accept=application/json + ${resp}= Post Request blueprint ${BP_PROCESS_URL} data=${config-deploy} headers=${headers} + Should Be Equal As Strings ${resp.status_code} 200 + +Test PNF Configuration update + [Documentation] Checking PNF configuration params + 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 10 + &{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.text} {"netconf-id":30,"netconf-param":3000} diff --git a/tests/usecases-config-over-netconf/config-over-netconf/data/blueprint_archive.zip b/tests/usecases-config-over-netconf/config-over-netconf/data/blueprint_archive.zip new file mode 100644 index 00000000..ac346554 Binary files /dev/null and b/tests/usecases-config-over-netconf/config-over-netconf/data/blueprint_archive.zip differ diff --git a/tests/usecases-config-over-netconf/config-over-netconf/data/config-assign.json b/tests/usecases-config-over-netconf/config-over-netconf/data/config-assign.json new file mode 100644 index 00000000..12c3865f --- /dev/null +++ b/tests/usecases-config-over-netconf/config-over-netconf/data/config-assign.json @@ -0,0 +1,25 @@ +{ + "actionIdentifiers": { + "actionName": "config-assign", + "blueprintName": "configuration_over_restconf", + "blueprintVersion": "1.0.0", + "mode": "sync" + }, + "commonHeader": { + "originatorId": "sdnc", + "requestId": "123456-1000", + "subRequestId": "sub-123456-1000" + }, + "payload": { + "config-assign-request": { + "resolution-key": "RES-KEY reskey", + "config-assign-properties": { + "service-instance-id": "siid_1234", + "pnf-id": "pnf-simulator", + "pnf-ipv4-address": "pnfaddr", + "service-model-uuid": "service-model-uuid", + "pnf-customization-uuid": "pnf-customization-uuid" + } + } + } +} diff --git a/tests/usecases-config-over-netconf/config-over-netconf/data/config-deploy.json b/tests/usecases-config-over-netconf/config-over-netconf/data/config-deploy.json new file mode 100644 index 00000000..546fdc78 --- /dev/null +++ b/tests/usecases-config-over-netconf/config-over-netconf/data/config-deploy.json @@ -0,0 +1,25 @@ +{ + "actionIdentifiers": { + "actionName": "config-deploy", + "blueprintName": "configuration_over_restconf", + "blueprintVersion": "1.0.0", + "mode": "sync" + }, + "commonHeader": { + "originatorId": "sdnc", + "requestId": "123456-1000", + "subRequestId": "sub-123456-1000" + }, + "payload": { + "config-deploy-request": { + "resolution-key": "RES-KEY reskey", + "config-deploy-properties": { + "service-instance-id": "siid_1234", + "pnf-id": "pnf-simulator", + "pnf-ipv4-address": "pnfaddr", + "service-model-uuid": "service-model-uuid", + "pnf-customization-uuid": "pnf-customization-uuid" + } + } + } +} diff --git a/tests/usecases-config-over-netconf/config-over-netconf/data/mount.xml b/tests/usecases-config-over-netconf/config-over-netconf/data/mount.xml new file mode 100644 index 00000000..22053e8a --- /dev/null +++ b/tests/usecases-config-over-netconf/config-over-netconf/data/mount.xml @@ -0,0 +1,14 @@ + + pnf-simulator + + ODL_private_key_0 + netconf + + pnfaddr + 6513 + false + + TLS + + 2 + diff --git a/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/.gitignore b/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/.gitignore new file mode 100755 index 00000000..44793d73 --- /dev/null +++ b/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/.gitignore @@ -0,0 +1,22 @@ +target +**/.settings +**/.classpath +**/.project +**/.buildpath +**/.factorypath +**/.springBeans +.idea +.checkstyle +.DS_Store +.*~ +*.iml +*.class +*.swp +*.log +*.tmp +**/bin/ +/.metadata/ +temp/ +**/temp/** +test_lab/ +**/test_lab/** diff --git a/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/__init__.robot b/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/__init__.robot new file mode 100644 index 00000000..a721a88f --- /dev/null +++ b/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/__init__.robot @@ -0,0 +1,2 @@ +1 *** Settings *** +2 Documentation PNF - pnf-sw-upgrade diff --git a/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/blueprint_archive.zip b/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/blueprint_archive.zip new file mode 100644 index 00000000..4edc9ded Binary files /dev/null and b/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/blueprint_archive.zip differ diff --git a/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/distributeServiceTemplate.json b/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/distributeServiceTemplate.json new file mode 100644 index 00000000..c13eb8d5 --- /dev/null +++ b/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/distributeServiceTemplate.json @@ -0,0 +1,35 @@ +{ + "distributionID": "05fd08d8-c452-429a-a1ad-806c8d05e7c8", + "serviceName": "Demo_svc", + "serviceVersion": "1.0", + "serviceUUID": "cd4decf6-4f27-4775-9561-0e683ed43635", + "serviceDescription": "aaaa", + "serviceInvariantUUID": "fe41489e-1563-46a3-b90a-1db629e4375b", + "resources": [ + { + "resourceInstanceName": "Demo_pnf 0", + "resourceCustomizationUUID": "36b46817-2eaf-41b3-bfa3-11a7e0fd9bb2", + "resourceName": "Demo_pnf", + "resourceVersion": "1.0", + "resoucreType": "PNF", + "resourceUUID": "a42f6566-6a29-43e1-bac9-b91a59d702ac", + "resourceInvariantUUID": "fdf44827-35db-4ee5-bd70-7500e633576e", + "category": "Network L4+", + "subcategory": "Common Network Resources", + "artifacts": [] + } + ], + "serviceArtifacts": [ + { + "artifactName": "service-DemoSvc-csar.csar", + "artifactType": "TOSCA_CSAR", + "artifactURL": "//unzipped_sdc_csar/v1/catalog/services/DemoSvc/1.0/artifacts/service-DemoSvc-csar.csar", + "artifactChecksum": "Njk4NDM4YTdjYmM4NWFkN2M1YWZiM2IzYzdmNWZjZTU\u003d", + "artifactDescription": "TOSCA definition package of the asset", + "artifactTimeout": 0, + "artifactVersion": "1", + "artifactUUID": "e2640671-a5ed-40a6-b231-8f33084b1c1a" + } + ], + "workloadContext": "Production" + } \ No newline at end of file diff --git a/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/mount.json b/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/mount.json new file mode 100755 index 00000000..58925b1a --- /dev/null +++ b/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/mount.json @@ -0,0 +1,18 @@ +{ + "node": [ + { + "node-id": "PNFDemo", + "netconf-node-topology:protocol": { + "name": "TLS" + }, + "netconf-node-topology:host": "pnfaddr", + "netconf-node-topology:key-based": { + "username": "netconf", + "key-id": "ODL_private_key_0" + }, + "netconf-node-topology:port": 6513, + "netconf-node-topology:tcp-only": false, + "netconf-node-topology:max-connection-attempts": 5 + } + ] +} \ No newline at end of file diff --git a/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/serviceInstantiationActivationRequest.json b/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/serviceInstantiationActivationRequest.json new file mode 100644 index 00000000..a25ebfda --- /dev/null +++ b/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/serviceInstantiationActivationRequest.json @@ -0,0 +1,43 @@ +{ + "requestDetails":{ + "requestInfo":{ + "source":"VID", + "suppressRollback":false, + "requestorId":"demo" + }, + "modelInfo":{ + "modelType":"service", + "modelInvariantUuid":"fe41489e-1563-46a3-b90a-1db629e4375b", + "modelInvariantId" : "fe41489e-1563-46a3-b90a-1db629e4375b", + "modelUuid":"cd4decf6-4f27-4775-9561-0e683ed43635", + "modelVersionId" : "cd4decf6-4f27-4775-9561-0e683ed43635", + "modelName":"Demo_svc", + "modelVersion":"1.0" + }, + "requestParameters":{ + "userParams":[ + { + "name":"targetSoftwareVersion", + "value":"pnf_sw_version-3.0.0" + }, + { + "name":"pnfName", + "value":"PNFDemo" + } + ], + "subscriptionServiceType":"vCPE", + "aLaCarte":false + + }, + "subscriberInfo": { + "globalSubscriberId": "DemoCustomer" + }, + "project": { + "projectName": "pnfSWUProject" + }, + "owningEntity": { + "owningEntityId": "f2e1071e-3d47-4a65-94d4-e473ec03326a", + "owningEntityName": "OE-Demonstration" + } + } + } \ No newline at end of file diff --git a/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/serviceInstantiationDownloadRequest.json b/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/serviceInstantiationDownloadRequest.json new file mode 100644 index 00000000..0042ac26 --- /dev/null +++ b/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/serviceInstantiationDownloadRequest.json @@ -0,0 +1,43 @@ +{ + "requestDetails":{ + "requestInfo":{ + "source":"VID", + "suppressRollback":false, + "requestorId":"demo" + }, + "modelInfo":{ + "modelType":"service", + "modelInvariantUuid":"fe41489e-1563-46a3-b90a-1db629e4375b", + "modelInvariantId" : "fe41489e-1563-46a3-b90a-1db629e4375b", + "modelUuid":"cd4decf6-4f27-4775-9561-0e683ed43635", + "modelVersionId" : "cd4decf6-4f27-4775-9561-0e683ed43635", + "modelName":"Demo_svc", + "modelVersion":"1.0" + }, + "requestParameters":{ + "userParams":[ + { + "name":"targetSoftwareVersion", + "value":"pnf_sw_version-2.0.0" + }, + { + "name":"pnfName", + "value":"PNFDemo" + } + ], + "subscriptionServiceType":"vCPE", + "aLaCarte":false + + }, + "subscriberInfo": { + "globalSubscriberId": "DemoCustomer" + }, + "project": { + "projectName": "pnfSWUProject" + }, + "owningEntity": { + "owningEntityId": "f2e1071e-3d47-4a65-94d4-e473ec03326a", + "owningEntityName": "OE-Demonstration" + } + } + } \ No newline at end of file diff --git a/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/pnf-sw-upgrade.robot b/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/pnf-sw-upgrade.robot new file mode 100644 index 00000000..738a4311 --- /dev/null +++ b/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/pnf-sw-upgrade.robot @@ -0,0 +1,196 @@ +*** Settings *** +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json +Library String + +*** Variables *** +${SDNC_KEYSTORE_CONFIG_PATH} /restconf/config/netconf-keystore:keystore +${SDNC_MOUNT_PATH} /restconf/config/network-topology:network-topology/topology/topology-netconf/node/PNFDemo +${PNFSIM_MOUNT_PATH} /restconf/config/network-topology:network-topology/topology/topology-netconf/node/PNFDemo/yang-ext:mount/pnf-sw-upgrade:software-upgrade +${PNFSIM_DELETE_PATH} /restconf/config/network-topology:network-topology/topology/topology-netconf/node/PNFDemo +${BP_UPLOAD_URL} /api/v1/blueprint-model/publish +${BP_PROCESS_URL} /api/v1/execution-service/process +${BP_ARCHIVE_PATH} ${CURDIR}/data/blueprint_archive.zip +${SLEEP_INTERVAL_SEC}= 5 +${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT}= 20 + + +*** Test Cases *** +Test SDNC Keystore + [Documentation] Checking keystore after SDNC installation + Create Session sdnc http://${REPO_IP}:8282 + &{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 BP-PROC upload blueprint archive + [Documentation] Upload Blueprint archive to BP processor + Create Session blueprint http://${REPO_IP}:8000 + ${bp_archive}= Get Binary File ${BP_ARCHIVE_PATH} + &{bp_file}= create Dictionary file ${bp_archive} + &{headers}= Create Dictionary Authorization=Basic Y2NzZGthcHBzOmNjc2RrYXBwcw== + ${resp}= Post Request blueprint ${BP_UPLOAD_URL} files=${bp_file} headers=${headers} + Should Be Equal As Strings ${resp.status_code} 200 + +Distribute Service Template + Create Session sdc_controller_session http://${REPO_IP}:8085 + ${data}= Get Binary File ${CURDIR}${/}data${/}distributeServiceTemplate.json + &{headers}= Create Dictionary Authorization=Basic bXNvX2FkbWluOnBhc3N3b3JkMSQ= resource-location=/app/distribution-test-zip/unzipped/ Content-Type=application/json Accept=application/json + ${resp}= Post Request sdc_controller_session /test/treatNotification/v1 data=${data} headers=${headers} + Run Keyword If '${resp.status_code}' == '200' log to console \nexecuted with expected result + Should Be Equal As Strings '${resp.status_code}' '200' + ${serviceInstanceId}= Set Variable cd4decf6-4f27-4775-9561-0e683ed43635 + SET GLOBAL VARIABLE ${serviceInstanceId} + ${pnfName}= Set Variable PNFDemo + SET GLOBAL VARIABLE ${pnfName} + +Get pnf workflow + Create Session api_handler_session http://${REPO_IP}:8080 + &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json + ${get_pnfworkflows_request}= Get Request api_handler_session /onap/so/infra/workflowSpecifications/v1/pnfWorkflows headers=${headers} + Run Keyword If '${get_pnfworkflows_request.status_code}' == '200' log to console \nexecuted with expected result + log to console ${get_pnfworkflows_request.content} + ${pnfworkflows_json_response}= Evaluate json.loads(r"""${get_pnfworkflows_request.content}""", strict=False) json + ${all_wf_members}= Set Variable ${pnfworkflows_json_response['workflowSpecificationList']} + ${activate_workflow_uuid}= Set Variable "" + ${activate_workflow_name}= Set Variable "" + ${download_workflow_uuid}= Set Variable "" + ${download_workflow_name}= Set Variable "" + FOR ${member} IN @{all_wf_members} + ${workflow_uuid}= Set Variable ${member}[workflowSpecification][artifactInfo][artifactUuid] + ${workflow_name}= Set Variable ${member}[workflowSpecification][artifactInfo][artifactName] + Log to console The workflow ${workflow_name} has uuid : ${workflow_uuid} + ${activate_workflow_uuid}= Set Variable If '${workflow_name}' == 'PNFSoftwareUpgrade' ${workflow_uuid} ${activate_workflow_uuid} + ${activate_workflow_name}= Set Variable If '${workflow_name}' == 'PNFSoftwareUpgrade' ${workflow_name} ${activate_workflow_name} + ${download_workflow_uuid}= Set Variable If '${workflow_name}' == 'PNFSWUPDownload' ${workflow_uuid} ${download_workflow_uuid} + ${download_workflow_name}= Set Variable If '${workflow_name}' == 'PNFSWUPDownload' ${workflow_name} ${download_workflow_name} + END + + SET GLOBAL VARIABLE ${activate_workflow_uuid} + SET GLOBAL VARIABLE ${download_workflow_uuid} + Run Keyword If '${activate_workflow_name}' == 'PNFSoftwareUpgrade' log to console \nexecuted with expected result + Run Keyword If '${download_workflow_name}' == 'PNFSWUPDownload' log to console \nexecuted with expected result + Should Be Equal As Strings '${activate_workflow_name}' 'PNFSoftwareUpgrade' + Should Be Equal As Strings '${download_workflow_name}' 'PNFSWUPDownload' + +Invoke Service Instantiation for pnf software download + Create Session api_handler_session http://${REPO_IP}:8080 + ${data}= Get Binary File ${CURDIR}${/}data${/}serviceInstantiationDownloadRequest.json + &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json X-ONAP-RequestID=0ddc448d-5513-44bc-8b02-5759d84600d5 X-ONAP-PartnerName=ONAP X-RequestorID=VID + ${service_instantiation_request}= Post Request api_handler_session /onap/so/infra/instanceManagement/v1/serviceInstances/${serviceInstanceId}/pnfs/${pnfName}/workflows/${download_workflow_uuid} data=${data} headers=${headers} + Run Keyword If '${service_instantiation_request.status_code}' == '200' log to console \nexecuted with expected result + log to console ${service_instantiation_request.content} + ${service_instantiation_json_response}= Evaluate json.loads(r"""${service_instantiation_request.content}""", strict=False) json + ${request_ID}= Set Variable ${service_instantiation_json_response}[requestReferences][requestId] + ${actual_request_state}= Set Variable "" + FOR ${INDEX} IN RANGE ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT} + ${orchestration_status_request}= Get Request api_handler_session /onap/so/infra/orchestrationRequests/v7/${request_ID} + Run Keyword If '${orchestration_status_request.status_code}' == '200' log to console \nexecuted with expected result + log to console ${orchestration_status_request.content} + ${orchestration_json_response}= Evaluate json.loads(r"""${orchestration_status_request.content}""", strict=False) json + ${actual_request_state}= SET VARIABLE ${orchestration_json_response}[request][requestStatus][requestState] + Log To Console Received actual repsonse status:${actual_request_state} + RUN KEYWORD IF '${actual_request_state}' == 'COMPLETE' or '${actual_request_state}' == 'FAILED' Exit For Loop + log to console Will try again after ${SLEEP_INTERVAL_SEC} seconds + SLEEP ${SLEEP_INTERVAL_SEC}s + END + Log To Console final repsonse status received: ${actual_request_state} + Run Keyword If '${actual_request_state}' == 'COMPLETE' log to console \nexecuted with expected result + Should Be Equal As Strings '${actual_request_state}' 'COMPLETE' + +Test verify PNF Configuration for software download + [Documentation] Checking PNF configuration params + Create Session sdnc http://${REPO_IP}:8282 + &{headers}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/json + ${mount}= Get File ${CURDIR}${/}data${/}mount.json + Log to console ${mount} + ${pnf_mount_resp}= Put Request sdnc ${SDNC_MOUNT_PATH} data=${mount} headers=${headers} + Should Be Equal As Strings ${pnf_mount_resp.status_code} 201 + SLEEP 10 + ${pnfsim_software_resp}= Get Request sdnc ${PNFSIM_MOUNT_PATH} headers=${headers} + Should Be Equal As Strings ${pnfsim_software_resp.status_code} 200 + Log to console ${pnfsim_software_resp.content} + ${pnfsim_software_resp_json}= Evaluate json.loads(r"""${pnfsim_software_resp.content}""", strict=False) json + ${all_upgp_members}= Set Variable ${pnfsim_software_resp_json['software-upgrade']['upgrade-package']} + FOR ${member} IN @{all_upgp_members} + ${soft_ver}= Get From Dictionary ${member} software-version + ${soft_status}= Get From Dictionary ${member} current-status + Log to console The node ${pnfName} has software version ${soft_ver} : ${soft_status} + Run Keyword If '${soft_ver}' == 'pnf_sw_version-2.0.0' Exit For Loop + END + Run Keyword If '${soft_ver}' == 'pnf_sw_version-2.0.0' log to console \nexecuted with expected result + Should Be Equal As Strings '${soft_ver}' 'pnf_sw_version-2.0.0' + Should Be Equal As Strings '${soft_status}' 'DOWNLOAD_COMPLETED' + +Invoke Service Instantiation for pnf software activation + Create Session api_handler_session http://${REPO_IP}:8080 + ${data}= Get Binary File ${CURDIR}${/}data${/}serviceInstantiationActivationRequest.json + &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json X-ONAP-RequestID=4e104e12-5539-4557-b31e-00369398c214 X-ONAP-PartnerName=ONAP X-RequestorID=VID + ${service_instantiation_request}= Post Request api_handler_session /onap/so/infra/instanceManagement/v1/serviceInstances/${serviceInstanceId}/pnfs/${pnfName}/workflows/${activate_workflow_uuid} data=${data} headers=${headers} + Run Keyword If '${service_instantiation_request.status_code}' == '200' log to console \nexecuted with expected result + log to console ${service_instantiation_request.content} + ${service_instantiation_json_response}= Evaluate json.loads(r"""${service_instantiation_request.content}""", strict=False) json + ${request_ID}= Set Variable ${service_instantiation_json_response}[requestReferences][requestId] + ${actual_request_state}= Set Variable "" + FOR ${INDEX} IN RANGE ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT} + ${orchestration_status_request}= Get Request api_handler_session /onap/so/infra/orchestrationRequests/v7/${request_ID} + Run Keyword If '${orchestration_status_request.status_code}' == '200' log to console \nexecuted with expected result + log to console ${orchestration_status_request.content} + ${orchestration_json_response}= Evaluate json.loads(r"""${orchestration_status_request.content}""", strict=False) json + ${actual_request_state}= SET VARIABLE ${orchestration_json_response}[request][requestStatus][requestState] + Log To Console Received actual repsonse status:${actual_request_state} + RUN KEYWORD IF '${actual_request_state}' == 'COMPLETE' or '${actual_request_state}' == 'FAILED' Exit For Loop + log to console Will try again after ${SLEEP_INTERVAL_SEC} seconds + SLEEP ${SLEEP_INTERVAL_SEC}s + END + Log To Console final repsonse status received: ${actual_request_state} + Run Keyword If '${actual_request_state}' == 'COMPLETE' log to console \nexecuted with expected result + Should Be Equal As Strings '${actual_request_state}' 'COMPLETE' + +Test verify PNF Configuration for software activate + [Documentation] Checking PNF configuration params + Create Session sdnc http://${REPO_IP}:8282 + &{headers}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/json + ${mount}= Get File ${CURDIR}${/}data${/}mount.json + Log to console ${mount} + ${pnf_mount_resp}= Put Request sdnc ${SDNC_MOUNT_PATH} data=${mount} headers=${headers} + Should Be Equal As Strings ${pnf_mount_resp.status_code} 201 + SLEEP 10 + ${pnfsim_software_resp}= Get Request sdnc ${PNFSIM_MOUNT_PATH} headers=${headers} + Should Be Equal As Strings ${pnfsim_software_resp.status_code} 200 + Log to console ${pnfsim_software_resp.content} + ${pnfsim_software_resp_json}= Evaluate json.loads(r"""${pnfsim_software_resp.content}""", strict=False) json + ${all_upgp_members}= Set Variable ${pnfsim_software_resp_json['software-upgrade']['upgrade-package']} + FOR ${member} IN @{all_upgp_members} + ${soft_ver}= Get From Dictionary ${member} software-version + ${soft_status}= Get From Dictionary ${member} current-status + Log to console The node ${pnfName} has software version ${soft_ver} : ${soft_status} + Run Keyword If '${soft_ver}' == 'pnf_sw_version-3.0.0' Exit For Loop + END + Run Keyword If '${soft_ver}' == 'pnf_sw_version-3.0.0' log to console \nexecuted with expected result + Should Be Equal As Strings '${soft_ver}' 'pnf_sw_version-3.0.0' + Should Be Equal As Strings '${soft_status}' 'ACTIVATION_COMPLETED' + +Test AAI-update for target software version verify + Create Session aai_simulator_session https://${REPO_IP}:9993 + &{headers}= Create Dictionary Authorization=Basic YWFpOmFhaS5vbmFwLm9yZzpkZW1vMTIzNDU2IQ== Content-Type=application/json Accept=application/json verify=False + FOR ${INDEX} IN RANGE ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT} + ${get_pnf_request}= Get Request aai_simulator_session aai/v11/network/pnfs/pnf/${pnfName} headers=${headers} + Run Keyword If '${get_pnf_request.status_code}' == '200' log to console \nexecuted with expected result + ${get_pnf_json_response}= Evaluate json.loads(r"""${get_pnf_request.content}""", strict=False) json + Log to console ${get_pnf_json_response} + ${sw_version}= Set Variable ${get_pnf_json_response}[sw-version] + Log to console ${sw_version} + Run Keyword If '${sw_version}' == 'pnf_sw_version-3.0.0' Exit For Loop + log to console Will try again after ${SLEEP_INTERVAL_SEC} seconds + SLEEP ${SLEEP_INTERVAL_SEC}s + END + Log To Console final target software version received: ${sw_version} + Run Keyword If '${sw_version}' == 'pnf_sw_version-3.0.0' log to console \nexecuted with expected result + Should Be Equal As Strings '${sw_version}' 'pnf_sw_version-3.0.0' diff --git a/tests/usecases/5G-bulkpm/BulkpmE2E.robot b/tests/usecases/5G-bulkpm/BulkpmE2E.robot deleted file mode 100644 index e89d4d67..00000000 --- a/tests/usecases/5G-bulkpm/BulkpmE2E.robot +++ /dev/null @@ -1,123 +0,0 @@ -*** Settings *** -Documentation Testing E2E VES,Dmaap,DFC,DR with File Ready event feed from xNF -Library RequestsLibrary -Library OperatingSystem -Library Collections -Library Process -Resource resources/bulkpm_keywords.robot - - -*** Variables *** -${VESC_URL} http://%{VESC_IP}:%{VESC_PORT} -${GLOBAL_APPLICATION_ID} robot-ves -${VES_ANY_EVENT_PATH} /eventListener/v7 -${HEADER_STRING} content-type=application/json -${EVENT_DATA_FILE} %{WORKSPACE}/tests/usecases/5G-bulkpm/assets/json_events/FileExistNotificationUpdated.json - -${TARGETURL_TOPICS} http://${DMAAP_MR_IP}:3904/topics -${TARGETURL_SUBSCR} http://${DMAAP_MR_IP}:3904/events/unauthenticated.VES_NOTIFICATION_OUTPUT/OpenDcae-c12/C12?timeout=1000 -${CLI_EXEC_CLI} curl -k https://${DR_PROV_IP}:8443/internal/prov -${CLI_EXEC_CLI_FILECONSUMER} docker exec fileconsumer-node /bin/sh -c "ls /opt/app/subscriber/delivery | grep .xml" -${CLI_EXEC_CLI_DFC_LOG} docker exec dfc /bin/sh -c "cat /var/log/ONAP/application.log" > /tmp/dfc_docker.log.robot -${CLI_EXEC_CLI_DFC_LOG_GREP} grep "Datafile file published" /tmp/dfc_docker.log.robot -${CLI_EXEC_CLI_FILECONSUMER_CP} docker cp fileconsumer-node:/opt/app/subscriber/delivery/A20181002.0000-1000-0015-1000_5G.xml.M %{WORKSPACE} -${CLI_EXEC_RENAME_METADATA} mv %{WORKSPACE}/A20181002.0000-1000-0015-1000_5G.xml.M %{WORKSPACE}/metadata.json -${CLI_EXEC_CLI_PMMAPPER_LOG} docker exec pmmapper /bin/sh -c "cat /var/log/ONAP/dcaegen2/services/pm-mapper/pm-mapper_output.log" > /tmp/pmmapper_docker.log.robot -${CLI_EXEC_CLI_PMMAPPER_LOG_GREP} grep "XML validation successful Event" /tmp/pmmapper_docker.log.robot -${CLI_EXEC_CLI_PMMAPPER_LOG_GREP_VES} grep "Successfully published VES events to messagerouter" /tmp/pmmapper_docker.log.robot -${metadataSchemaPath} %{WORKSPACE}/tests/usecases/5G-bulkpm/assets/metadata.schema.json -${metadataJsonPath} %{WORKSPACE}/metadata.json - -*** Test Cases *** - -Send VES File Ready Event to VES Collector - [Tags] Bulk_PM_E2E_01 - [Documentation] Send VES File Ready Event - ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE} - ${headers}= Create Header From String ${HEADER_STRING} - ${resp}= Publish Event To VES Collector ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} - Sleep 15s - ${resp}= Publish Event To VES Collector ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} - Sleep 5s - ${resp}= Publish Event To VES Collector ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} - Sleep 5s - ${resp}= Publish Event To VES Collector ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} - Sleep 5s - Log Receive HTTP Status code ${resp.status_code} - Should Be Equal As Strings ${resp.status_code} 202 - -Check VES Notification Topic is existing in Message Router - [Tags] Bulk_PM_E2E_02 - [Documentation] Get the VES Notification topic on message router - [Timeout] 1 minute - Sleep 10s - ${resp}= GetCall ${TARGETURL_TOPICS} - log ${TARGETURL_TOPICS} - log 'JSON Response Code :'${resp} - ${topics}= Evaluate $resp.json().get('topics') - log ${topics} - ${ListLength}= Get Length ${topics} - log ${ListLength} - List Should Contain Value ${topics} unauthenticated.VES_NOTIFICATION_OUTPUT - -Verify Data File Collector successfully publishes the PM XML file to the Data Router - [Tags] Bulk_PM_E2E_03 - [Documentation] Check that DFC publishes the PM XML to the Data Router - ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_DFC_LOG} shell=yes - Log ${cli_cmd_output.stdout} - Should Be Equal As Strings ${cli_cmd_output.rc} 0 - ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_DFC_LOG_GREP} shell=yes - Log ${cli_cmd_output.stdout} - Should Be Equal As Strings ${cli_cmd_output.rc} 0 - Should Contain ${cli_cmd_output.stdout} Datafile file published - - -Verify Default Feed And File Consumer Subscription On Datarouter - [Tags] Bulk_PM_E2E_04 - [Documentation] Verify Default Feed And File Consumer Subscription On Datarouter - ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI} shell=yes - Log ${cli_cmd_output.stdout} - Should Be Equal As Strings ${cli_cmd_output.rc} 0 - Should Contain ${cli_cmd_output.stdout} https://dmaap-dr-prov/publish/1 - Should Contain ${cli_cmd_output.stdout} http://${DR_SUBSCIBER_IP}:7070 - - -Verify Fileconsumer Receive PM file from Data Router - [Tags] Bulk_PM_E2E_05 - [Documentation] Check PM XML file exists on the File Consumer Simulator - ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_FILECONSUMER} shell=yes - Log ${cli_cmd_output.stdout} - Should Be Equal As Strings ${cli_cmd_output.rc} 0 - Should Contain ${cli_cmd_output.stdout} A20181002.0000-1000-0015-1000_5G.xml - -Verify File Consumer Receive valid metadata from Data Router - [Tags] Bulk_PM_E2E_06 - [Documentation] Check PM XML file is delivered to the FileConsumer Simulator with valid metadata - ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_FILECONSUMER} shell=yes - Log ${cli_cmd_output.stdout} - Should Be Equal As Strings ${cli_cmd_output.rc} 0 - Should Contain ${cli_cmd_output.stdout} A20181002.0000-1000-0015-1000_5G.xml.M - ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_FILECONSUMER_CP} shell=yes - ${cli_cmd_output}= Run Process ${CLI_EXEC_RENAME_METADATA} shell=yes - ${validation_result}= Validate ${metadataSchemaPath} ${metadataJsonPath} - Should Be Equal As Strings ${validation_result} 0 - -Verify PM-Mapper successfully receives uncompressed the PM XML file - [Tags] Bulk_PM_E2E_07 - [Documentation] Check that PM-Mapper receives the uncompressed PM XML file - ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_PMMAPPER_LOG} shell=yes - Log ${cli_cmd_output.stdout} - Should Be Equal As Strings ${cli_cmd_output.rc} 0 - ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_PMMAPPER_LOG_GREP} shell=yes - Log ${cli_cmd_output.stdout} - Should Be Equal As Strings ${cli_cmd_output.rc} 0 - Should Contain ${cli_cmd_output.stdout} XML validation successful Event - -Verify PM-Mapper successfully publishes VES event the Message Router - [Tags] Bulk_PM_E2E_08 - [Documentation] Check that PM-Mapper publishes VES onto the Message Router - ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_PMMAPPER_LOG} shell=yes - Log ${cli_cmd_output.stdout} - Should Be Equal As Strings ${cli_cmd_output.rc} 0 - ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_PMMAPPER_LOG_GREP_VES} shell=yes - Should Contain ${cli_cmd_output.stdout} Successfully published VES events to messagerouter \ No newline at end of file diff --git a/tests/usecases/5G-bulkpm/__init__.robot b/tests/usecases/5G-bulkpm/__init__.robot deleted file mode 100644 index 7114fd44..00000000 --- a/tests/usecases/5G-bulkpm/__init__.robot +++ /dev/null @@ -1,2 +0,0 @@ -*** Settings *** -Documentation 5G Bulk PM E2E Testcases diff --git a/tests/usecases/5G-bulkpm/assets/json_events/FileExistNotification.json b/tests/usecases/5G-bulkpm/assets/json_events/FileExistNotification.json deleted file mode 100644 index 375dbd80..00000000 --- a/tests/usecases/5G-bulkpm/assets/json_events/FileExistNotification.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "event": { - "commonEventHeader": { - "version": "4.0.1", - "vesEventListenerVersion": "7.0.1", - "domain": "notification", - "eventName": "Noti_RnNode-Ericsson_FileReady", - "eventId": "FileReady_1797490e-10ae-4d48-9ea7-3d7d790b25e1", - "lastEpochMicrosec": 8745745764578, - "priority": "Normal", - "reportingEntityName": "otenb5309", - "sequence": 0, - "sourceName": "oteNB5309", - "startEpochMicrosec": 8745745764578, - "timeZoneOffset": "UTC+05.30" - }, - "notificationFields": { - "changeIdentifier": "PM_MEAS_FILES", - "changeType": "FileReady", - "notificationFieldsVersion": "2.0", - "arrayOfNamedHashMap": [ - { "name": "A20181002.0000-1000-0015-1000_5G.xml.gz", - "hashMap":{ - "location": "sftp://admin:admin@sftpserver:sftpport/A20181002.0000-1000-0015-1000_5G.xml.gz", - "compression": "gzip", - "fileFormatType": "org.3GPP.32.435#measCollec", - "fileFormatVersion": "V10" - } - } - ] - } -} -} \ No newline at end of file diff --git a/tests/usecases/5G-bulkpm/assets/metadata.schema.json b/tests/usecases/5G-bulkpm/assets/metadata.schema.json deleted file mode 100644 index a41b3544..00000000 --- a/tests/usecases/5G-bulkpm/assets/metadata.schema.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema", - "$id": "metadata.schema.json", - "title": "DataRouter PM File Metadata", - "description": "Metadata for 3GPP PM files that are placed on the DMaaP Data Router by the Data File Collector (VES 7.1)", - "type": "object", - - "properties": { - "productName": { - "description": "from the FileReady event eventName", - "type": "string" - }, - - "vendorName": { - "description": "from the FileReady event eventName", - "type": "string" - }, - - "lastEpochMicrosec": { - "description": "the latest unix epoch time associated with the FileReady event", - "type": "string" - }, - - "sourceName": { - "description": "the name of the entity experiencing the event", - "type": "string" - }, - - "startEpochMicrosec": { - "description": "the earliest unix epoch time associated with the FileReady event", - "type": "string" - }, - - "timeZoneOffset": { - "description": "the timezone offset from UTC", - "type": "string", - "pattern": "^(?:(?:[a-zA-Z]{3})[+-](?:[01][0-9]|2[0-3]).[0-5][0-9])$" - }, - - "location": { - "description": "follows the format ://://, the IP address is the node ip address, the port of the protocol server", - "type": "string" - }, - - "compression": { - "description": "specifies if the file is compressed", - "type": "string", - "enum": [ "gzip" ] - }, - - "fileFormatType": { - "description": "the file format", - "type": "string" - }, - - "fileFormatVersion": { - "description": "the version of the file format", - "type": "string" - } - }, - - "required": [ - "productName", - "vendorName", - "lastEpochMicrosec", - "sourceName", - "startEpochMicrosec", - "timeZoneOffset", - "location", - "compression", - "fileFormatType", - "fileFormatVersion" - ] -} diff --git a/tests/usecases/5G-bulkpm/resources/JsonValidatorLibrary.py b/tests/usecases/5G-bulkpm/resources/JsonValidatorLibrary.py deleted file mode 100644 index 12d5d856..00000000 --- a/tests/usecases/5G-bulkpm/resources/JsonValidatorLibrary.py +++ /dev/null @@ -1,38 +0,0 @@ -# -*- coding: utf-8 -*- - -import sys -import logging -from simplejson import load -from jsonschema import validate, ValidationError, SchemaError - - -class JsonValidatorLibrary(object): - - def __init__(self): - pass - - def validate(self, schemaPath, jsonPath): - logging.info("Schema path: " + schemaPath) - logging.info("JSON path: " + jsonPath) - schema = None - data = None - try: - schema = load(open(schemaPath, 'r')) - data = load(open(jsonPath, 'r')) - except (IOError, ValueError, OSError) as e: - logging.error(e.message) - return 1 - - try: - validate(data, schema) - except (ValidationError, SchemaError) as e: - logging.error(e.message) - return 1 - - # logger.log("JSON validation successful") - print("JSON validation successful") - return 0 - -if __name__ == '__main__': - lib = JsonValidatorLibrary() - # sys.exit(JsonValidatorLibrary().validate(sys.argv[1], sys.argv[2])) diff --git a/tests/usecases/5G-bulkpm/resources/bulkpm_keywords.robot b/tests/usecases/5G-bulkpm/resources/bulkpm_keywords.robot deleted file mode 100644 index 9ef56c83..00000000 --- a/tests/usecases/5G-bulkpm/resources/bulkpm_keywords.robot +++ /dev/null @@ -1,39 +0,0 @@ - *** Settings *** -Documentation The main interface for interacting with VES. It handles low level stuff like managing the http request library and VES required fields -Library RequestsLibrary -Library ../resources/xNFLibrary.py -Library ../resources/JsonValidatorLibrary.py -Library OperatingSystem -Library Collections -Library requests -Library Collections -Library String - -*** Variables *** - -*** Keywords *** - -Get Event Data From File - [Arguments] ${jsonfile} - ${data}= OperatingSystem.Get File ${jsonfile} - #Should Not Be_Equal ${data} None - [return] ${data} - -Publish Event To VES Collector - [Documentation] Send an event to VES Collector - [Arguments] ${url} ${evtpath} ${httpheaders} ${evtdata} - Log Creating session ${url} - ${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} -PostCall - [Arguments] ${url} ${data} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Evaluate requests.post('${url}',data='${data}', headers=${headers},verify=False) requests - [Return] ${resp} - -GetCall - [Arguments] ${url} - ${resp}= Evaluate requests.get('${url}') requests - [Return] ${resp} diff --git a/tests/usecases/5G-bulkpm/resources/xNFLibrary.py b/tests/usecases/5G-bulkpm/resources/xNFLibrary.py deleted file mode 100644 index 01574f77..00000000 --- a/tests/usecases/5G-bulkpm/resources/xNFLibrary.py +++ /dev/null @@ -1,25 +0,0 @@ -''' -Created on Aug 18, 2017 - -@author: sw6830 -''' -from robot.api import logger -from Queue import Queue -import uuid, time, json, threading,os, platform, subprocess,paramiko - -class xNFLibrary(object): - - def __init__(self): - pass - - def create_header_from_string(self, dictStr): - logger.info("Enter create_header_from_string: dictStr") - return dict(u.split("=") for u in dictStr.split(",")) - - def Generate_UUID(self): - """generate a uuid""" - return uuid.uuid4() - -if __name__ == '__main__': - lib = xNFLibrary() - time.sleep(100000) \ No newline at end of file diff --git a/tests/usecases/config-over-netconf/__init__.robot b/tests/usecases/config-over-netconf/__init__.robot deleted file mode 100644 index 614d5c17..00000000 --- a/tests/usecases/config-over-netconf/__init__.robot +++ /dev/null @@ -1,2 +0,0 @@ -1 *** Settings *** -2 Documentation PNF - config-over-netconf diff --git a/tests/usecases/config-over-netconf/config_over_netconf.robot b/tests/usecases/config-over-netconf/config_over_netconf.robot deleted file mode 100644 index 2ba64007..00000000 --- a/tests/usecases/config-over-netconf/config_over_netconf.robot +++ /dev/null @@ -1,69 +0,0 @@ -*** 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/pnf-simulator -${PNFSIM_MOUNT_PATH} /config/network-topology:network-topology/topology/topology-netconf/node/pnf-simulator/yang-ext:mount/mynetconf:netconflist -${BP_UPLOAD_URL} /api/v1/execution-service/upload -${BP_PROCESS_URL} /api/v1/execution-service/process -${BP_ARCHIVE_PATH} ${CURDIR}/data/blueprint_archive.zip - - - *** 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 BP-PROC upload blueprint archive - [Documentation] Upload Blueprint archive to BP processor - Create Session blueprint http://localhost:8000 - ${bp_archive}= Get Binary File ${BP_ARCHIVE_PATH} - &{bp_file}= create Dictionary file ${bp_archive} - &{headers}= Create Dictionary Authorization=Basic Y2NzZGthcHBzOmNjc2RrYXBwcw== - ${resp}= Post Request blueprint ${BP_UPLOAD_URL} files=${bp_file} headers=${headers} - Should Be Equal As Strings ${resp.status_code} 200 - - Test BP-PROC CONFIG-ASSIGN - [Documentation] Send config-assign request to BP-Proc - Create Session blueprint http://localhost:8000 - ${config-assign}= Get File ${CURDIR}${/}data${/}config-assign.json - Log to console ${config-assign} - &{headers}= Create Dictionary Authorization=Basic Y2NzZGthcHBzOmNjc2RrYXBwcw== Content-Type=application/json Accept=application/json - ${resp}= Post Request blueprint ${BP_PROCESS_URL} data=${config-assign} headers=${headers} - Should Be Equal As Strings ${resp.status_code} 200 - - Test BP-PROC CONFIG-DEPLOY - [Documentation] Send config-deploy request to BP-Proc - Create Session blueprint http://localhost:8000 - ${config-deploy}= Get File ${CURDIR}${/}data${/}config-deploy.json - Log to console ${config-deploy} - &{headers}= Create Dictionary Authorization=Basic Y2NzZGthcHBzOmNjc2RrYXBwcw== Content-Type=application/json Accept=application/json - ${resp}= Post Request blueprint ${BP_PROCESS_URL} data=${config-deploy} headers=${headers} - Should Be Equal As Strings ${resp.status_code} 200 - - Test PNF Configuration update - [Documentation] Checking PNF configuration params - 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 10 - &{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.text} {"netconf-id":30,"netconf-param":3000} diff --git a/tests/usecases/config-over-netconf/data/blueprint_archive.zip b/tests/usecases/config-over-netconf/data/blueprint_archive.zip deleted file mode 100644 index ac346554..00000000 Binary files a/tests/usecases/config-over-netconf/data/blueprint_archive.zip and /dev/null differ diff --git a/tests/usecases/config-over-netconf/data/config-assign.json b/tests/usecases/config-over-netconf/data/config-assign.json deleted file mode 100644 index 12c3865f..00000000 --- a/tests/usecases/config-over-netconf/data/config-assign.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "actionIdentifiers": { - "actionName": "config-assign", - "blueprintName": "configuration_over_restconf", - "blueprintVersion": "1.0.0", - "mode": "sync" - }, - "commonHeader": { - "originatorId": "sdnc", - "requestId": "123456-1000", - "subRequestId": "sub-123456-1000" - }, - "payload": { - "config-assign-request": { - "resolution-key": "RES-KEY reskey", - "config-assign-properties": { - "service-instance-id": "siid_1234", - "pnf-id": "pnf-simulator", - "pnf-ipv4-address": "pnfaddr", - "service-model-uuid": "service-model-uuid", - "pnf-customization-uuid": "pnf-customization-uuid" - } - } - } -} diff --git a/tests/usecases/config-over-netconf/data/config-deploy.json b/tests/usecases/config-over-netconf/data/config-deploy.json deleted file mode 100644 index 546fdc78..00000000 --- a/tests/usecases/config-over-netconf/data/config-deploy.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "actionIdentifiers": { - "actionName": "config-deploy", - "blueprintName": "configuration_over_restconf", - "blueprintVersion": "1.0.0", - "mode": "sync" - }, - "commonHeader": { - "originatorId": "sdnc", - "requestId": "123456-1000", - "subRequestId": "sub-123456-1000" - }, - "payload": { - "config-deploy-request": { - "resolution-key": "RES-KEY reskey", - "config-deploy-properties": { - "service-instance-id": "siid_1234", - "pnf-id": "pnf-simulator", - "pnf-ipv4-address": "pnfaddr", - "service-model-uuid": "service-model-uuid", - "pnf-customization-uuid": "pnf-customization-uuid" - } - } - } -} diff --git a/tests/usecases/config-over-netconf/data/mount.xml b/tests/usecases/config-over-netconf/data/mount.xml deleted file mode 100644 index 22053e8a..00000000 --- a/tests/usecases/config-over-netconf/data/mount.xml +++ /dev/null @@ -1,14 +0,0 @@ - - pnf-simulator - - ODL_private_key_0 - netconf - - pnfaddr - 6513 - false - - TLS - - 2 - diff --git a/tests/usecases/pnf-sw-upgrade/.gitignore b/tests/usecases/pnf-sw-upgrade/.gitignore deleted file mode 100755 index 44793d73..00000000 --- a/tests/usecases/pnf-sw-upgrade/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -target -**/.settings -**/.classpath -**/.project -**/.buildpath -**/.factorypath -**/.springBeans -.idea -.checkstyle -.DS_Store -.*~ -*.iml -*.class -*.swp -*.log -*.tmp -**/bin/ -/.metadata/ -temp/ -**/temp/** -test_lab/ -**/test_lab/** diff --git a/tests/usecases/pnf-sw-upgrade/__init__.robot b/tests/usecases/pnf-sw-upgrade/__init__.robot deleted file mode 100644 index a721a88f..00000000 --- a/tests/usecases/pnf-sw-upgrade/__init__.robot +++ /dev/null @@ -1,2 +0,0 @@ -1 *** Settings *** -2 Documentation PNF - pnf-sw-upgrade diff --git a/tests/usecases/pnf-sw-upgrade/data/blueprint_archive.zip b/tests/usecases/pnf-sw-upgrade/data/blueprint_archive.zip deleted file mode 100644 index 4edc9ded..00000000 Binary files a/tests/usecases/pnf-sw-upgrade/data/blueprint_archive.zip and /dev/null differ diff --git a/tests/usecases/pnf-sw-upgrade/data/distributeServiceTemplate.json b/tests/usecases/pnf-sw-upgrade/data/distributeServiceTemplate.json deleted file mode 100644 index c13eb8d5..00000000 --- a/tests/usecases/pnf-sw-upgrade/data/distributeServiceTemplate.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "distributionID": "05fd08d8-c452-429a-a1ad-806c8d05e7c8", - "serviceName": "Demo_svc", - "serviceVersion": "1.0", - "serviceUUID": "cd4decf6-4f27-4775-9561-0e683ed43635", - "serviceDescription": "aaaa", - "serviceInvariantUUID": "fe41489e-1563-46a3-b90a-1db629e4375b", - "resources": [ - { - "resourceInstanceName": "Demo_pnf 0", - "resourceCustomizationUUID": "36b46817-2eaf-41b3-bfa3-11a7e0fd9bb2", - "resourceName": "Demo_pnf", - "resourceVersion": "1.0", - "resoucreType": "PNF", - "resourceUUID": "a42f6566-6a29-43e1-bac9-b91a59d702ac", - "resourceInvariantUUID": "fdf44827-35db-4ee5-bd70-7500e633576e", - "category": "Network L4+", - "subcategory": "Common Network Resources", - "artifacts": [] - } - ], - "serviceArtifacts": [ - { - "artifactName": "service-DemoSvc-csar.csar", - "artifactType": "TOSCA_CSAR", - "artifactURL": "//unzipped_sdc_csar/v1/catalog/services/DemoSvc/1.0/artifacts/service-DemoSvc-csar.csar", - "artifactChecksum": "Njk4NDM4YTdjYmM4NWFkN2M1YWZiM2IzYzdmNWZjZTU\u003d", - "artifactDescription": "TOSCA definition package of the asset", - "artifactTimeout": 0, - "artifactVersion": "1", - "artifactUUID": "e2640671-a5ed-40a6-b231-8f33084b1c1a" - } - ], - "workloadContext": "Production" - } \ No newline at end of file diff --git a/tests/usecases/pnf-sw-upgrade/data/mount.json b/tests/usecases/pnf-sw-upgrade/data/mount.json deleted file mode 100755 index 58925b1a..00000000 --- a/tests/usecases/pnf-sw-upgrade/data/mount.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "node": [ - { - "node-id": "PNFDemo", - "netconf-node-topology:protocol": { - "name": "TLS" - }, - "netconf-node-topology:host": "pnfaddr", - "netconf-node-topology:key-based": { - "username": "netconf", - "key-id": "ODL_private_key_0" - }, - "netconf-node-topology:port": 6513, - "netconf-node-topology:tcp-only": false, - "netconf-node-topology:max-connection-attempts": 5 - } - ] -} \ No newline at end of file diff --git a/tests/usecases/pnf-sw-upgrade/data/serviceInstantiationActivationRequest.json b/tests/usecases/pnf-sw-upgrade/data/serviceInstantiationActivationRequest.json deleted file mode 100644 index a25ebfda..00000000 --- a/tests/usecases/pnf-sw-upgrade/data/serviceInstantiationActivationRequest.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "requestDetails":{ - "requestInfo":{ - "source":"VID", - "suppressRollback":false, - "requestorId":"demo" - }, - "modelInfo":{ - "modelType":"service", - "modelInvariantUuid":"fe41489e-1563-46a3-b90a-1db629e4375b", - "modelInvariantId" : "fe41489e-1563-46a3-b90a-1db629e4375b", - "modelUuid":"cd4decf6-4f27-4775-9561-0e683ed43635", - "modelVersionId" : "cd4decf6-4f27-4775-9561-0e683ed43635", - "modelName":"Demo_svc", - "modelVersion":"1.0" - }, - "requestParameters":{ - "userParams":[ - { - "name":"targetSoftwareVersion", - "value":"pnf_sw_version-3.0.0" - }, - { - "name":"pnfName", - "value":"PNFDemo" - } - ], - "subscriptionServiceType":"vCPE", - "aLaCarte":false - - }, - "subscriberInfo": { - "globalSubscriberId": "DemoCustomer" - }, - "project": { - "projectName": "pnfSWUProject" - }, - "owningEntity": { - "owningEntityId": "f2e1071e-3d47-4a65-94d4-e473ec03326a", - "owningEntityName": "OE-Demonstration" - } - } - } \ No newline at end of file diff --git a/tests/usecases/pnf-sw-upgrade/data/serviceInstantiationDownloadRequest.json b/tests/usecases/pnf-sw-upgrade/data/serviceInstantiationDownloadRequest.json deleted file mode 100644 index 0042ac26..00000000 --- a/tests/usecases/pnf-sw-upgrade/data/serviceInstantiationDownloadRequest.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "requestDetails":{ - "requestInfo":{ - "source":"VID", - "suppressRollback":false, - "requestorId":"demo" - }, - "modelInfo":{ - "modelType":"service", - "modelInvariantUuid":"fe41489e-1563-46a3-b90a-1db629e4375b", - "modelInvariantId" : "fe41489e-1563-46a3-b90a-1db629e4375b", - "modelUuid":"cd4decf6-4f27-4775-9561-0e683ed43635", - "modelVersionId" : "cd4decf6-4f27-4775-9561-0e683ed43635", - "modelName":"Demo_svc", - "modelVersion":"1.0" - }, - "requestParameters":{ - "userParams":[ - { - "name":"targetSoftwareVersion", - "value":"pnf_sw_version-2.0.0" - }, - { - "name":"pnfName", - "value":"PNFDemo" - } - ], - "subscriptionServiceType":"vCPE", - "aLaCarte":false - - }, - "subscriberInfo": { - "globalSubscriberId": "DemoCustomer" - }, - "project": { - "projectName": "pnfSWUProject" - }, - "owningEntity": { - "owningEntityId": "f2e1071e-3d47-4a65-94d4-e473ec03326a", - "owningEntityName": "OE-Demonstration" - } - } - } \ No newline at end of file diff --git a/tests/usecases/pnf-sw-upgrade/pnf-sw-upgrade.robot b/tests/usecases/pnf-sw-upgrade/pnf-sw-upgrade.robot deleted file mode 100644 index 70408366..00000000 --- a/tests/usecases/pnf-sw-upgrade/pnf-sw-upgrade.robot +++ /dev/null @@ -1,202 +0,0 @@ -*** Settings *** -Library Collections -Library RequestsLibrary -Library OperatingSystem -Library json -Library String - -*** Variables *** -${SDNC_KEYSTORE_CONFIG_PATH} /restconf/config/netconf-keystore:keystore -${SDNC_MOUNT_PATH} /restconf/config/network-topology:network-topology/topology/topology-netconf/node/PNFDemo -${PNFSIM_MOUNT_PATH} /restconf/config/network-topology:network-topology/topology/topology-netconf/node/PNFDemo/yang-ext:mount/pnf-sw-upgrade:software-upgrade -${PNFSIM_DELETE_PATH} /restconf/config/network-topology:network-topology/topology/topology-netconf/node/PNFDemo -${BP_UPLOAD_URL} /api/v1/blueprint-model/publish -${BP_PROCESS_URL} /api/v1/execution-service/process -${BP_ARCHIVE_PATH} ${CURDIR}/data/blueprint_archive.zip -${SLEEP_INTERVAL_SEC}= 5 -${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT}= 20 - - -*** Test Cases *** -Test SDNC Keystore - [Documentation] Checking keystore after SDNC installation - Create Session sdnc http://${REPO_IP}:8282 - &{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 BP-PROC upload blueprint archive - [Documentation] Upload Blueprint archive to BP processor - Create Session blueprint http://${REPO_IP}:8000 - ${bp_archive}= Get Binary File ${BP_ARCHIVE_PATH} - &{bp_file}= create Dictionary file ${bp_archive} - &{headers}= Create Dictionary Authorization=Basic Y2NzZGthcHBzOmNjc2RrYXBwcw== - ${resp}= Post Request blueprint ${BP_UPLOAD_URL} files=${bp_file} headers=${headers} - Should Be Equal As Strings ${resp.status_code} 200 - -Distribute Service Template - Create Session sdc_controller_session http://${REPO_IP}:8085 - ${data}= Get Binary File ${CURDIR}${/}data${/}distributeServiceTemplate.json - &{headers}= Create Dictionary Authorization=Basic bXNvX2FkbWluOnBhc3N3b3JkMSQ= resource-location=/app/distribution-test-zip/unzipped/ Content-Type=application/json Accept=application/json - ${resp}= Post Request sdc_controller_session /test/treatNotification/v1 data=${data} headers=${headers} - Run Keyword If '${resp.status_code}' == '200' log to console \nexecuted with expected result - Should Be Equal As Strings '${resp.status_code}' '200' - ${serviceInstanceId}= Set Variable cd4decf6-4f27-4775-9561-0e683ed43635 - SET GLOBAL VARIABLE ${serviceInstanceId} - ${pnfName}= Set Variable PNFDemo - SET GLOBAL VARIABLE ${pnfName} - -Get pnf workflow - Create Session api_handler_session http://${REPO_IP}:8080 - &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json - ${get_pnfworkflows_request}= Get Request api_handler_session /onap/so/infra/workflowSpecifications/v1/pnfWorkflows headers=${headers} - Run Keyword If '${get_pnfworkflows_request.status_code}' == '200' log to console \nexecuted with expected result - log to console ${get_pnfworkflows_request.content} - ${pnfworkflows_json_response}= Evaluate json.loads(r"""${get_pnfworkflows_request.content}""", strict=False) json - ${all_wf_members}= Set Variable ${pnfworkflows_json_response['workflowSpecificationList']} - ${activate_workflow_uuid}= Set Variable "" - ${activate_workflow_name}= Set Variable "" - ${download_workflow_uuid}= Set Variable "" - ${download_workflow_name}= Set Variable "" - - :FOR ${member} IN @{all_wf_members} - \ ${workflow_uuid}= Set Variable ${member}[workflowSpecification][artifactInfo][artifactUuid] - \ ${workflow_name}= Set Variable ${member}[workflowSpecification][artifactInfo][artifactName] - \ Log to console The workflow ${workflow_name} has uuid : ${workflow_uuid} - \ ${activate_workflow_uuid}= Set Variable If '${workflow_name}' == 'PNFSoftwareUpgrade' ${workflow_uuid} ${activate_workflow_uuid} - \ ${activate_workflow_name}= Set Variable If '${workflow_name}' == 'PNFSoftwareUpgrade' ${workflow_name} ${activate_workflow_name} - \ ${download_workflow_uuid}= Set Variable If '${workflow_name}' == 'PNFSWUPDownload' ${workflow_uuid} ${download_workflow_uuid} - \ ${download_workflow_name}= Set Variable If '${workflow_name}' == 'PNFSWUPDownload' ${workflow_name} ${download_workflow_name} - - SET GLOBAL VARIABLE ${activate_workflow_uuid} - SET GLOBAL VARIABLE ${download_workflow_uuid} - - Run Keyword If '${activate_workflow_name}' == 'PNFSoftwareUpgrade' log to console \nexecuted with expected result - Run Keyword If '${download_workflow_name}' == 'PNFSWUPDownload' log to console \nexecuted with expected result - Should Be Equal As Strings '${activate_workflow_name}' 'PNFSoftwareUpgrade' - Should Be Equal As Strings '${download_workflow_name}' 'PNFSWUPDownload' - -Invoke Service Instantiation for pnf software download - Create Session api_handler_session http://${REPO_IP}:8080 - ${data}= Get Binary File ${CURDIR}${/}data${/}serviceInstantiationDownloadRequest.json - &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json X-ONAP-RequestID=0ddc448d-5513-44bc-8b02-5759d84600d5 X-ONAP-PartnerName=ONAP X-RequestorID=VID - ${service_instantiation_request}= Post Request api_handler_session /onap/so/infra/instanceManagement/v1/serviceInstances/${serviceInstanceId}/pnfs/${pnfName}/workflows/${download_workflow_uuid} data=${data} headers=${headers} - Run Keyword If '${service_instantiation_request.status_code}' == '200' log to console \nexecuted with expected result - log to console ${service_instantiation_request.content} - ${service_instantiation_json_response}= Evaluate json.loads(r"""${service_instantiation_request.content}""", strict=False) json - ${request_ID}= Set Variable ${service_instantiation_json_response}[requestReferences][requestId] - ${actual_request_state}= Set Variable "" - - : FOR ${INDEX} IN RANGE ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT} - \ ${orchestration_status_request}= Get Request api_handler_session /onap/so/infra/orchestrationRequests/v7/${request_ID} - \ Run Keyword If '${orchestration_status_request.status_code}' == '200' log to console \nexecuted with expected result - \ log to console ${orchestration_status_request.content} - \ ${orchestration_json_response}= Evaluate json.loads(r"""${orchestration_status_request.content}""", strict=False) json - \ ${actual_request_state}= SET VARIABLE ${orchestration_json_response}[request][requestStatus][requestState] - \ Log To Console Received actual repsonse status:${actual_request_state} - \ RUN KEYWORD IF '${actual_request_state}' == 'COMPLETED' or '${actual_request_state}' == 'FAILED' Exit For Loop - \ log to console Will try again after ${SLEEP_INTERVAL_SEC} seconds - \ SLEEP ${SLEEP_INTERVAL_SEC}s - - Log To Console final repsonse status received: ${actual_request_state} - Run Keyword If '${actual_request_state}' == 'COMPLETED' log to console \nexecuted with expected result - Should Be Equal As Strings '${actual_request_state}' 'COMPLETED' - -Test verify PNF Configuration for software download - [Documentation] Checking PNF configuration params - - Create Session sdnc http://${REPO_IP}:8282 - &{headers}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/json - ${mount}= Get File ${CURDIR}${/}data${/}mount.json - Log to console ${mount} - ${pnf_mount_resp}= Put Request sdnc ${SDNC_MOUNT_PATH} data=${mount} headers=${headers} - Should Be Equal As Strings ${pnf_mount_resp.status_code} 201 - SLEEP 10 - ${pnfsim_software_resp}= Get Request sdnc ${PNFSIM_MOUNT_PATH} headers=${headers} - Should Be Equal As Strings ${pnfsim_software_resp.status_code} 200 - Log to console ${pnfsim_software_resp.content} - ${pnfsim_software_resp_json}= Evaluate json.loads(r"""${pnfsim_software_resp.content}""", strict=False) json - ${all_upgp_members}= Set Variable ${pnfsim_software_resp_json['software-upgrade']['upgrade-package']} - - :FOR ${member} IN @{all_upgp_members} - \ ${soft_ver}= Get From Dictionary ${member} software-version - \ ${soft_status}= Get From Dictionary ${member} current-status - \ Log to console The node ${pnfName} has software version ${soft_ver} : ${soft_status} - \ Run Keyword If '${soft_ver}' == 'pnf_sw_version-2.0.0' Exit For Loop - - Run Keyword If '${soft_ver}' == 'pnf_sw_version-2.0.0' log to console \nexecuted with expected result - Should Be Equal As Strings '${soft_ver}' 'pnf_sw_version-2.0.0' - Should Be Equal As Strings '${soft_status}' 'DOWNLOAD_COMPLETED' - -Invoke Service Instantiation for pnf software activation - Create Session api_handler_session http://${REPO_IP}:8080 - ${data}= Get Binary File ${CURDIR}${/}data${/}serviceInstantiationActivationRequest.json - &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json X-ONAP-RequestID=4e104e12-5539-4557-b31e-00369398c214 X-ONAP-PartnerName=ONAP X-RequestorID=VID - ${service_instantiation_request}= Post Request api_handler_session /onap/so/infra/instanceManagement/v1/serviceInstances/${serviceInstanceId}/pnfs/${pnfName}/workflows/${activate_workflow_uuid} data=${data} headers=${headers} - Run Keyword If '${service_instantiation_request.status_code}' == '200' log to console \nexecuted with expected result - log to console ${service_instantiation_request.content} - ${service_instantiation_json_response}= Evaluate json.loads(r"""${service_instantiation_request.content}""", strict=False) json - ${request_ID}= Set Variable ${service_instantiation_json_response}[requestReferences][requestId] - ${actual_request_state}= Set Variable "" - : FOR ${INDEX} IN RANGE ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT} - \ ${orchestration_status_request}= Get Request api_handler_session /onap/so/infra/orchestrationRequests/v7/${request_ID} - \ Run Keyword If '${orchestration_status_request.status_code}' == '200' log to console \nexecuted with expected result - \ log to console ${orchestration_status_request.content} - \ ${orchestration_json_response}= Evaluate json.loads(r"""${orchestration_status_request.content}""", strict=False) json - \ ${actual_request_state}= SET VARIABLE ${orchestration_json_response}[request][requestStatus][requestState] - \ Log To Console Received actual repsonse status:${actual_request_state} - \ RUN KEYWORD IF '${actual_request_state}' == 'COMPLETED' or '${actual_request_state}' == 'FAILED' Exit For Loop - \ log to console Will try again after ${SLEEP_INTERVAL_SEC} seconds - \ SLEEP ${SLEEP_INTERVAL_SEC}s - - Log To Console final repsonse status received: ${actual_request_state} - Run Keyword If '${actual_request_state}' == 'COMPLETED' log to console \nexecuted with expected result - Should Be Equal As Strings '${actual_request_state}' 'COMPLETED' - -Test verify PNF Configuration for software activate - [Documentation] Checking PNF configuration params - - Create Session sdnc http://${REPO_IP}:8282 - &{headers}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/json - ${mount}= Get File ${CURDIR}${/}data${/}mount.json - Log to console ${mount} - ${pnf_mount_resp}= Put Request sdnc ${SDNC_MOUNT_PATH} data=${mount} headers=${headers} - Should Be Equal As Strings ${pnf_mount_resp.status_code} 201 - SLEEP 10 - ${pnfsim_software_resp}= Get Request sdnc ${PNFSIM_MOUNT_PATH} headers=${headers} - Should Be Equal As Strings ${pnfsim_software_resp.status_code} 200 - Log to console ${pnfsim_software_resp.content} - ${pnfsim_software_resp_json}= Evaluate json.loads(r"""${pnfsim_software_resp.content}""", strict=False) json - ${all_upgp_members}= Set Variable ${pnfsim_software_resp_json['software-upgrade']['upgrade-package']} - - :FOR ${member} IN @{all_upgp_members} - \ ${soft_ver}= Get From Dictionary ${member} software-version - \ ${soft_status}= Get From Dictionary ${member} current-status - \ Log to console The node ${pnfName} has software version ${soft_ver} : ${soft_status} - \ Run Keyword If '${soft_ver}' == 'pnf_sw_version-3.0.0' Exit For Loop - - Run Keyword If '${soft_ver}' == 'pnf_sw_version-3.0.0' log to console \nexecuted with expected result - Should Be Equal As Strings '${soft_ver}' 'pnf_sw_version-3.0.0' - Should Be Equal As Strings '${soft_status}' 'ACTIVATION_COMPLETED' - -Test AAI-update for target software version verify - Create Session aai_simulator_session https://${REPO_IP}:9993 - &{headers}= Create Dictionary Authorization=Basic YWFpOmFhaS5vbmFwLm9yZzpkZW1vMTIzNDU2IQ== Content-Type=application/json Accept=application/json verify=False - : FOR ${INDEX} IN RANGE ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT} - \ ${get_pnf_request}= Get Request aai_simulator_session aai/v11/network/pnfs/pnf/${pnfName} headers=${headers} - \ Run Keyword If '${get_pnf_request.status_code}' == '200' log to console \nexecuted with expected result - \ ${get_pnf_json_response}= Evaluate json.loads(r"""${get_pnf_request.content}""", strict=False) json - \ Log to console ${get_pnf_json_response} - \ ${sw_version}= Set Variable ${get_pnf_json_response}[sw-version] - \ Log to console ${sw_version} - \ Run Keyword If '${sw_version}' == 'pnf_sw_version-3.0.0' Exit For Loop - \ log to console Will try again after ${SLEEP_INTERVAL_SEC} seconds - \ SLEEP ${SLEEP_INTERVAL_SEC}s - - Log To Console final target software version received: ${sw_version} - Run Keyword If '${sw_version}' == 'pnf_sw_version-3.0.0' log to console \nexecuted with expected result - Should Be Equal As Strings '${sw_version}' 'pnf_sw_version-3.0.0' -- cgit 1.2.3-korg