blob: 98b3b1cf3740496d2dc377b25ce130fd93b6e7ad [file] [log] [blame]
DR695Hccff30b2017-02-17 18:44:24 -05001*** Settings ***
2Documentation The main interface for interacting with ASDC. It handles low level stuff like managing the http request library and DCAE required fields
3Library OperatingSystem
4Library ArchiveLibrary
jf986099c63292017-03-09 15:28:42 -05005Library Collections
Jerry Flood3a169a32017-12-01 12:39:10 -05006Library String
DR695Hccff30b2017-02-17 18:44:24 -05007Resource ../asdc_interface.robot
8
9Variables ../../assets/service_mappings.py
10
11*** Variables ***
12${ASDC_BASE_PATH} /sdc1
13${ASDC_DESIGNER_PATH} /proxy-designer1#/dashboard
Jerry Flood8c636292017-10-30 13:03:31 -040014${ASDC_ASSETS_DIRECTORY} ${GLOBAL_HEAT_TEMPLATES_FOLDER}
DR695Hccff30b2017-02-17 18:44:24 -050015${ASDC_ZIP_DIRECTORY} ${ASDC_ASSETS_DIRECTORY}/temp
16
jf986099c63292017-03-09 15:28:42 -050017#***************** Test Case Variables *********************
18${CATALOG_RESOURCE_IDS}
19${CATALOG_SERVICE_ID}
DR695Hccff30b2017-02-17 18:44:24 -050020
21*** Keywords ***
22
23Model Distribution For Directory
jf986075010a42017-02-22 16:52:54 -050024 [Arguments] ${service} ${catalog_service_name}=
DR695Hccff30b2017-02-17 18:44:24 -050025 ${directory_list}= Get From Dictionary ${GLOBAL_SERVICE_FOLDER_MAPPING} ${service}
26 ${ziplist}= Create List
27 :for ${directory} in @{directory_list}
Jerry Flood3a169a32017-12-01 12:39:10 -050028 \ ${zipname}= Replace String ${directory} / _
Jerry Flood8c636292017-10-30 13:03:31 -040029 \ ${zip}= Catenate ${ASDC_ZIP_DIRECTORY}/${zipname}.zip
jf986099c63292017-03-09 15:28:42 -050030 \ ${folder}= Catenate ${ASDC_ASSETS_DIRECTORY}/${directory}
DR695Hccff30b2017-02-17 18:44:24 -050031 \ OperatingSystem.Create Directory ${ASDC_ASSETS_DIRECTORY}/temp
32 \ Create Zip From Files In Directory ${folder} ${zip}
jf986099c63292017-03-09 15:28:42 -050033 \ Append To List ${ziplist} ${zip}
Jerry Flood3a169a32017-12-01 12:39:10 -050034 ${catalog_service_name} ${catalog_resource_name} ${vf_modules} ${catalog_resource_ids} ${catalog_service_id} ${catalog_resources} Distribute Model From ASDC ${ziplist} ${catalog_service_name}
DR695Hccff30b2017-02-17 18:44:24 -050035 Set Test Variable ${CATALOG_RESOURCE_IDS} ${catalog_resource_ids}
36 Set Test Variable ${CATALOG_SERVICE_ID} ${catalog_service_id}
Jerry Flood3a169a32017-12-01 12:39:10 -050037 Set Test Variable ${CATALOG_RESOURCES} ${catalog_resources}
38 [Return] ${catalog_service_name} ${catalog_resource_name} ${vf_modules} ${catalog_resources}
jf986099c63292017-03-09 15:28:42 -050039
DR695Hccff30b2017-02-17 18:44:24 -050040
41
42
43Teardown Model Distribution
44 [Documentation] Clean up at the end of the test
jf986099c63292017-03-09 15:28:42 -050045 Log ${CATALOG_SERVICE_ID} ${CATALOG_RESOURCE_IDS}
46 Teardown Models ${CATALOG_SERVICE_ID} ${CATALOG_RESOURCE_IDS}
47
DR695Hccff30b2017-02-17 18:44:24 -050048Teardown Models
49 [Documentation] Clean up at the end of the test
50 [Arguments] ${catalog_service_id} ${catalog_resource_ids}
51 Return From Keyword If '${catalog_service_id}' == ''
52 :for ${catalog_resource_id} in @{catalog_resource_ids}
jf986099c63292017-03-09 15:28:42 -050053 \ ${resourece_json}= Mark ASDC Catalog Resource Inactive ${catalog_resource_id}
DR695Hccff30b2017-02-17 18:44:24 -050054 ${service_json}= Mark ASDC Catalog Service Inactive ${catalog_service_id}
55 ${services_json}= Delete Inactive ASDC Catalog Services
56 ${resources_json}= Delete Inactive ASDC Catalog Resources