DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation The main interface for interacting with ASDC. It handles low level stuff like managing the http request library and DCAE required fields |
| 3 | Library OperatingSystem |
| 4 | Library ArchiveLibrary |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 5 | Library Collections |
Jerry Flood | 3a169a3 | 2017-12-01 12:39:10 -0500 | [diff] [blame] | 6 | Library String |
Brian Freeman | f508ab2 | 2018-03-15 21:19:41 -0500 | [diff] [blame] | 7 | Library DateTime |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 8 | Resource ../asdc_interface.robot |
| 9 | |
| 10 | Variables ../../assets/service_mappings.py |
| 11 | |
| 12 | *** Variables *** |
| 13 | ${ASDC_BASE_PATH} /sdc1 |
| 14 | ${ASDC_DESIGNER_PATH} /proxy-designer1#/dashboard |
Jerry Flood | 8c63629 | 2017-10-30 13:03:31 -0400 | [diff] [blame] | 15 | ${ASDC_ASSETS_DIRECTORY} ${GLOBAL_HEAT_TEMPLATES_FOLDER} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 16 | ${ASDC_ZIP_DIRECTORY} ${ASDC_ASSETS_DIRECTORY}/temp |
| 17 | |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 18 | #***************** Test Case Variables ********************* |
| 19 | ${CATALOG_RESOURCE_IDS} |
| 20 | ${CATALOG_SERVICE_ID} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 21 | |
| 22 | *** Keywords *** |
| 23 | |
| 24 | Model Distribution For Directory |
Yang Xu | 2ec8038 | 2018-11-01 12:30:37 -0400 | [diff] [blame] | 25 | [Arguments] ${service} ${catalog_service_name}= ${cds}= |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 26 | ${directory_list}= Get From Dictionary ${GLOBAL_SERVICE_FOLDER_MAPPING} ${service} |
| 27 | ${ziplist}= Create List |
Brian Freeman | f508ab2 | 2018-03-15 21:19:41 -0500 | [diff] [blame] | 28 | ${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} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 32 | :for ${directory} in @{directory_list} |
Jerry Flood | 3a169a3 | 2017-12-01 12:39:10 -0500 | [diff] [blame] | 33 | \ ${zipname}= Replace String ${directory} / _ |
Jerry Flood | 8c63629 | 2017-10-30 13:03:31 -0400 | [diff] [blame] | 34 | \ ${zip}= Catenate ${ASDC_ZIP_DIRECTORY}/${zipname}.zip |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 35 | \ ${folder}= Catenate ${ASDC_ASSETS_DIRECTORY}/${directory} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 36 | \ OperatingSystem.Create Directory ${ASDC_ASSETS_DIRECTORY}/temp |
| 37 | \ Create Zip From Files In Directory ${folder} ${zip} |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 38 | \ Append To List ${ziplist} ${zip} |
Yang Xu | 2ec8038 | 2018-11-01 12:30:37 -0400 | [diff] [blame] | 39 | ${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} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 40 | Set Test Variable ${CATALOG_RESOURCE_IDS} ${catalog_resource_ids} |
| 41 | Set Test Variable ${CATALOG_SERVICE_ID} ${catalog_service_id} |
Jerry Flood | 3a169a3 | 2017-12-01 12:39:10 -0500 | [diff] [blame] | 42 | Set Test Variable ${CATALOG_RESOURCES} ${catalog_resources} |
| 43 | [Return] ${catalog_service_name} ${catalog_resource_name} ${vf_modules} ${catalog_resources} |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 44 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 45 | |
| 46 | |
| 47 | |
| 48 | Teardown Model Distribution |
| 49 | [Documentation] Clean up at the end of the test |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 50 | Log ${CATALOG_SERVICE_ID} ${CATALOG_RESOURCE_IDS} |
| 51 | Teardown Models ${CATALOG_SERVICE_ID} ${CATALOG_RESOURCE_IDS} |
| 52 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 53 | Teardown 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} |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 58 | \ ${resourece_json}= Mark ASDC Catalog Resource Inactive ${catalog_resource_id} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 59 | ${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 |