diff options
author | Andreas Geissler <andreas-geissler@telekom.de> | 2024-11-05 18:22:30 +0100 |
---|---|---|
committer | Andreas Geissler <andreas-geissler@telekom.de> | 2024-11-08 11:42:55 +0100 |
commit | 69fd079507e6a4500c2117b7dad31fa81b7e1299 (patch) | |
tree | a55826ede16537d8087c122ec38b00028aa18479 /robot/resources/test_templates | |
parent | b3cf372e63b153b19ec685782300ec2bd07875ac (diff) |
Update SDNC APIs
Issue-ID: OOM-3301
Signed-off-by: Andreas Geissler <andreas-geissler@telekom.de>
Change-Id: I515e503abef90f3aaa3733d7518d6e738173100e
Diffstat (limited to 'robot/resources/test_templates')
7 files changed, 192 insertions, 167 deletions
diff --git a/robot/resources/test_templates/closedloop_test_template.robot b/robot/resources/test_templates/closedloop_test_template.robot index 3619f4ca..4c883c10 100644 --- a/robot/resources/test_templates/closedloop_test_template.robot +++ b/robot/resources/test_templates/closedloop_test_template.robot @@ -199,26 +199,28 @@ VFWCL High Test [Arguments] ${pkg_host} Enable Streams V2 ${pkg_host} 10 Log Set number of streams to 10 - :FOR ${i} IN RANGE 12 - \ Sleep 15s - \ ${resp}= Get List Of Enabled Streams V2 ${pkg_host} - \ ${stream_count}= Set Variable ${resp['stream-count']['streams']['active-streams']} - \ Log Number of streams: ${stream_count} - \ Exit For Loop If '${stream_count}'=='5' - Should Be Equal As Integers ${stream_count} 5 + FOR ${i} IN RANGE 12 + Sleep 15s + ${resp}= Get List Of Enabled Streams V2 ${pkg_host} + ${stream_count}= Set Variable ${resp['stream-count']['streams']['active-streams']} + Log Number of streams: ${stream_count} + Exit For Loop If '${stream_count}'=='5' + Should Be Equal As Integers ${stream_count} 5 + END VFWCL Low Test [Documentation] Test Control Loop for Low Traffic [Arguments] ${pkg_host} Enable Streams V2 ${pkg_host} 1 Log Set number of streams to 1 - :FOR ${i} IN RANGE 12 - \ Sleep 15s - \ ${resp}= Get List Of Enabled Streams V2 ${pkg_host} - \ ${stream_count}= Set Variable ${resp['stream-count']['streams']['active-streams']} - \ Log Number of streams: ${stream_count} - \ Exit For Loop If '${stream_count}'=='5' - Should Be Equal As Integers ${stream_count} 5 + FOR ${i} IN RANGE 12 + Sleep 15s + ${resp}= Get List Of Enabled Streams V2 ${pkg_host} + ${stream_count}= Set Variable ${resp['stream-count']['streams']['active-streams']} + Log Number of streams: ${stream_count} + Exit For Loop If '${stream_count}'=='5' + Should Be Equal As Integers ${stream_count} 5 + END VFWCL Set To Medium [Documentation] Set flows to Medium to turn off control loop 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 diff --git a/robot/resources/test_templates/model_test_template_vcperescust.robot b/robot/resources/test_templates/model_test_template_vcperescust.robot index 06df414d..4ff62a64 100644 --- a/robot/resources/test_templates/model_test_template_vcperescust.robot +++ b/robot/resources/test_templates/model_test_template_vcperescust.robot @@ -22,13 +22,14 @@ Model Distribution For vCPEResCust 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} / _ - \ ${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 ${catalog_service_name} ${catalog_resource_name} ${vf_modules} ${catalog_resource_ids} ${catalog_service_id} ${catalog_resources} Distribute vCPEResCust Model From SDC ${ziplist} ${catalog_service_name} ${cds} ${service} Download CSAR ${catalog_service_id} [Return] ${catalog_service_name} ${catalog_resource_name} ${vf_modules} ${catalog_resources} diff --git a/robot/resources/test_templates/vnf_instantiation_ovp.robot b/robot/resources/test_templates/vnf_instantiation_ovp.robot index 71f079b3..9375fbe9 100644 --- a/robot/resources/test_templates/vnf_instantiation_ovp.robot +++ b/robot/resources/test_templates/vnf_instantiation_ovp.robot @@ -32,16 +32,15 @@ Instantiate VNF ${uuid}= Evaluate str("${uuid}")[:8] ##### INSTANTIATING VNF IN VID ##### - :FOR ${vnf} IN @{vnflist} - \ ${vnf_name}= Catenate Ete_${vnf}_${uuid}_${vnf_name_index} - \ ${generic_vnf_type}= Set Variable ${service_name}/${vnf_type} ${vnf_name_index} - \ ${vnf_name_index}= Evaluate ${vnf_name_index} + 1 - \ Log Creating VNF ${vnf_name} in VID console=yes - \ Wait Until Keyword Succeeds 900s 5s Create VID VNF ${service_instance_id} ${vnf_name} ${product_family} ${lcp_region} ${tenant_name} ${vnf_type} ${CUSTOMER_NAME} line_of_business=${line_of_business} platform=${platform} cloud_owner_uc=${cloud_owner} - + FOR ${vnf} IN @{vnflist} + ${vnf_name}= Catenate Ete_${vnf}_${uuid}_${vnf_name_index} + ${generic_vnf_type}= Set Variable ${service_name}/${vnf_type} ${vnf_name_index} + ${vnf_name_index}= Evaluate ${vnf_name_index} + 1 + Log Creating VNF ${vnf_name} in VID console=yes + Wait Until Keyword Succeeds 900s 5s Create VID VNF ${service_instance_id} ${vnf_name} ${product_family} ${lcp_region} ${tenant_name} ${vnf_type} ${CUSTOMER_NAME} line_of_business=${line_of_business} platform=${platform} cloud_owner_uc=${cloud_owner} #### Calling Keyword To Create Each Module #### - \ ${report_data}= Loop and Create Modules in VID ${vf_modules} ${vnf_name} ${generic_vnf_type} ${service_instance_id} ${lcp_region} ${tenant_name} ${cloud_owner} ${customer_name} ${vnf} ${catalog_resources} - + ${report_data}= Loop and Create Modules in VID ${vf_modules} ${vnf_name} ${generic_vnf_type} ${service_instance_id} ${lcp_region} ${tenant_name} ${cloud_owner} ${customer_name} ${vnf} ${catalog_resources} + END [Return] ${report_data} Loop and Create Modules in VID @@ -50,20 +49,22 @@ Loop and Create Modules in VID ${temp_list_for_report} Create List ### Base Module - :FOR ${module} IN @{vf_modules} - \ ${vf_module_type}= Get From Dictionary ${module} name - \ ${template_name}= Get Heat Template Name From Catalog Resource ${resources} ${vnf} ${vf_module_type} - \ ${preload_file} ${isBase}= Retrieve Module Preload and isBase ${template_name} - \ ${temp_dict_for_report} = Run Keyword If "${isBase}"=="true" Create Module in VID ${vnf_name} ${template_name} ${vf_module_type} ${generic_vnf_type} ${preload_file} ${service_instance_id} ${lcp_region} ${tenant_name} ${customer_name} ${cloud_owner} - \ Run Keyword If "${isBase}"=="true" Append To List ${temp_list_for_report} ${temp_dict_for_report} + FOR ${module} IN @{vf_modules} + ${vf_module_type}= Get From Dictionary ${module} name + ${template_name}= Get Heat Template Name From Catalog Resource ${resources} ${vnf} ${vf_module_type} + ${preload_file} ${isBase}= Retrieve Module Preload and isBase ${template_name} + ${temp_dict_for_report} = Run Keyword If "${isBase}"=="true" Create Module in VID ${vnf_name} ${template_name} ${vf_module_type} ${generic_vnf_type} ${preload_file} ${service_instance_id} ${lcp_region} ${tenant_name} ${customer_name} ${cloud_owner} + Run Keyword If "${isBase}"=="true" Append To List ${temp_list_for_report} ${temp_dict_for_report} + END ### Incremental Modules - :FOR ${module} IN @{vf_modules} - \ ${vf_module_type}= Get From Dictionary ${module} name - \ ${template_name}= Get Heat Template Name From Catalog Resource ${resources} ${vnf} ${vf_module_type} - \ ${preload_file} ${isBase}= Retrieve Module Preload and isBase ${template_name} - \ ${temp_dict_for_report} = Run Keyword If "${isBase}"=="false" Create Module in VID ${vnf_name} ${template_name} ${vf_module_type} ${generic_vnf_type} ${preload_file} ${service_instance_id} ${lcp_region} ${tenant_name} ${customer_name} ${cloud_owner} - \ Run Keyword If "${isBase}"=="false" Append To List ${temp_list_for_report} ${temp_dict_for_report} + FOR ${module} IN @{vf_modules} + ${vf_module_type}= Get From Dictionary ${module} name + ${template_name}= Get Heat Template Name From Catalog Resource ${resources} ${vnf} ${vf_module_type} + ${preload_file} ${isBase}= Retrieve Module Preload and isBase ${template_name} + ${temp_dict_for_report} = Run Keyword If "${isBase}"=="false" Create Module in VID ${vnf_name} ${template_name} ${vf_module_type} ${generic_vnf_type} ${preload_file} ${service_instance_id} ${lcp_region} ${tenant_name} ${customer_name} ${cloud_owner} + Run Keyword If "${isBase}"=="false" Append To List ${temp_list_for_report} ${temp_dict_for_report} + END [Return] ${temp_list_for_report} @@ -87,13 +88,14 @@ Retrieve Module Preload and isBase [Arguments] ${file_name} ${json}= OperatingSystem.Get File ${BUILD_DIR}/vnf-details.json ${object}= Evaluate json.loads('''${json}''') json - :FOR ${vnf} IN @{object["modules"]} - \ ${module_present}= set variable True - \ ${file_name_m}= set variable ${vnf["filename"]} - \ ${preload_name}= set variable if '${file_name_m}' == '${file_name}' ${vnf["preload"]} - \ ${isBase}= set variable if '${file_name_m}' == '${file_name}' ${vnf["isBase"]} - \ Exit For Loop If '${file_name_m}' == '${file_name}' - \ ${module_present}= set variable False + FOR ${vnf} IN @{object["modules"]} + ${module_present}= set variable True + ${file_name_m}= set variable ${vnf["filename"]} + ${preload_name}= set variable if '${file_name_m}' == '${file_name}' ${vnf["preload"]} + ${isBase}= set variable if '${file_name_m}' == '${file_name}' ${vnf["isBase"]} + Exit For Loop If '${file_name_m}' == '${file_name}' + ${module_present}= set variable False + END Return From Keyword If ${module_present}==True ${preload_name} ${isBase} Fail msg=ERROR: A module with the file name: ${file_name} is not present. @@ -105,24 +107,26 @@ Get Heat Template Name From Catalog Resource ${keys}= Get Dictionary Keys ${resources} ${artifact_ids}= Get Artifact IDs From CSAR ${resources} ${vnf} ${module_id} - :FOR ${key} IN @{keys} - \ ${cr}= Get From Dictionary ${resources} ${key} - \ ${artifacts}= Set Variable ${cr['allArtifacts']} - \ ${artifactName}= Get Artifact Name From Artifacts ${artifacts} ${artifact_ids} - \ Return From Keyword If "${artifactName}" != "NOTFOUND" ${artifactName} + FOR ${key} IN @{keys} + ${cr}= Get From Dictionary ${resources} ${key} + ${artifacts}= Set Variable ${cr['allArtifacts']} + ${artifactName}= Get Artifact Name From Artifacts ${artifacts} ${artifact_ids} + Return From Keyword If "${artifactName}" != "NOTFOUND" ${artifactName} + END Get Artifact Name From Artifacts [Arguments] ${artifacts} ${artifact_ids} ${keys}= Get Dictionary Keys ${artifacts} - :FOR ${key} IN @{keys} - \ ${artifact}= Get From Dictionary ${artifacts} ${key} - \ ${artifactType}= Get From Dictionary ${artifact} artifactType - \ ${csar_id}= Set Variable '' - \ ${csar_id}= Run Keyword If "${artifactType}"=="HEAT" Get From Dictionary ${artifact} artifactUUID - \ ${artifactName}= Run Keyword If $csar_id in $artifact_ids Get From Dictionary ${artifact} artifactName - \ Return From Keyword If $csar_id in $artifact_ids ${artifactName} + FOR ${key} IN @{keys} + ${artifact}= Get From Dictionary ${artifacts} ${key} + ${artifactType}= Get From Dictionary ${artifact} artifactType + ${csar_id}= Set Variable '' + ${csar_id}= Run Keyword If "${artifactType}"=="HEAT" Get From Dictionary ${artifact} artifactUUID + ${artifactName}= Run Keyword If $csar_id in $artifact_ids Get From Dictionary ${artifact} artifactName + Return From Keyword If $csar_id in $artifact_ids ${artifactName} + END [Return] NOTFOUND @@ -132,11 +136,12 @@ Get Artifact IDs From CSAR ${keys}= Get Dictionary Keys ${resources} - :FOR ${key} IN @{keys} - \ ${cr}= Get From Dictionary ${resources} ${key} - \ ${groups}= Set Variable ${cr['groups']} - \ ${artifact_ids}= Get Artifact IDs From Module ${groups} ${module_id} - \ Return From Keyword If ${artifact_ids} is not None ${artifact_ids} + FOR ${key} IN @{keys} + ${cr}= Get From Dictionary ${resources} ${key} + ${groups}= Set Variable ${cr['groups']} + ${artifact_ids}= Get Artifact IDs From Module ${groups} ${module_id} + Return From Keyword If ${artifact_ids} is not None ${artifact_ids} + END ${empty_list}= Create List @@ -145,11 +150,12 @@ Get Artifact IDs From CSAR Get Artifact IDs From Module [Arguments] ${groups} ${module_id} - :FOR ${group} IN @{groups} - \ ${invariant_name}= Get From Dictionary ${group} invariantName - \ ${artifact_ids}= Create List - \ ${artifact_ids}= Run Keyword If "${invariant_name}"== "${module_id}" Get From Dictionary ${group} artifactsUuid - \ Return From Keyword If ${artifact_ids} is not None ${artifact_ids} + FOR ${group} IN @{groups} + ${invariant_name}= Get From Dictionary ${group} invariantName + ${artifact_ids}= Create List + ${artifact_ids}= Run Keyword If "${invariant_name}"== "${module_id}" Get From Dictionary ${group} artifactsUuid + Return From Keyword If ${artifact_ids} is not None ${artifact_ids} + END ${empty_list}= Create List diff --git a/robot/resources/test_templates/vnf_orchestration_test_template.robot b/robot/resources/test_templates/vnf_orchestration_test_template.robot index 59eff810..3897afff 100644 --- a/robot/resources/test_templates/vnf_orchestration_test_template.robot +++ b/robot/resources/test_templates/vnf_orchestration_test_template.robot @@ -59,24 +59,25 @@ Orchestrate VNF ${vnf_name_index}= Set Variable 0 ${vf_module_name_list}= Create List ${uuid}= Evaluate str("${uuid}")[:8] - :FOR ${vnf} IN @{vnflist} - \ ${vnf_name}= Catenate Ete_${vnf}_${uuid}_${vnf_name_index} - \ ${vf_module_name}= Catenate Vfmodule_Ete_${vnf}_${uuid}_${vnf_name_index} - \ ${vnf_name_index}= Evaluate ${vnf_name_index} + 1 - \ ${vnf_type}= Get VNF Type ${catalog_resources} ${vnf} ${service} - \ ${vf_module}= Get VF Module ${catalog_resources} ${vnf} ${service} - \ Create VID VNF ${service_instance_id} ${vnf_name} ${product_family} ${lcp_region} ${tenant_name} ${vnf_type} ${customer_name} + FOR ${vnf} IN @{vnflist} + ${vnf_name}= Catenate Ete_${vnf}_${uuid}_${vnf_name_index} + ${vf_module_name}= Catenate Vfmodule_Ete_${vnf}_${uuid}_${vnf_name_index} + ${vnf_name_index}= Evaluate ${vnf_name_index} + 1 + ${vnf_type}= Get VNF Type ${catalog_resources} ${vnf} ${service} + ${vf_module}= Get VF Module ${catalog_resources} ${vnf} ${service} + Create VID VNF ${service_instance_id} ${vnf_name} ${product_family} ${lcp_region} ${tenant_name} ${vnf_type} ${customer_name} - \ ${vf_module_type} ${closedloop_vf_module}= Run Keyword If "${API_TYPE}"=="GRA_API" Preload Gra ${service_instance_id} ${vnf_name} ${vnf_type} ${vf_module_name} ${vf_module} ${vnf} ${uuid} ${service} ${server_id} - \ ... ELSE Preload Vnf ${service_instance_id} ${vnf_name} ${vnf_type} ${vf_module_name} ${vf_module} ${vnf} ${uuid} ${service} ${server_id} + ${vf_module_type} ${closedloop_vf_module}= Run Keyword If "${API_TYPE}"=="GRA_API" Preload Gra ${service_instance_id} ${vnf_name} ${vnf_type} ${vf_module_name} ${vf_module} ${vnf} ${uuid} ${service} ${server_id} + ... ELSE Preload Vnf ${service_instance_id} ${vnf_name} ${vnf_type} ${vf_module_name} ${vf_module} ${vnf} ${uuid} ${service} ${server_id} - \ ${vf_module_id}= Create VID VNF module ${service_instance_id} ${vf_module_name} ${lcp_region} ${tenant_name} ${vf_module_type} ${customer_name} ${vnf_name} - \ ${generic_vnf}= Validate Generic VNF ${vnf_name} ${vnf_type} ${service_instance_id} - \ Set To Dictionary ${generic_vnfs} ${vf_module_type} ${generic_vnf} + ${vf_module_id}= Create VID VNF module ${service_instance_id} ${vf_module_name} ${lcp_region} ${tenant_name} ${vf_module_type} ${customer_name} ${vnf_name} + ${generic_vnf}= Validate Generic VNF ${vnf_name} ${vnf_type} ${service_instance_id} + Set To Dictionary ${generic_vnfs} ${vf_module_type} ${generic_vnf} # TODO: Need to look at a better way to default ipv4_oam_interface search for Heatbridge - \ ${uris_to_delete}= Set Variable 'http://devnull' - \ Validate VF Module ${vf_module_name} ${vnf} - \ Append To List ${vf_module_name_list} ${vf_module_name} + ${uris_to_delete}= Set Variable 'http://devnull' + Validate VF Module ${vf_module_name} ${vnf} + Append To List ${vf_module_name_list} ${vf_module_name} + END [Return] ${vf_module_name_list} ${generic_vnfs} ${server_id} ${service_instance_id} ${catalog_resource_ids} ${catalog_service_id} ${uris_to_delete} @@ -106,27 +107,28 @@ Orchestrate Demo VNF ServiceMapping.Set Directory default ${GLOBAL_SERVICE_MAPPING_DIRECTORY} ${vnflist}= ServiceMapping.Get Service Vnf Mapping default ${service} ${generic_vnfs}= Create Dictionary - :FOR ${vnf} IN @{vnflist} - \ ${vnf_name}= Catenate Ete_${vnf}_${uuid} - \ ${vf_module_name}= Catenate Vfmodule_Demo_${vnf}_${uuid} - \ ${vnf_type}= Set Variable ${vnf_json_resources['${vnf}']['vnf_type']} - \ ${vf_module}= Set Variable ${vnf_json_resources['${vnf}']['vf_module']} - \ Create VID VNF ${service_instance_id} ${vnf_name} ${product_family} ${lcp_region} ${tenant_name} ${vnf_type} ${full_customer_name} - \ ${vf_module_entry}= Create Dictionary name=${vf_module} - \ ${vf_modules}= Create List ${vf_module_entry} + FOR ${vnf} IN @{vnflist} + ${vnf_name}= Catenate Ete_${vnf}_${uuid} + ${vf_module_name}= Catenate Vfmodule_Demo_${vnf}_${uuid} + ${vnf_type}= Set Variable ${vnf_json_resources['${vnf}']['vnf_type']} + ${vf_module}= Set Variable ${vnf_json_resources['${vnf}']['vf_module']} + Create VID VNF ${service_instance_id} ${vnf_name} ${product_family} ${lcp_region} ${tenant_name} ${vnf_type} ${full_customer_name} + ${vf_module_entry}= Create Dictionary name=${vf_module} + ${vf_modules}= Create List ${vf_module_entry} # in Demo VNF flow old logic since we did not create the resource so @{vf_modules} is passed to Preload Vnf / Preload Gra - \ ${vf_module_type} ${closedloop_vf_module}= Run Keyword If "${API_TYPE}"=="GRA_API" Preload Gra ${service_instance_id} ${vnf_name} ${vnf_type} ${vf_module_name} ${vf_modules} ${vnf} ${uuid} ${service} ${server_id} - \ ... ELSE Preload Vnf ${service_instance_id} ${vnf_name} ${vnf_type} ${vf_module_name} ${vf_modules} ${vnf} ${uuid} ${service} ${server_id} + ${vf_module_type} ${closedloop_vf_module}= Run Keyword If "${API_TYPE}"=="GRA_API" Preload Gra ${service_instance_id} ${vnf_name} ${vnf_type} ${vf_module_name} ${vf_modules} ${vnf} ${uuid} ${service} ${server_id} + ... ELSE Preload Vnf ${service_instance_id} ${vnf_name} ${vnf_type} ${vf_module_name} ${vf_modules} ${vnf} ${uuid} ${service} ${server_id} - \ ${vf_module_id}= Create VID VNF module ${service_instance_id} ${vf_module_name} ${lcp_region} ${tenant_name} ${vf_module_type} ${full_customer_name} ${vnf_name} - \ ${generic_vnf}= Validate Generic VNF ${vnf_name} ${vnf_type} ${service_instance_id} - \ Set To Dictionary ${generic_vnfs} ${vf_module_type} ${generic_vnf} + ${vf_module_id}= Create VID VNF module ${service_instance_id} ${vf_module_name} ${lcp_region} ${tenant_name} ${vf_module_type} ${full_customer_name} ${vnf_name} + ${generic_vnf}= Validate Generic VNF ${vnf_name} ${vnf_type} ${service_instance_id} + Set To Dictionary ${generic_vnfs} ${vf_module_type} ${generic_vnf} # TODO: Need to look at a better way to default ipv4_oam_interface search for Heatbridge ## Part of remove Heatbridge ##\ Execute Heatbridge ${vf_module_name} ${vnf} ${service} ipv4_oam_interface - \ Validate VF Module ${vf_module_name} ${vnf} - \ Append To List ${vf_module_name_list} ${vf_module_name} + Validate VF Module ${vf_module_name} ${vnf} + Append To List ${vf_module_name_list} ${vf_module_name} + END [Return] ${vf_module_name} ${service} ${generic_vnfs} @@ -151,12 +153,13 @@ Get Catalog Resource ${base_name}= Get Name Pattern ${vnf} ${service} ${keys}= Get Dictionary Keys ${resources} - :FOR ${key} IN @{keys} - \ ${cr}= Get From Dictionary ${resources} ${key} - \ Return From Keyword If '${base_name}' in '${cr['allArtifacts']['heat1']['artifactDisplayName']}' ${cr} - \ Run Keyword If 'heat2' in ${cr['allArtifacts']} Return From Keyword If '${base_name}' in '${cr['allArtifacts']['heat2']['artifactDisplayName']}' ${cr} - \ Run Keyword If 'heat3' in ${cr['allArtifacts']} Return From Keyword If '${base_name}' in '${cr['allArtifacts']['heat3']['artifactDisplayName']}' ${cr} - \ Run Keyword If 'heat4' in ${cr['allArtifacts']} Return From Keyword If '${base_name}' in '${cr['allArtifacts']['heat4']['artifactDisplayName']}' ${cr} + FOR ${key} IN @{keys} + ${cr}= Get From Dictionary ${resources} ${key} + Return From Keyword If '${base_name}' in '${cr['allArtifacts']['heat1']['artifactDisplayName']}' ${cr} + Run Keyword If 'heat2' in ${cr['allArtifacts']} Return From Keyword If '${base_name}' in '${cr['allArtifacts']['heat2']['artifactDisplayName']}' ${cr} + Run Keyword If 'heat3' in ${cr['allArtifacts']} Return From Keyword If '${base_name}' in '${cr['allArtifacts']['heat3']['artifactDisplayName']}' ${cr} + Run Keyword If 'heat4' in ${cr['allArtifacts']} Return From Keyword If '${base_name}' in '${cr['allArtifacts']['heat4']['artifactDisplayName']}' ${cr} + END Fail Unable to find catalog resource for ${vnf} ${base_name} Get Name Pattern @@ -164,9 +167,10 @@ Get Name Pattern [Arguments] ${vnf} ${service} ServiceMapping.Set Directory default ${GLOBAL_SERVICE_MAPPING_DIRECTORY} ${list}= ServiceMapping.Get Service Template Mapping default ${service} ${vnf} - :FOR ${dict} IN @{list} - \ ${base_name}= Get From Dictionary ${dict} name_pattern - \ Return From Keyword If '${dict['isBase']}' == 'true' ${base_name} + FOR ${dict} IN @{list} + ${base_name}= Get From Dictionary ${dict} name_pattern + Return From Keyword If '${dict['isBase']}' == 'true' ${base_name} + END Fail Unable to locate base name pattern Create Customer For VNF @@ -185,8 +189,9 @@ Setup Orchestrate VNF ${tenant_id} ${tenant_name}= Initialize Tenant From Openstack Run Openstack Auth Request auth ${regs}= Get Openstack Regions auth - :FOR ${region} IN @{regs} - \ Inventory Tenant If Not Exists ${cloud_owner} ${region} ${cloud_type} ${owner_defined_type} ${cloud_region_version} ${cloud_zone} ${tenant_id} ${tenant_name} + FOR ${region} IN @{regs} + Inventory Tenant If Not Exists ${cloud_owner} ${region} ${cloud_type} ${owner_defined_type} ${cloud_region_version} ${cloud_zone} ${tenant_id} ${tenant_name} + END Inventory Zone If Not Exists Inventory Complex If Not Exists ${GLOBAL_AAI_COMPLEX_NAME} ${GLOBAL_AAI_PHYSICAL_LOCATION_ID} ${GLOBAL_AAI_CLOUD_OWNER} ${GLOBAL_INJECTED_REGION} ${GLOBAL_AAI_CLOUD_OWNER_DEFINED_TYPE} Log Orchestrate VNF setup complete @@ -221,19 +226,22 @@ Delete VNF ${sorted_stack_names}= Remove Duplicates ${vf_module_name_list} Sort List ${sorted_stack_names} Reverse List ${sorted_stack_names} - :FOR ${stack} IN @{sorted_stack_names} - \ ${keypair_name}= Get Stack Keypairs ${stack} - \ Append To List ${list} ${keypair_name} + FOR ${stack} IN @{sorted_stack_names} + ${keypair_name}= Get Stack Keypairs ${stack} + Append To List ${list} ${keypair_name} + END Teardown VVG Server ${server_id} Run Keyword and Ignore Error Teardown VID ${service_instance_id} ${lcp_region} ${tenant_name} ${customer_name} ${uris_to_delete} # - :FOR ${stack} IN @{sorted_stack_names} - \ Run Keyword and Ignore Error Teardown Stack ${stack} - \ Log Stack Deleted ${stack} + FOR ${stack} IN @{sorted_stack_names} + Run Keyword and Ignore Error Teardown Stack ${stack} + Log Stack Deleted ${stack} + END # only needed if stack deleted but not keypair - :FOR ${key_pair} IN @{list} - \ Run Keyword and Ignore Error Delete Stack Keypair ${key_pair} - \ Log Key pair Deleted ${key_pair} + FOR ${key_pair} IN @{list} + Run Keyword and Ignore Error Delete Stack Keypair ${key_pair} + Log Key pair Deleted ${key_pair} + END Log VNF Deleted Teardown VNF diff --git a/robot/resources/test_templates/vnf_orchestration_with_cds_test_template.robot b/robot/resources/test_templates/vnf_orchestration_with_cds_test_template.robot index 1ab5852c..61abb433 100644 --- a/robot/resources/test_templates/vnf_orchestration_with_cds_test_template.robot +++ b/robot/resources/test_templates/vnf_orchestration_with_cds_test_template.robot @@ -70,16 +70,17 @@ Orchestrate VNF With CDS ${vnfs}= Get From Dictionary ${jsondata['topology_template']} node_templates ${keys}= Get Dictionary Keys ${vnfs} Templating.Create Environment cds ${GLOBAL_TEMPLATE_FOLDER} - :FOR ${key} IN @{keys} - \ ${vnf}= Get From Dictionary ${vnfs} ${key} - \ Get VNF Info ${key} ${vnf} ${dict} - \ ${vf_modules}= Get From Dictionary ${jsondata['topology_template']} groups - \ ${value}= Evaluate "${key}".replace("-","").replace(" ","") - \ ${value}= Convert To Lowercase ${value} - \ ${vfmodules}= Get VFModule Info ${jsondata} ${value} ${dict} - \ Set To Dictionary ${dict} vf_modules=${vfmodules} - \ ${vnf_payload}= Templating.Apply Template cds ${vnf_template_name} ${dict} - \ ${data}= Catenate [${vnf_payload}] + FOR ${key} IN @{keys} + ${vnf}= Get From Dictionary ${vnfs} ${key} + Get VNF Info ${key} ${vnf} ${dict} + ${vf_modules}= Get From Dictionary ${jsondata['topology_template']} groups + ${value}= Evaluate "${key}".replace("-","").replace(" ","") + ${value}= Convert To Lowercase ${value} + ${vfmodules}= Get VFModule Info ${jsondata} ${value} ${dict} + Set To Dictionary ${dict} vf_modules=${vfmodules} + ${vnf_payload}= Templating.Apply Template cds ${vnf_template_name} ${dict} + ${data}= Catenate [${vnf_payload}] + END Set To Dictionary ${dict} vnfs=${data} ${request}= Templating.Apply Template cds ${so_request_template} ${dict} @@ -117,13 +118,14 @@ Get VFModule Info ${data}= Catenate ${delim}= Catenate Templating.Create Environment cds ${GLOBAL_TEMPLATE_FOLDER} - :FOR ${key} IN @{keys} - \ ${module}= Get From Dictionary ${vfModules} ${key} - \ Log ${vnf} ${key} - \ Run keyword if "${vnf}" in "${key}" set vfmodule param ${key} ${module} ${dict} - \ ${vfmodule_payload}= Templating.Apply Template cds ${vfmodule_template_name} ${dict} - \ ${data}= Catenate ${data} ${delim} ${vfmodule_payload} - \ ${delim}= Catenate , + FOR ${key} IN @{keys} + ${module}= Get From Dictionary ${vfModules} ${key} + Log ${vnf} ${key} + Run keyword if "${vnf}" in "${key}" set vfmodule param ${key} ${module} ${dict} + ${vfmodule_payload}= Templating.Apply Template cds ${vfmodule_template_name} ${dict} + ${data}= Catenate ${data} ${delim} ${vfmodule_payload} + ${delim}= Catenate , + END Log ${data} [Return] ${data} diff --git a/robot/resources/test_templates/vnfsdk_validation_template.robot b/robot/resources/test_templates/vnfsdk_validation_template.robot index 0926905d..1fb20088 100644 --- a/robot/resources/test_templates/vnfsdk_validation_template.robot +++ b/robot/resources/test_templates/vnfsdk_validation_template.robot @@ -130,9 +130,10 @@ Validate Not Valid Onboarding Package Should Be Equal As Strings ${status} FAILED ${status_req_list}= Set Variable ${json[0]['results']['results']} ${failed_req_from_test_run}= Create List - :FOR ${status_req} IN @{status_req_list} - \ ${req_status}= Get From Dictionary ${status_req} passed - \ Run Keyword If "${req_status}"=='False' Add Failed Requirement To List ${status_req} ${failed_req_from_test_run} vnfreqName + FOR ${status_req} IN @{status_req_list} + ${req_status}= Get From Dictionary ${status_req} passed + Run Keyword If "${req_status}"=='False' Add Failed Requirement To List ${status_req} ${failed_req_from_test_run} vnfreqName + END Log ${failed_req_from_test_run} Sort List ${failed_req_from_test_run} Sort List ${failed_req_list} @@ -148,9 +149,10 @@ Get And Comapre Error Responses From SDC API ${json}= Set Variable ${resp.json()} ${sdc_response_list} Set Variable ${json['errors']['uploadFile']} ${failed_req_from_test_run}= Create List - :FOR ${message_item} IN @{sdc_response_list} - \ ${req_status}= Get From Dictionary ${message_item} level - \ Run Keyword If "${req_status}"=='ERROR' Add Failed Requirement To List ${message_item} ${failed_req_from_test_run} message + FOR ${message_item} IN @{sdc_response_list} + ${req_status}= Get From Dictionary ${message_item} level + Run Keyword If "${req_status}"=='ERROR' Add Failed Requirement To List ${message_item} ${failed_req_from_test_run} message + END Log ${failed_req_from_test_run} Sort List ${sdc_response} Sort List ${failed_req_from_test_run} |