blob: 3fbf7d26bf23c98698fc23a1e36aced6788ae228 [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
Brian Freemanf508ab22018-03-15 21:19:41 -05007Library DateTime
DR695Hccff30b2017-02-17 18:44:24 -05008Resource ../asdc_interface.robot
9
10Variables ../../assets/service_mappings.py
11
12*** Variables ***
13${ASDC_BASE_PATH} /sdc1
14${ASDC_DESIGNER_PATH} /proxy-designer1#/dashboard
Jerry Flood8c636292017-10-30 13:03:31 -040015${ASDC_ASSETS_DIRECTORY} ${GLOBAL_HEAT_TEMPLATES_FOLDER}
DR695Hccff30b2017-02-17 18:44:24 -050016${ASDC_ZIP_DIRECTORY} ${ASDC_ASSETS_DIRECTORY}/temp
17
jf986099c63292017-03-09 15:28:42 -050018#***************** Test Case Variables *********************
19${CATALOG_RESOURCE_IDS}
20${CATALOG_SERVICE_ID}
DR695Hccff30b2017-02-17 18:44:24 -050021
22*** Keywords ***
23
24Model Distribution For Directory
Yang Xu2ec80382018-11-01 12:30:37 -040025 [Arguments] ${service} ${catalog_service_name}= ${cds}=
DR695Hccff30b2017-02-17 18:44:24 -050026 ${directory_list}= Get From Dictionary ${GLOBAL_SERVICE_FOLDER_MAPPING} ${service}
27 ${ziplist}= Create List
Brian Freemanf508ab22018-03-15 21:19:41 -050028 ${uuid}= Get Current Date
29 ${service_name}= Catenate ${service} ${uuid}
30 ${shortened_uuid}= Evaluate str("${service_name}")[:23]
31 ${catalog_service_name}= Set Variable If '${catalog_service_name}' =='' ${shortened_uuid} ${catalog_service_name}
DR695Hccff30b2017-02-17 18:44:24 -050032 :for ${directory} in @{directory_list}
Jerry Flood3a169a32017-12-01 12:39:10 -050033 \ ${zipname}= Replace String ${directory} / _
Jerry Flood8c636292017-10-30 13:03:31 -040034 \ ${zip}= Catenate ${ASDC_ZIP_DIRECTORY}/${zipname}.zip
jf986099c63292017-03-09 15:28:42 -050035 \ ${folder}= Catenate ${ASDC_ASSETS_DIRECTORY}/${directory}
DR695Hccff30b2017-02-17 18:44:24 -050036 \ OperatingSystem.Create Directory ${ASDC_ASSETS_DIRECTORY}/temp
37 \ Create Zip From Files In Directory ${folder} ${zip}
jf986099c63292017-03-09 15:28:42 -050038 \ Append To List ${ziplist} ${zip}
Yang Xu2ec80382018-11-01 12:30:37 -040039 ${catalog_service_name} ${catalog_resource_name} ${vf_modules} ${catalog_resource_ids} ${catalog_service_id} ${catalog_resources} Distribute Model From ASDC ${ziplist} ${catalog_service_name} ${cds}
DR695Hccff30b2017-02-17 18:44:24 -050040 Set Test Variable ${CATALOG_RESOURCE_IDS} ${catalog_resource_ids}
41 Set Test Variable ${CATALOG_SERVICE_ID} ${catalog_service_id}
Jerry Flood3a169a32017-12-01 12:39:10 -050042 Set Test Variable ${CATALOG_RESOURCES} ${catalog_resources}
43 [Return] ${catalog_service_name} ${catalog_resource_name} ${vf_modules} ${catalog_resources}
jf986099c63292017-03-09 15:28:42 -050044
DR695Hccff30b2017-02-17 18:44:24 -050045
46
47
48Teardown Model Distribution
49 [Documentation] Clean up at the end of the test
jf986099c63292017-03-09 15:28:42 -050050 Log ${CATALOG_SERVICE_ID} ${CATALOG_RESOURCE_IDS}
51 Teardown Models ${CATALOG_SERVICE_ID} ${CATALOG_RESOURCE_IDS}
52
DR695Hccff30b2017-02-17 18:44:24 -050053Teardown Models
54 [Documentation] Clean up at the end of the test
55 [Arguments] ${catalog_service_id} ${catalog_resource_ids}
56 Return From Keyword If '${catalog_service_id}' == ''
57 :for ${catalog_resource_id} in @{catalog_resource_ids}
jf986099c63292017-03-09 15:28:42 -050058 \ ${resourece_json}= Mark ASDC Catalog Resource Inactive ${catalog_resource_id}
DR695Hccff30b2017-02-17 18:44:24 -050059 ${service_json}= Mark ASDC Catalog Service Inactive ${catalog_service_id}
60 ${services_json}= Delete Inactive ASDC Catalog Services
61 ${resources_json}= Delete Inactive ASDC Catalog Resources