summaryrefslogtreecommitdiffstats
path: root/robot/resources/vvp_validation.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/vvp_validation.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/vvp_validation.robot')
-rw-r--r--robot/resources/vvp_validation.robot49
1 files changed, 49 insertions, 0 deletions
diff --git a/robot/resources/vvp_validation.robot b/robot/resources/vvp_validation.robot
new file mode 100644
index 00000000..de4ba69a
--- /dev/null
+++ b/robot/resources/vvp_validation.robot
@@ -0,0 +1,49 @@
+*** Settings ***
+Documentation The main interface for interacting with SDC. It handles low level stuff like managing the http request library and DCAE required fields
+Library OperatingSystem
+Library ONAPLibrary.SO WITH NAME SO
+Library ONAPLibrary.HeatVNFValidation WITH NAME HeatVNFValidation
+Library ONAPLibrary.VVPValidation WITH NAME VVPValidation
+
+*** Variables ***
+${CLOUD_CONFIG_PATH} /cloudSite
+
+*** Keywords ***
+Run VVP Validation Scripts
+ [Documentation] Creates virtualenv and clones VVP scripts to build_dir, executes VVP validation scripts against a template directory, results stored in output directory.
+ [Arguments] ${build_dir} ${heat_template_directory} ${output_directory}
+
+ VVPValidation.validate ${build_dir} ${heat_template_directory} ${output_directory}
+
+Run VNF Instantiation Report
+ [Documentation] Validates that a stack was created correctly, used for OVP portal submission.
+ [Arguments] ${region_id} ${vnf_details} ${os_password} ${vnf_name}
+ ${auth}= Create List ${GLOBAL_SO_CATDB_USERNAME} ${GLOBAL_SO_PASSWORD}
+ ${get_resp}= SO.Run Get Request ${GLOBAL_SO_CATDB_ENDPOINT} ${CLOUD_CONFIG_PATH}/${region_id} auth=${auth}
+
+ ${object}= Evaluate json.loads('''${get_resp.text}''') json
+ ${auth_url} = Set Variable ${object["identityService"]["identity_url"]}
+ ${user_id} = Set Variable ${object["identityService"]["mso_id"]}
+ ${region_id} = Set Variable ${object["region_id"]}
+ ${tenant_id} = Set Variable ${object["identityService"]["admin_tenant"]}
+ ${identity_server_type}= Set Variable ${object["identityService"]["identity_server_type"]}
+ ${identity_server_type}= Set Variable If '${identity_server_type}' == 'KEYSTONE_V3' v3 v2.0
+
+ Set Global Variable ${GLOBAL_INJECTED_OPENSTACK_KEYSTONE_API_VERSION} ${identity_server_type}
+ Set Global Variable ${GLOBAL_INJECTED_KEYSTONE} ${auth_url}
+ Set Global Variable ${GLOBAL_INJECTED_OPENSTACK_PROJECT_NAME} ${tenant_id}
+
+ Run Openstack Auth Request mytest username=${user_id} password=${os_password}
+
+ ${token}= Get Openstack Token mytest
+ ${orchestration_url}= Get Openstack Service Url mytest orchestration
+
+ ${report}= HeatVNFValidation.validate ${orchestration_url} ${token} ${vnf_details} ${vnf_name}
+
+ ${status}= Get From Dictionary ${report} summary
+
+ ${json_string}= evaluate json.dumps(${report}, indent=4) json
+ OperatingSystem.Create File ${OUTPUTDIR}/summary/stack_report.json content=${json_string}
+
+ Run Keyword If '${status}' == 'FAILED' Fail Stack Validation Failed
+ [Return] ${report}