aboutsummaryrefslogtreecommitdiffstats
path: root/robot/resources/sdnc_interface.robot
diff options
context:
space:
mode:
authorstark, steven <steven.stark@att.com>2019-08-28 16:11:53 -0700
committerDaniel Rose <dr695h@att.com>2019-09-12 21:58:03 +0000
commitea4af0caf0a786b9b8d05dc3d2749f965050f398 (patch)
tree07e8ecd1557a35e564cd35db2296bb3b3f397bd0 /robot/resources/sdnc_interface.robot
parent956f45b32feb53a8da60025ca1ea3980ddf49bbe (diff)
[INT] Add testsuite for vnf lifecycle validation
The new testsuite is intended for heat-based VNFs going through the OPNFV VNF lifecycle validation. At the end of the test it will package up the results into a tarball for submission to the OVP portal. The testcase uploads a VNF pacakge and - executes the VVP validation scripts - models and distributes in SDC - instantiates via VID - validates the stack in OpenStack WIP instructions available here: https://wiki.onap.org/pages/viewpage.action?pageId=68546123 Issue-ID: INT-1197 Change-Id: I2ef827c64b64bdc7e2259806d86d6272cf77221c Signed-off-by: stark, steven <steven.stark@att.com>
Diffstat (limited to 'robot/resources/sdnc_interface.robot')
-rw-r--r--robot/resources/sdnc_interface.robot41
1 files changed, 41 insertions, 0 deletions
diff --git a/robot/resources/sdnc_interface.robot b/robot/resources/sdnc_interface.robot
index 198e364d..9b56fef4 100644
--- a/robot/resources/sdnc_interface.robot
+++ b/robot/resources/sdnc_interface.robot
@@ -234,3 +234,44 @@ Login To SDNC Admin GUI
Click Button xpath=//button[@type='submit']
Title Should Be SDN-C AdminPortal
Log Logged in to ${SDNC_ADMIN_LOGIN_URL}
+
+Create Preload From JSON
+ [Documentation] Fill vf-module parameters in an already created preload json file.
+ [Arguments] ${preload_file} ${api_type} ${vf_module_name} ${vf_module_type} ${vnf_name} ${generic_vnf_type}
+ Log To Console Uploading ${preload_file} to SDNC
+
+ ${preload_vnf}= Run keyword if "${api_type}"=="gr_api"
+ ... Preload GR API ${vf_module_name} ${vf_module_type} ${vnf_name} ${generic_vnf_type} ${preload_file}
+ ... ELSE
+ ... Preload VNF API ${vf_module_name} ${vf_module_type} ${vnf_name} ${generic_vnf_type} ${preload_file}
+
+ ${uri}= Set Variable If "${api_type}"=="gr_api" ${SDNC_INDEX_PATH}${PRELOAD_GR_TOPOLOGY_OPERATION_PATH} ${SDNC_INDEX_PATH}${PRELOAD_VNF_TOPOLOGY_OPERATION_PATH}
+
+ ${post_resp}= SDNC.Run Post Request ${SDNC_REST_ENDPOINT} ${uri} data=${preload_vnf} auth=${GLOBAL_SDNC_AUTHENTICATION}
+ Should Be Equal As Strings ${post_resp.json()['output']['response-code']} 200
+ [Return] ${post_resp}
+
+Preload GR API
+ [Documentation] Retrieves a preload JSON file and fills in service instance values.
+ [Arguments] ${vnf_name} ${vnf_type} ${generic_vnf_name} ${generic_vnf_type} ${preload_path}
+
+ ${json}= OperatingSystem.Get File ${preload_path}
+ ${object}= Evaluate json.loads('''${json}''') json
+ ${req_dict} Create Dictionary vnf-name=${generic_vnf_name} vnf-type=${generic_vnf_type}
+ set to dictionary ${object["input"]["preload-vf-module-topology-information"]} vnf-topology-identifier-structure=${req_dict}
+ ${req_dict_new} Create Dictionary vf-module-name=${vnf_name}
+ set to dictionary ${object["input"]["preload-vf-module-topology-information"]["vf-module-topology"]} vf-module-topology-identifier=${req_dict_new}
+ ${req_json} Evaluate json.dumps(${object}) json
+ [Return] ${req_json}
+
+Preload VNF API
+ [Documentation] Retrieves a preload JSON file and fills in service instance values.
+ [Arguments] ${vnf_name} ${vnf_type} ${generic_vnf_name} ${generic_vnf_type} ${preload_path}
+
+ ${json}= OperatingSystem.Get File ${preload_path}
+ ${object}= Evaluate json.loads('''${json}''') json
+ ${req_dict} Create Dictionary vnf-name=${vnf_name} vnf-type=${vnf_type} generic-vnf-type=${generic_vnf_type} generic-vnf-name=${generic_vnf_name}
+ set to dictionary ${object["input"]["vnf-topology-information"]} vnf-topology-identifier=${req_dict}
+
+ ${req_json} Evaluate json.dumps(${object}) json
+ [Return] ${req_json}