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