From ea4af0caf0a786b9b8d05dc3d2749f965050f398 Mon Sep 17 00:00:00 2001 From: "stark, steven" Date: Wed, 28 Aug 2019 16:11:53 -0700 Subject: [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 --- robot/resources/vvp_validation.robot | 49 ++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 robot/resources/vvp_validation.robot (limited to 'robot/resources/vvp_validation.robot') 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} -- cgit 1.2.3-korg