From 69fd079507e6a4500c2117b7dad31fa81b7e1299 Mon Sep 17 00:00:00 2001 From: Andreas Geissler Date: Tue, 5 Nov 2024 18:22:30 +0100 Subject: Update deprecated :FOR loops Update SDNC APIs Issue-ID: OOM-3301 Signed-off-by: Andreas Geissler Change-Id: I515e503abef90f3aaa3733d7518d6e738173100e --- .../test_templates/model_test_template.robot | 50 ++++++++++++---------- 1 file changed, 27 insertions(+), 23 deletions(-) (limited to 'robot/resources/test_templates/model_test_template.robot') diff --git a/robot/resources/test_templates/model_test_template.robot b/robot/resources/test_templates/model_test_template.robot index 40fb38d8..60e2cb34 100644 --- a/robot/resources/test_templates/model_test_template.robot +++ b/robot/resources/test_templates/model_test_template.robot @@ -39,24 +39,26 @@ Model Distribution For Directory Create ZIPs in SDC ZIP Directory [Arguments] ${directory_list} ${ziplist} - :FOR ${directory} IN @{directory_list} - \ ${zipname}= Replace String ${directory} / _ - \ ${zip}= Catenate ${SDC_ZIP_DIRECTORY}/${zipname}.zip - \ ${folder}= Catenate ${SDC_ASSETS_DIRECTORY}/${directory} - \ OperatingSystem.Create Directory ${SDC_ASSETS_DIRECTORY}/temp - \ Create Zip From Files In Directory ${folder} ${zip} - \ Append To List ${ziplist} ${zip} + FOR ${directory} IN @{directory_list} + ${zipname}= Replace String ${directory} / _ + ${zip}= Catenate ${SDC_ZIP_DIRECTORY}/${zipname}.zip + ${folder}= Catenate ${SDC_ASSETS_DIRECTORY}/${directory} + OperatingSystem.Create Directory ${SDC_ASSETS_DIRECTORY}/temp + Create Zip From Files In Directory ${folder} ${zip} + Append To List ${ziplist} ${zip} + END [Return] ${ziplist} Create CSARSs in SDC Onboarding Packages Directory [Arguments] ${directory_list} ${ziplist} - :FOR ${directory} IN @{directory_list} - \ ${zipname}= Replace String ${directory} / _ - \ ${csar}= Catenate ${SDC_CSAR_DIRECTORY}/${zipname}.csar - \ ${folder}= Catenate ${SDC_TOSCA_ONBOARDING_PACKAGES_DIRECTORY}/${directory} - \ OperatingSystem.Create Directory ${SDC_TOSCA_ONBOARDING_PACKAGES_DIRECTORY}/temp - \ Create Zip From Files In Directory ${folder} ${csar} sub_directories=${true} - \ Append To List ${ziplist} ${csar} + FOR ${directory} IN @{directory_list} + ${zipname}= Replace String ${directory} / _ + ${csar}= Catenate ${SDC_CSAR_DIRECTORY}/${zipname}.csar + ${folder}= Catenate ${SDC_TOSCA_ONBOARDING_PACKAGES_DIRECTORY}/${directory} + OperatingSystem.Create Directory ${SDC_TOSCA_ONBOARDING_PACKAGES_DIRECTORY}/temp + Create Zip From Files In Directory ${folder} ${csar} sub_directories=${true} + Append To List ${ziplist} ${csar} + END [Return] ${ziplist} TOSCA Based PNF Model Distribution For Directory @@ -68,13 +70,14 @@ TOSCA Based PNF Model Distribution For Directory ${service_name}= Catenate ${service} ${uuid} ${shortened_uuid}= Evaluate str("${service_name}")[:23] ${catalog_service_name}= Set Variable If '${catalog_service_name}' =='' ${shortened_uuid} ${catalog_service_name} - :FOR ${directory} IN @{directory_list} - \ ${zipname}= Replace String ${directory} / _ - \ ${csar}= Catenate ${SDC_CSAR_DIRECTORY}/${zipname}.csar - \ ${folder}= Catenate ${SDC_TOSCA_ONBOARDING_PACKAGES_DIRECTORY}/${directory} - \ OperatingSystem.Create Directory ${SDC_TOSCA_ONBOARDING_PACKAGES_DIRECTORY}/temp - \ Create Zip From Files In Directory ${folder} ${csar} sub_directories=${true} - \ Append To List ${csarlist} ${csar} + FOR ${directory} IN @{directory_list} + ${zipname}= Replace String ${directory} / _ + ${csar}= Catenate ${SDC_CSAR_DIRECTORY}/${zipname}.csar + ${folder}= Catenate ${SDC_TOSCA_ONBOARDING_PACKAGES_DIRECTORY}/${directory} + OperatingSystem.Create Directory ${SDC_TOSCA_ONBOARDING_PACKAGES_DIRECTORY}/temp + Create Zip From Files In Directory ${folder} ${csar} sub_directories=${true} + Append To List ${csarlist} ${csar} + END ${catalog_service_name} ${catalog_resource_name} ${catalog_resource_ids} ${catalog_service_id} ${catalog_resources} Distribute Model From SDC ${csarlist} ${catalog_service_name} ${service} resourceType=PNF Download CSAR ${catalog_service_id} [Return] ${catalog_service_name} ${catalog_resource_name} ${catalog_resources} @@ -83,8 +86,9 @@ Teardown Models [Documentation] Clean up at the end of the test [Arguments] ${catalog_service_id} ${catalog_resource_ids} Return From Keyword If '${catalog_service_id}' == '' - :FOR ${catalog_resource_id} IN @{catalog_resource_ids} - \ ${resourece_json}= Mark SDC Catalog Resource Inactive ${catalog_resource_id} + FOR ${catalog_resource_id} IN @{catalog_resource_ids} + ${resourece_json}= Mark SDC Catalog Resource Inactive ${catalog_resource_id} + END ${service_json}= Mark SDC Catalog Service Inactive ${catalog_service_id} ${services_json}= Delete Inactive SDC Catalog Services ${resources_json}= Delete Inactive SDC Catalog Resources -- cgit 1.2.3-korg