blob: 4dce50a7563c1f871998c23c5d8b4126df4ab68a [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 Flood8c636292017-10-30 13:03:31 -04006Library 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 Flood8c636292017-10-30 13:03:31 -040028 \ ${zipname}= Replace String ${directory} / _
29 \ ${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}
jf986075010a42017-02-22 16:52:54 -050034 ${catalog_service_name} ${catalog_resource_name} ${vf_modules} ${catalog_resource_ids} ${catalog_service_id} 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}
jf986099c63292017-03-09 15:28:42 -050037 [Return] ${catalog_service_name} ${catalog_resource_name} ${vf_modules}
38
DR695Hccff30b2017-02-17 18:44:24 -050039
40
41
42Teardown Model Distribution
43 [Documentation] Clean up at the end of the test
jf986099c63292017-03-09 15:28:42 -050044 Log ${CATALOG_SERVICE_ID} ${CATALOG_RESOURCE_IDS}
45 Teardown Models ${CATALOG_SERVICE_ID} ${CATALOG_RESOURCE_IDS}
46
DR695Hccff30b2017-02-17 18:44:24 -050047Teardown Models
48 [Documentation] Clean up at the end of the test
49 [Arguments] ${catalog_service_id} ${catalog_resource_ids}
50 Return From Keyword If '${catalog_service_id}' == ''
51 :for ${catalog_resource_id} in @{catalog_resource_ids}
jf986099c63292017-03-09 15:28:42 -050052 \ ${resourece_json}= Mark ASDC Catalog Resource Inactive ${catalog_resource_id}
DR695Hccff30b2017-02-17 18:44:24 -050053 ${service_json}= Mark ASDC Catalog Service Inactive ${catalog_service_id}
54 ${services_json}= Delete Inactive ASDC Catalog Services
55 ${resources_json}= Delete Inactive ASDC Catalog Resources