From b2a4951b485eeec49366bc58862aa253b2ccc8e7 Mon Sep 17 00:00:00 2001 From: bdfreeman1421 Date: Sun, 25 Nov 2018 07:32:19 -0500 Subject: Add vCPEResCust Model onboarding Issue-ID: INT-601 Change-Id: I543959a06be9b0a759d6102bcf1352e80b7d5a30 Signed-off-by: bdfreeman1421 --- .../model_test_template_vcperescust.robot | 63 ++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 robot/resources/test_templates/model_test_template_vcperescust.robot (limited to 'robot/resources/test_templates') diff --git a/robot/resources/test_templates/model_test_template_vcperescust.robot b/robot/resources/test_templates/model_test_template_vcperescust.robot new file mode 100644 index 00000000..127decbe --- /dev/null +++ b/robot/resources/test_templates/model_test_template_vcperescust.robot @@ -0,0 +1,63 @@ +*** Settings *** +Documentation The main interface for interacting with ASDC. It handles low level stuff like managing the http request library and DCAE required fields +Library OperatingSystem +Library ArchiveLibrary +Library Collections +Library String +Library DateTime +Resource ../asdc_interface.robot + +Variables ../../assets/service_mappings.py + +*** Variables *** +${ASDC_BASE_PATH} /sdc1 +${ASDC_DESIGNER_PATH} /proxy-designer1#/dashboard +${ASDC_ASSETS_DIRECTORY} ${GLOBAL_HEAT_TEMPLATES_FOLDER} +${ASDC_ZIP_DIRECTORY} ${ASDC_ASSETS_DIRECTORY}/temp + +#***************** Test Case Variables ********************* +${CATALOG_RESOURCE_IDS} +${CATALOG_SERVICE_ID} + +*** Keywords *** + +Model Distribution For vCPEResCust Directory + [Arguments] ${service} ${catalog_service_name}= ${cds}= + ${directory_list}= Get From Dictionary ${GLOBAL_SERVICE_FOLDER_MAPPING} ${service} + ${ziplist}= Create List + ${uuid}= Get Current Date + ${service_name}= Catenate ${service} ${uuid} + ${shortened_uuid}= Evaluate str("${service_name}")[:23] + ${catalog_service_name}= Set Variable If '${catalog_service_name}' =='' ${shortened_uuid} ${catalog_service_name} + :for ${directory} in @{directory_list} + \ ${zipname}= Replace String ${directory} / _ + \ ${zip}= Catenate ${ASDC_ZIP_DIRECTORY}/${zipname}.zip + \ ${folder}= Catenate ${ASDC_ASSETS_DIRECTORY}/${directory} + \ OperatingSystem.Create Directory ${ASDC_ASSETS_DIRECTORY}/temp + \ Create Zip From Files In Directory ${folder} ${zip} + \ Append To List ${ziplist} ${zip} + ${catalog_service_name} ${catalog_resource_name} ${vf_modules} ${catalog_resource_ids} ${catalog_service_id} ${catalog_resources} Distribute vCPEResCust Model From ASDC ${ziplist} ${catalog_service_name} ${cds} ${service} + Set Test Variable ${CATALOG_RESOURCE_IDS} ${catalog_resource_ids} + Set Test Variable ${CATALOG_SERVICE_ID} ${catalog_service_id} + Set Test Variable ${CATALOG_RESOURCES} ${catalog_resources} + Download CSAR ${catalog_service_id} + [Return] ${catalog_service_name} ${catalog_resource_name} ${vf_modules} ${catalog_resources} + + + + +Teardown Model Distribution + [Documentation] Clean up at the end of the test + Log ${CATALOG_SERVICE_ID} ${CATALOG_RESOURCE_IDS} + # Teardown is removing allotted resources for some reason + #Teardown Models ${CATALOG_SERVICE_ID} ${CATALOG_RESOURCE_IDS} + +Teardown Models + [Documentation] Clean up at the end of the test + [Arguments] ${catalog_service_id} ${catalog_resource_ids} + Return From Keyword If '${catalog_service_id}' == '' + :for ${catalog_resource_id} in @{catalog_resource_ids} + \ ${resourece_json}= Mark ASDC Catalog Resource Inactive ${catalog_resource_id} + ${service_json}= Mark ASDC Catalog Service Inactive ${catalog_service_id} + ${services_json}= Delete Inactive ASDC Catalog Services + ${resources_json}= Delete Inactive ASDC Catalog Resources -- cgit 1.2.3-korg