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 | 8c63629 | 2017-10-30 13:03:31 -0400 | [diff] [blame] | 6 | Library String |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 7 | Resource ../asdc_interface.robot |
| 8 | |
| 9 | Variables ../../assets/service_mappings.py |
| 10 | |
| 11 | *** Variables *** |
| 12 | ${ASDC_BASE_PATH} /sdc1 |
| 13 | ${ASDC_DESIGNER_PATH} /proxy-designer1#/dashboard |
Jerry Flood | 8c63629 | 2017-10-30 13:03:31 -0400 | [diff] [blame] | 14 | ${ASDC_ASSETS_DIRECTORY} ${GLOBAL_HEAT_TEMPLATES_FOLDER} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 15 | ${ASDC_ZIP_DIRECTORY} ${ASDC_ASSETS_DIRECTORY}/temp |
| 16 | |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 17 | #***************** Test Case Variables ********************* |
| 18 | ${CATALOG_RESOURCE_IDS} |
| 19 | ${CATALOG_SERVICE_ID} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 20 | |
| 21 | *** Keywords *** |
| 22 | |
| 23 | Model Distribution For Directory |
jf9860 | 75010a4 | 2017-02-22 16:52:54 -0500 | [diff] [blame] | 24 | [Arguments] ${service} ${catalog_service_name}= |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 25 | ${directory_list}= Get From Dictionary ${GLOBAL_SERVICE_FOLDER_MAPPING} ${service} |
| 26 | ${ziplist}= Create List |
| 27 | :for ${directory} in @{directory_list} |
Jerry Flood | 8c63629 | 2017-10-30 13:03:31 -0400 | [diff] [blame] | 28 | \ ${zipname}= Replace String ${directory} / _ |
| 29 | \ ${zip}= Catenate ${ASDC_ZIP_DIRECTORY}/${zipname}.zip |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 30 | \ ${folder}= Catenate ${ASDC_ASSETS_DIRECTORY}/${directory} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 31 | \ OperatingSystem.Create Directory ${ASDC_ASSETS_DIRECTORY}/temp |
| 32 | \ Create Zip From Files In Directory ${folder} ${zip} |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 33 | \ Append To List ${ziplist} ${zip} |
jf9860 | 75010a4 | 2017-02-22 16:52:54 -0500 | [diff] [blame] | 34 | ${catalog_service_name} ${catalog_resource_name} ${vf_modules} ${catalog_resource_ids} ${catalog_service_id} Distribute Model From ASDC ${ziplist} ${catalog_service_name} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 35 | Set Test Variable ${CATALOG_RESOURCE_IDS} ${catalog_resource_ids} |
| 36 | Set Test Variable ${CATALOG_SERVICE_ID} ${catalog_service_id} |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 37 | [Return] ${catalog_service_name} ${catalog_resource_name} ${vf_modules} |
| 38 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 39 | |
| 40 | |
| 41 | |
| 42 | Teardown Model Distribution |
| 43 | [Documentation] Clean up at the end of the test |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 44 | Log ${CATALOG_SERVICE_ID} ${CATALOG_RESOURCE_IDS} |
| 45 | Teardown Models ${CATALOG_SERVICE_ID} ${CATALOG_RESOURCE_IDS} |
| 46 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 47 | Teardown 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} |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 52 | \ ${resourece_json}= Mark ASDC Catalog Resource Inactive ${catalog_resource_id} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 53 | ${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 |