diff options
29 files changed, 605 insertions, 518 deletions
diff --git a/robot/resources/aai/create_customer.robot b/robot/resources/aai/create_customer.robot index c51048c9..d9397218 100644 --- a/robot/resources/aai/create_customer.robot +++ b/robot/resources/aai/create_customer.robot @@ -42,8 +42,9 @@ Get OwningEntity Id ${resp_json}= Set Variable ${resp.json()} @{list}= Copy List ${resp_json['owning-entity']} ${id}= Set Variable - :FOR ${map} IN @{list} - \ ${owning_entity_name}= Get From Dictionary ${map} owning-entity-name - \ ${owning_entity_id}= Get From Dictionary ${map} owning-entity-id - \ ${id} Run Keyword If '${owning_entity_name}' == '${name}' Set Variable ${owning_entity_id} - [Return] ${id}
\ No newline at end of file + FOR ${map} IN @{list} + ${owning_entity_name}= Get From Dictionary ${map} owning-entity-name + ${owning_entity_id}= Get From Dictionary ${map} owning-entity-id + ${id} Run Keyword If '${owning_entity_name}' == '${name}' Set Variable ${owning_entity_id} + END + [Return] ${id}
\ No newline at end of file diff --git a/robot/resources/aai/create_service.robot b/robot/resources/aai/create_service.robot index 43764849..5a8add73 100644 --- a/robot/resources/aai/create_service.robot +++ b/robot/resources/aai/create_service.robot @@ -66,16 +66,18 @@ Get Service Id ${resp_json}= Set Variable ${resp.json()} ${id}= Set Variable @{list}= Copy List ${resp_json['service']} - :FOR ${map} IN @{list} - \ ${service_type}= Get From Dictionary ${map} service-description - \ ${service_id}= Get From Dictionary ${map} service-id - \ ${id} Run Keyword If '${service_type}' == '${service_description}' Set Variable ${service_id} - [Return] ${id} + FOR ${map} IN @{list} + ${service_type}= Get From Dictionary ${map} service-description + ${service_id}= Get From Dictionary ${map} service-id + ${id} Run Keyword If '${service_type}' == '${service_description}' Set Variable ${service_id} + END + [Return] ${id} Update Service Dictionary [Arguments] ${dict} ${json} @{list}= Copy List ${json['service']} - :FOR ${map} IN @{list} - \ ${status} ${service_type}= Run Keyword And Ignore Error Get From Dictionary ${map} service-description - \ Run Keyword If '${status}' == 'PASS' Set To Dictionary ${dict} ${service_type}=${map} + FOR ${map} IN @{list} + ${status} ${service_type}= Run Keyword And Ignore Error Get From Dictionary ${map} service-description + Run Keyword If '${status}' == 'PASS' Set To Dictionary ${dict} ${service_type}=${map} + END Log ${dict}
\ No newline at end of file diff --git a/robot/resources/aai/create_tenant.robot b/robot/resources/aai/create_tenant.robot index 5dc34536..4f6f9e8f 100644 --- a/robot/resources/aai/create_tenant.robot +++ b/robot/resources/aai/create_tenant.robot @@ -85,7 +85,8 @@ Get Cloud Region Update Tenant Dictionary [Arguments] ${dict} ${json} @{list}= Copy List ${json['tenant']} - :FOR ${map} IN @{list} - \ ${status} ${tenant_id}= Run Keyword And Ignore Error Get From Dictionary ${map} tenant-id - \ Run Keyword If '${status}' == 'PASS' Set To Dictionary ${dict} ${tenant_id}=${map} + FOR ${map} IN @{list} + ${status} ${tenant_id}= Run Keyword And Ignore Error Get From Dictionary ${map} tenant-id + Run Keyword If '${status}' == 'PASS' Set To Dictionary ${dict} ${tenant_id}=${map} + END Log ${dict} diff --git a/robot/resources/demo_preload.robot b/robot/resources/demo_preload.robot index f2bba38b..a6ae451f 100644 --- a/robot/resources/demo_preload.robot +++ b/robot/resources/demo_preload.robot @@ -101,10 +101,11 @@ Preload User Model ${relationships}= Set Variable ${generic_vnf['relationship-list']['relationship']} ${relationship_data}= Get Relationship Data ${relationships} ${customer_id}= Catenate - :FOR ${r} IN @{relationship_data} - \ ${service}= Set Variable If '${r['relationship-key']}' == 'service-subscription.service-type' ${r['relationship-value']} ${service} - \ ${service_instance_id}= Set Variable If '${r['relationship-key']}' == 'service-instance.service-instance-id' ${r['relationship-value']} ${service_instance_id} - \ ${customer_id}= Set Variable If '${r['relationship-key']}' == 'customer.global-customer-id' ${r['relationship-value']} ${customer_id} + FOR ${r} IN @{relationship_data} + ${service}= Set Variable If '${r['relationship-key']}' == 'service-subscription.service-type' ${r['relationship-value']} ${service} + ${service_instance_id}= Set Variable If '${r['relationship-key']}' == 'service-instance.service-instance-id' ${r['relationship-value']} ${service_instance_id} + ${customer_id}= Set Variable If '${r['relationship-key']}' == 'customer.global-customer-id' ${r['relationship-value']} ${customer_id} + END ${invariantUUID}= Get Persona Model Id ${service_instance_id} ${service} ${customer_id} # We still need the vf module names. We can get them from VID using the persona_model_id (invariantUUID) from A&AI @@ -126,10 +127,11 @@ Preload User Model GRA ${relationships}= Set Variable ${generic_vnf['relationship-list']['relationship']} ${relationship_data}= Get Relationship Data ${relationships} ${customer_id}= Catenate - :FOR ${r} IN @{relationship_data} - \ ${service}= Set Variable If '${r['relationship-key']}' == 'service-subscription.service-type' ${r['relationship-value']} ${service} - \ ${service_instance_id}= Set Variable If '${r['relationship-key']}' == 'service-instance.service-instance-id' ${r['relationship-value']} ${service_instance_id} - \ ${customer_id}= Set Variable If '${r['relationship-key']}' == 'customer.global-customer-id' ${r['relationship-value']} ${customer_id} + FOR ${r} IN @{relationship_data} + ${service}= Set Variable If '${r['relationship-key']}' == 'service-subscription.service-type' ${r['relationship-value']} ${service} + ${service_instance_id}= Set Variable If '${r['relationship-key']}' == 'service-instance.service-instance-id' ${r['relationship-value']} ${service_instance_id} + ${customer_id}= Set Variable If '${r['relationship-key']}' == 'customer.global-customer-id' ${r['relationship-value']} ${customer_id} + END ${invariantUUID}= Get Persona Model Id ${service_instance_id} ${service} ${customer_id} # We still need the vf module names. We can get them from VID using the persona_model_id (invariantUUID) from A&AI @@ -144,10 +146,10 @@ Preload User Model GRA Get Relationship Data [Arguments] ${relationships} - :FOR ${r} IN @{relationships} - \ ${status} ${relationship_data} Run Keyword And Ignore Error Set Variable ${r['relationship-data']} - \ Return From Keyword If '${status}' == 'PASS' ${relationship_data} - + FOR ${r} IN @{relationships} + ${status} ${relationship_data} Run Keyword And Ignore Error Set Variable ${r['relationship-data']} + Return From Keyword If '${status}' == 'PASS' ${relationship_data} + END Get Generic VNF By ID [Arguments] ${vnf_id} @@ -175,14 +177,16 @@ Instantiate VNF ${vf_module_name_list} ${generic_vnfs} ${server_id} ${service_instance_id} ${catalog_resource_ids} ${catalog_service_id} ${uris_to_delete}= Orchestrate VNF DemoCust_${uuid} ${service} ${service} ${tenant_id} ${tenant_name} ${stack_name} = Get From List ${vf_module_name_list} -1 Save For Delete ${tenant_id} ${tenant_name} ${server_id} DemoCust_${uuid} ${service_instance_id} ${stack_name} ${catalog_service_id} ${catalog_resource_ids} - :FOR ${vf_module_name} IN @{vf_module_name_list} - \ Log VNF Module Name=${vf_module_name} + FOR ${vf_module_name} IN @{vf_module_name_list} + Log VNF Module Name=${vf_module_name} + END # Don't get from SO for now due to SO-1186 # ${model_invariant_id}= Run SO Get ModelInvariantId ${suite_service_model_name} ${vf_module_label} ${model_invariant_id}= Set Variable ${EMPTY} - :FOR ${vf_module} IN @{generic_vnfs} - \ ${generic_vnf}= Get From Dictionary ${generic_vnfs} ${vf_module} - \ ${model_invariant_id}= Set Variable If '${vf_module_label}' in '${vf_module}' ${generic_vnf['model-invariant-id']} ${model_invariant_id} + FOR ${vf_module} IN @{generic_vnfs} + ${generic_vnf}= Get From Dictionary ${generic_vnfs} ${vf_module} + ${model_invariant_id}= Set Variable If '${vf_module_label}' in '${vf_module}' ${generic_vnf['model-invariant-id']} ${model_invariant_id} + END Log Update old vFWCL Policy for ModelInvariantID=${model_invariant_id} ${status} ${value}= Run Keyword And Ignore Error Update vFWCL Operational and Monitoring Policies ${model_invariant_id} Log Update Tca ControlLoopName @@ -206,9 +210,10 @@ Instantiate Demo VNF # Don't get from SO for now due to SO-1186 # ${model_invariant_id}= Run SO Get ModelInvariantId ${suite_service_model_name} ${vf_module_label} ${model_invariant_id}= Set Variable ${EMPTY} - :FOR ${vf_module} IN @{generic_vnfs} - \ ${generic_vnf}= Get From Dictionary ${generic_vnfs} ${vf_module} - \ ${model_invariant_id}= Set Variable If '${vf_module_label}' in '${vf_module}' ${generic_vnf['model-invariant-id']} ${model_invariant_id} + FOR ${vf_module} IN @{generic_vnfs} + ${generic_vnf}= Get From Dictionary ${generic_vnfs} ${vf_module} + ${model_invariant_id}= Set Variable If '${vf_module_label}' in '${vf_module}' ${generic_vnf['model-invariant-id']} ${model_invariant_id} + END Log ModelInvariantID=${model_invariant_id} ${status} ${value}= Run Keyword And Ignore Error Update vFWCL Operational and Monitoring Policies ${model_invariant_id} @@ -226,15 +231,16 @@ Save For Delete ${vars}= Catenate ${keys}= Get Dictionary Keys ${dict} - :FOR ${key} IN @{keys} - \ ${value}= Get From Dictionary ${dict} ${key} - \ ${vars}= Catenate ${vars}${key} = "${value}"\n - + FOR ${key} IN @{keys} + ${value}= Get From Dictionary ${dict} ${key} + ${vars}= Catenate ${vars}${key} = "${value}"\n + END ${comma}= Catenate ${vars}= Catenate ${vars}CATALOG_RESOURCE_IDS = [ - :FOR ${id} IN @{catalog_resource_ids} - \ ${vars}= Catenate ${vars}${comma} "${id}" - \ ${comma}= Catenate , + FOR ${id} IN @{catalog_resource_ids} + ${vars}= Catenate ${vars}${comma} "${id}" + ${comma}= Catenate , + END ${vars}= Catenate ${vars}]\n OperatingSystem.Create File ${FILE_CACHE}/${stack_name}.py ${vars} OperatingSystem.Create File ${FILE_CACHE}/lastVNF4HEATBRIGE.py ${vars} diff --git a/robot/resources/openstack/keystone_interface.robot b/robot/resources/openstack/keystone_interface.robot index 7dd094bf..487d8aff 100644 --- a/robot/resources/openstack/keystone_interface.robot +++ b/robot/resources/openstack/keystone_interface.robot @@ -54,9 +54,10 @@ Get KeystoneAPIVersion Should Be Equal As Strings ${resp.status_code} 300 ${versions}= Get From Dictionary ${resp.json()} versions ${values}= Get From Dictionary ${versions} values - :FOR ${value} IN @{values} - \ ${status}= Get Variable Value ${value["status"]} - \ Run Keyword If '${status}'=='stable' Exit For Loop + FOR ${value} IN @{values} + ${status}= Get Variable Value ${value["status"]} + Run Keyword If '${status}'=='stable' Exit For Loop + END ${href}= Set Variable ${value["links"][0]["href"]} ${keystone}= Set Variable ${GLOBAL_INJECTED_KEYSTONE} ${version}= Remove String ${href} ${keystone} / diff --git a/robot/resources/openstack/neutron_interface.robot b/robot/resources/openstack/neutron_interface.robot index b216a4d5..74ca5724 100644 --- a/robot/resources/openstack/neutron_interface.robot +++ b/robot/resources/openstack/neutron_interface.robot @@ -86,20 +86,22 @@ Get Openstack Subnet By Name ${resp}= Get Openstack Subnets ${alias} @{list}= Get From Dictionary ${resp} subnets ${returnnet}= Set Variable - :FOR ${net} IN @{list} - \ ${name}= Get From Dictionary ${net} name - \ ${cidr}= Get From Dictionary ${net} cidr - \ ${returnnet}= Set Variable ${net} - \ Exit For Loop If '${name}'=='${network_name}' and '${cidr}'=='${network_cidr}' - \ ${returnnet}= Create DIctionary + FOR ${net} IN @{list} + ${name}= Get From Dictionary ${net} name + ${cidr}= Get From Dictionary ${net} cidr + ${returnnet}= Set Variable ${net} + Exit For Loop If '${name}'=='${network_name}' and '${cidr}'=='${network_cidr}' + ${returnnet}= Create DIctionary + END [Return] ${returnnet} Get Openstack IP By Name [Arguments] ${alias} ${network_name} ${cidr} ${ip} ${ports}= Get Openstack Ports For Subnet ${alias} ${network_name} ${cidr} Log ${ports} - :FOR ${port} IN @{ports} - \ Return From Keyword If '${port['fixed_ips'][0]['ip_address']}' == '${ip}' ${port} + FOR ${port} IN @{ports} + Return From Keyword If '${port['fixed_ips'][0]['ip_address']}' == '${ip}' ${port} + END [Return] None Get Openstack Ports For Subnet @@ -107,8 +109,9 @@ Get Openstack Ports For Subnet ${net}= Get Openstack Subnet By Name ${alias} ${network_name} ${cidr} ${ports}= Get Openstack Ports ${alias} ${net_ports}= Create List - :FOR ${port} IN @{ports['ports']} - \ Run Keyword If '${net['network_id']}' == '${port['network_id']}' Append To List ${net_ports} ${port} + FOR ${port} IN @{ports['ports']} + Run Keyword If '${net['network_id']}' == '${port['network_id']}' Append To List ${net_ports} ${port} + END [Return] ${net_ports} Get Openstack Port By Id diff --git a/robot/resources/openstack/nova_interface.robot b/robot/resources/openstack/nova_interface.robot index 55b3467e..b7002d32 100644 --- a/robot/resources/openstack/nova_interface.robot +++ b/robot/resources/openstack/nova_interface.robot @@ -132,8 +132,9 @@ Delete Server Get Id For Name [Arguments] ${list} ${name} - :FOR ${item} IN @{list} - \ ${id}= Get From Dictionary ${item} id - \ ${n}= Get From Dictionary ${item} name - \ Return from Keyword If '${n}' == '${name}' ${id} + FOR ${item} IN @{list} + ${id}= Get From Dictionary ${item} id + ${n}= Get From Dictionary ${item} name + Return from Keyword If '${n}' == '${name}' ${id} + END [Return] None diff --git a/robot/resources/sdc_interface.robot b/robot/resources/sdc_interface.robot index 840e604c..421fa354 100644 --- a/robot/resources/sdc_interface.robot +++ b/robot/resources/sdc_interface.robot @@ -86,27 +86,28 @@ Distribute Model From SDC # Add Resource to Service in a separate FOR loop ${resource_types}= Create Dictionary - :FOR ${zip} IN @{model_zip_path} - \ ${loop_catalog_resource_id}= Setup SDC Catalog Resource ${zip} ${cds} ${resourceType} + FOR ${zip} IN @{model_zip_path} + ${loop_catalog_resource_id}= Setup SDC Catalog Resource ${zip} ${cds} ${resourceType} # zip can be vFW.zip or vFWDT_VFWSNK.zip - \ ${resource_type_match}= Run Keyword If "${resourceType}"=='PNF' Get Regexp Matches ${zip} ${service}_(.*)\.csar 1 + ${resource_type_match}= Run Keyword If "${resourceType}"=='PNF' Get Regexp Matches ${zip} ${service}_(.*)\.csar 1 ... ELSE Get Regexp Matches ${zip} ${service}_(.*)\.zip 1 # Need to be able to distribute preload for vFWCL vFWSNK and vFWDT vFWSNK to prepend service to vnf_type - \ ${resource_type_string}= Set Variable If len(${resource_type_match})==0 ${service} ${service}${resource_type_match[0]} - \ Set To Dictionary ${resource_types} ${resource_type_string} ${loop_catalog_resource_id} - \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id} - + ${resource_type_string}= Set Variable If len(${resource_type_match})==0 ${service} ${service}${resource_type_match[0]} + Set To Dictionary ${resource_types} ${resource_type_string} ${loop_catalog_resource_id} + Append To List ${catalog_resource_ids} ${loop_catalog_resource_id} + END ServiceMapping.Set Directory default ${GLOBAL_SERVICE_MAPPING_DIRECTORY} ${vnflist}= ServiceMapping.Get Service Vnf Mapping default ${service} # Spread the icons on the pallette starting on the left ${xoffset}= Set Variable ${0} - :FOR ${vnf} IN @{vnflist} - \ ${loop_catalog_resource_resp}= Get SDC Catalog Resource ${resource_types['${vnf}']} - \ Set To Dictionary ${catalog_resources} ${resource_types['${vnf}']}=${loop_catalog_resource_resp} - \ ${catalog_resource_unique_name} ${catalog_resource_name} Add SDC Resource Instance ${catalog_service_id} ${resource_types['${vnf}']} ${loop_catalog_resource_resp['name']} ${xoffset} resourceType=${resourceType} - \ ${xoffset}= Set Variable ${xoffset+100} + FOR ${vnf} IN @{vnflist} + ${loop_catalog_resource_resp}= Get SDC Catalog Resource ${resource_types['${vnf}']} + Set To Dictionary ${catalog_resources} ${resource_types['${vnf}']}=${loop_catalog_resource_resp} + ${catalog_resource_unique_name} ${catalog_resource_name} Add SDC Resource Instance ${catalog_service_id} ${resource_types['${vnf}']} ${loop_catalog_resource_resp['name']} ${xoffset} resourceType=${resourceType} + ${xoffset}= Set Variable ${xoffset+100} + END # # do this here because the loop_catalog_resource_resp is different format after adding networks ${vf_module}= Run Keyword If "${resourceType}"=='PNF' Set Variable It is PNF @@ -115,33 +116,36 @@ Distribute Model From SDC # do network ${networklist}= ServiceMapping.Get Service Neutron Mapping default ${service} ${generic_neutron_net_uuid}= Get Generic NeutronNet UUID - :FOR ${network} IN @{networklist} - \ ${loop_catalog_resource_id}= Set Variable ${generic_neutron_net_uuid} - \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id} - \ ${loop_catalog_resource_resp}= Get SDC Catalog Resource ${loop_catalog_resource_id} - \ ${loop_catalog_resource_id} ${loop_catalog_resource_name} Add SDC Resource Instance ${catalog_service_id} ${loop_catalog_resource_id} ${network} ${xoffset} ${0} VL - \ ${nf_role}= Convert To Lowercase ${network} - \ Setup SDC Catalog Resource GenericNeutronNet Properties ${catalog_service_id} ${nf_role} ${loop_catalog_resource_id} - \ ${xoffset}= Set Variable ${xoffset+100} - \ Set To Dictionary ${catalog_resources} ${loop_catalog_resource_id}=${loop_catalog_resource_resp} + FOR ${network} IN @{networklist} + ${loop_catalog_resource_id}= Set Variable ${generic_neutron_net_uuid} + Append To List ${catalog_resource_ids} ${loop_catalog_resource_id} + ${loop_catalog_resource_resp}= Get SDC Catalog Resource ${loop_catalog_resource_id} + ${loop_catalog_resource_id} ${loop_catalog_resource_name} Add SDC Resource Instance ${catalog_service_id} ${loop_catalog_resource_id} ${network} ${xoffset} ${0} VL + ${nf_role}= Convert To Lowercase ${network} + Setup SDC Catalog Resource GenericNeutronNet Properties ${catalog_service_id} ${nf_role} ${loop_catalog_resource_id} + ${xoffset}= Set Variable ${xoffset+100} + Set To Dictionary ${catalog_resources} ${loop_catalog_resource_id}=${loop_catalog_resource_resp} + END ${catalog_service_resp}= Get SDC Catalog Service ${catalog_service_id} # # do deployment artifacts # ${deploymentlist}= ServiceMapping.Get Service Deployment Artifact Mapping default ${service} - :FOR ${deployment} IN @{deploymentlist} - \ ${loop_catalog_resource_resp}= Get SDC Catalog Resource ${loop_catalog_resource_id} - \ Setup SDC Catalog Resource Deployment Artifact Properties ${catalog_service_id} ${loop_catalog_resource_resp} ${catalog_resource_unique_name} ${deployment} + FOR ${deployment} IN @{deploymentlist} + ${loop_catalog_resource_resp}= Get SDC Catalog Resource ${loop_catalog_resource_id} + Setup SDC Catalog Resource Deployment Artifact Properties ${catalog_service_id} ${loop_catalog_resource_resp} ${catalog_resource_unique_name} ${deployment} + END Run Keyword If ${cds} == True Add CDS Parameters ${catalog_service_name} Checkin SDC Catalog Service ${catalog_service_id} # on certify it gets a new id ${catalog_service_id}= Wait Until Keyword Succeeds 60s 10s Certify SDC Catalog Service ${catalog_service_id} - :FOR ${DIST_INDEX} IN RANGE 1 - \ Log Distribution Attempt ${DIST_INDEX} - \ Distribute SDC Catalog Service ${catalog_service_id} - \ ${catalog_service_resp}= Get SDC Catalog Service ${catalog_service_id} - \ ${status} ${_} = Run Keyword And Ignore Error Loop Over Check Catalog Service Distributed ${catalog_service_resp['uuid']} - \ Exit For Loop If '${status}'=='PASS' + FOR ${DIST_INDEX} IN RANGE 1 + Log Distribution Attempt ${DIST_INDEX} + Distribute SDC Catalog Service ${catalog_service_id} + ${catalog_service_resp}= Get SDC Catalog Service ${catalog_service_id} + ${status} ${_} = Run Keyword And Ignore Error Loop Over Check Catalog Service Distributed ${catalog_service_resp['uuid']} + Exit For Loop If '${status}'=='PASS' + END Should Be Equal As Strings ${status} PASS [Return] ${catalog_service_resp['name']} ${loop_catalog_resource_resp['name']} ${vf_module} ${catalog_resource_ids} ${catalog_service_id} ${catalog_resources} @@ -159,12 +163,13 @@ Distribute vCPEResCust Model From SDC #${catalog_service_id}= Add SDC Catalog Service ${catalog_service_name} ${catalog_resource_ids}= Create List ${catalog_resources}= Create Dictionary - :FOR ${zip} IN @{model_zip_path} - \ ${loop_catalog_resource_id}= Setup SDC Catalog Resource ${zip} ${cds} - \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id} - \ ${loop_catalog_resource_resp}= Get SDC Catalog Resource ${loop_catalog_resource_id} - \ Add SDC Resource Instance ${catalog_service_id} ${loop_catalog_resource_id} ${loop_catalog_resource_resp['name']} - \ Set To Dictionary ${catalog_resources} ${loop_catalog_resource_id}=${loop_catalog_resource_resp} + FOR ${zip} IN @{model_zip_path} + ${loop_catalog_resource_id}= Setup SDC Catalog Resource ${zip} ${cds} + Append To List ${catalog_resource_ids} ${loop_catalog_resource_id} + ${loop_catalog_resource_resp}= Get SDC Catalog Resource ${loop_catalog_resource_id} + Add SDC Resource Instance ${catalog_service_id} ${loop_catalog_resource_id} ${loop_catalog_resource_resp['name']} + Set To Dictionary ${catalog_resources} ${loop_catalog_resource_id}=${loop_catalog_resource_resp} + END # # do this here because the loop_catalog_resource_resp is different format after adding networks ${vf_module}= Find Element In Array ${loop_catalog_resource_resp['groups']} type org.openecomp.groups.VfModule @@ -189,35 +194,37 @@ Distribute vCPEResCust Model From SDC ${xoffset}= Set Variable ${100} ${allottedresource_uuid}= Get AllottedResource UUID ${random}= Get Current Date - :FOR ${allottedresource} IN @{allottedresource_list} - \ ${loop_catalog_resource_id}= Set Variable ${allottedresource_uuid} - \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id} - \ ${loop_catalog_resource_id}= Add SDC Allotted Resource Catalog Resource 00000 ${allottedresource}_${random} ONAP ${loop_catalog_resource_id} ${allottedresource} - \ ${loop_catalog_resource_id2}= Add SDC Resource Instance To Resource ${loop_catalog_resource_id} ${allottedresource_uuid} ${allottedresource} ${xoffset} ${0} - \ ${loop_catalog_resource_resp}= Get SDC Catalog Resource ${loop_catalog_resource_id} + FOR ${allottedresource} IN @{allottedresource_list} + ${loop_catalog_resource_id}= Set Variable ${allottedresource_uuid} + Append To List ${catalog_resource_ids} ${loop_catalog_resource_id} + ${loop_catalog_resource_id}= Add SDC Allotted Resource Catalog Resource 00000 ${allottedresource}_${random} ONAP ${loop_catalog_resource_id} ${allottedresource} + ${loop_catalog_resource_id2}= Add SDC Resource Instance To Resource ${loop_catalog_resource_id} ${allottedresource_uuid} ${allottedresource} ${xoffset} ${0} + ${loop_catalog_resource_resp}= Get SDC Catalog Resource ${loop_catalog_resource_id} # # Set the properties to relate to the brg and gmux # - \ Run Keyword If '${allottedresource}'=='TunnelXConn' Setup SDC Catalog Resource AllottedResource Properties ${catalog_service_id} ${allottedresource} ${loop_catalog_resource_id} ${tunnelxconn_dict['invariantUUID']} ${tunnelxconn_dict['UUID']} ${tunnelxconn_dict['node_type']} - \ Run Keyword If '${allottedresource}'=='BRG' Setup SDC Catalog Resource AllottedResource Properties ${catalog_service_id} ${allottedresource} ${loop_catalog_resource_id} ${brg_dict['invariantUUID']} ${brg_dict['UUID']} ${brg_dict['node_type']} + Run Keyword If '${allottedresource}'=='TunnelXConn' Setup SDC Catalog Resource AllottedResource Properties ${catalog_service_id} ${allottedresource} ${loop_catalog_resource_id} ${tunnelxconn_dict['invariantUUID']} ${tunnelxconn_dict['UUID']} ${tunnelxconn_dict['node_type']} + Run Keyword If '${allottedresource}'=='BRG' Setup SDC Catalog Resource AllottedResource Properties ${catalog_service_id} ${allottedresource} ${loop_catalog_resource_id} ${brg_dict['invariantUUID']} ${brg_dict['UUID']} ${brg_dict['node_type']} # # Set the nf_role nf_type # - \ Run Keyword If '${allottedresource}'=='TunnelXConn' Setup SDC Catalog Resource AllottedResource Inputs ${catalog_service_id} ${allottedresource} ${loop_catalog_resource_id} - \ Run Keyword If '${allottedresource}'=='BRG' Setup SDC Catalog Resource AllottedResource Inputs ${catalog_service_id} ${allottedresource} ${loop_catalog_resource_id} - \ ${loop_catalog_resource_id} ${loop_catalog_resource_uuid} Wait Until Keyword Succeeds 60s 10s Certify SDC Catalog Resource ${loop_catalog_resource_id} ${SDC_DESIGNER_USER_ID} - \ Add SDC Resource Instance ${catalog_service_id} ${loop_catalog_resource_id} ${loop_catalog_resource_resp['name']} - \ Set To Dictionary ${catalog_resources} ${loop_catalog_resource_id}=${loop_catalog_resource_resp} + Run Keyword If '${allottedresource}'=='TunnelXConn' Setup SDC Catalog Resource AllottedResource Inputs ${catalog_service_id} ${allottedresource} ${loop_catalog_resource_id} + Run Keyword If '${allottedresource}'=='BRG' Setup SDC Catalog Resource AllottedResource Inputs ${catalog_service_id} ${allottedresource} ${loop_catalog_resource_id} + ${loop_catalog_resource_id} ${loop_catalog_resource_uuid} Wait Until Keyword Succeeds 60s 10s Certify SDC Catalog Resource ${loop_catalog_resource_id} ${SDC_DESIGNER_USER_ID} + Add SDC Resource Instance ${catalog_service_id} ${loop_catalog_resource_id} ${loop_catalog_resource_resp['name']} + Set To Dictionary ${catalog_resources} ${loop_catalog_resource_id}=${loop_catalog_resource_resp} + END ${catalog_service_resp}= Get SDC Catalog Service ${catalog_service_id} Checkin SDC Catalog Service ${catalog_service_id} # on certify it gets a new id ${catalog_service_id}= Wait Until Keyword Succeeds 60s 10s Certify SDC Catalog Service ${catalog_service_id} - :FOR ${DIST_INDEX} IN RANGE 1 - \ Log Distribution Attempt ${DIST_INDEX} - \ Distribute SDC Catalog Service ${catalog_service_id} - \ ${catalog_service_resp}= Get SDC Catalog Service ${catalog_service_id} - \ ${status} ${_} = Run Keyword And Ignore Error Loop Over Check Catalog Service Distributed ${catalog_service_resp['uuid']} - \ Exit For Loop If '${status}'=='PASS' + FOR ${DIST_INDEX} IN RANGE 1 + Log Distribution Attempt ${DIST_INDEX} + Distribute SDC Catalog Service ${catalog_service_id} + ${catalog_service_resp}= Get SDC Catalog Service ${catalog_service_id} + ${status} ${_} = Run Keyword And Ignore Error Loop Over Check Catalog Service Distributed ${catalog_service_resp['uuid']} + Exit For Loop If '${status}'=='PASS' + END Should Be Equal As Strings ${status} PASS [Return] ${catalog_service_resp['name']} ${loop_catalog_resource_resp['name']} ${vf_module} ${catalog_resource_ids} ${catalog_service_id} ${catalog_resources} @@ -229,18 +236,19 @@ Create Allotted Resource Data File Set To Dictionary ${allotted_csar_map} tunnelxconn=service-Demovcpevgmux-csar.csar Set To Dictionary ${allotted_csar_map} brg=service-Demovcpevbrgemu-csar.csar ${keys}= Get Dictionary Keys ${allotted_csar_map} - :FOR ${key} IN @{keys} - \ ${csar}= Get From Dictionary ${allotted_csar_map} ${key} - \ ${dir} ${ext}= Split String From Right ${csar} - 1 - \ Extract Zip File /share/logs/csars/${csar} /share/logs/csars/${dir} - \ ${template}= Catenate /share/logs/csars/${dir}/Definitions/${dir}-template.yml - \ ${json_str}= Template Yaml To Json ${template} - \ ${json_obj}= To Json ${json_str} - \ ${attrs}= Create Dictionary - \ Set To Dictionary ${attrs} invariantUUID=${json_obj['metadata']['invariantUUID']} - \ Set To Dictionary ${attrs} UUID=${json_obj['metadata']['UUID']} - \ Set To Dictionary ${attrs} node_type=${json_obj['topology_template']['substitution_mappings']['node_type']} - \ Set To Dictionary ${allotted_resource} ${key}=${attrs} + FOR ${key} IN @{keys} + ${csar}= Get From Dictionary ${allotted_csar_map} ${key} + ${dir} ${ext}= Split String From Right ${csar} - 1 + Extract Zip File /share/logs/csars/${csar} /share/logs/csars/${dir} + ${template}= Catenate /share/logs/csars/${dir}/Definitions/${dir}-template.yml + ${json_str}= Template Yaml To Json ${template} + ${json_obj}= To Json ${json_str} + ${attrs}= Create Dictionary + Set To Dictionary ${attrs} invariantUUID=${json_obj['metadata']['invariantUUID']} + Set To Dictionary ${attrs} UUID=${json_obj['metadata']['UUID']} + Set To Dictionary ${attrs} node_type=${json_obj['topology_template']['substitution_mappings']['node_type']} + Set To Dictionary ${allotted_resource} ${key}=${attrs} + END ${result_str}= Evaluate json.dumps(${allotted_resource}, indent=2) json Log ${result_str} Create File /tmp/vcpe_allotted_resource_data.json ${result_str} @@ -280,12 +288,13 @@ Loop Over Check Catalog Service Distributed [Arguments] ${catalog_service_id} # SO watchdog timeout is 300 seconds need buffer ${dist_status}= Set Variable CONTINUE - :FOR ${CHECK_INDEX} IN RANGE 20 - \ ${status} ${_} = Run Keyword And Ignore Error Check Catalog Service Distributed ${catalog_service_id} ${dist_status} - \ Sleep 20s - \ Return From Keyword If '${status}'=='PASS' + FOR ${CHECK_INDEX} IN RANGE 20 + ${status} ${_} = Run Keyword And Ignore Error Check Catalog Service Distributed ${catalog_service_id} ${dist_status} + Sleep 20s + Return From Keyword If '${status}'=='PASS' # need a way to exit the loop early on DISTRIBUTION_COMPLETE_ERROR ${dist_status} doesnt work #\ Exit For Loop If '${dist_status}'=='EXIT' + END Should Be Equal As Strings ${status} PASS Setup SDC Catalog Resource @@ -344,25 +353,26 @@ Setup SDC Catalog Resource GenericNeutronNet Properties ${type}= Run Keyword If ${passed} Evaluate type(${componentInstances}) ${componentInstancesList}= Run Keyword If "${type}"!="<type 'list'>" Create List ${componentInstances} ... ELSE Set Variable ${componentInstances} - :FOR ${item} IN @{componentInstancesList} - \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${item} ${nf_role} - \ Run Keyword If '${test}' == 'FAIL' Continue For Loop - \ ${componentInstance1}= Set Variable ${item} - :FOR ${comp} IN @{resp['componentInstancesProperties']["${componentInstance1}"]} - \ ${name} Set Variable ${comp['name']} - \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${name} network_role - \ Run Keyword If '${test}' == 'FAIL' Continue For Loop - \ ${description} Set Variable ${comp['description']} - \ ${description}= Replace String ${description} ${\n} \ - \ ${uniqueId} Set Variable ${comp['uniqueId']} - \ ${parentUniqueId} Set Variable ${comp['parentUniqueId']} - \ ${ownerId} Set Variable ${comp['ownerId']} - \ ${dict}= Create Dictionary parentUniqueId=${parentUniqueId} ownerId=${ownerId} uniqueId=${uniqueId} description=${description} - \ Run Keyword If '${name}'=='network_role' Set To Dictionary ${dict} name=${name} value=${nf_role} - \ Templating.Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER} - \ ${data}= Templating.Apply Template sdc ${SDC_CATALOG_NET_RESOURCE_INPUT_TEMPLATE} ${dict} - \ ${response}= Set SDC Catalog Resource Component Instance Properties ${catalog_parent_service_id} ${catalog_service_id} ${data} - + FOR ${item} IN @{componentInstancesList} + ${test} ${v}= Run Keyword and Ignore Error Should Contain ${item} ${nf_role} + Run Keyword If '${test}' == 'FAIL' Continue For Loop + ${componentInstance1}= Set Variable ${item} + END + FOR ${comp} IN @{resp['componentInstancesProperties']["${componentInstance1}"]} + ${name} Set Variable ${comp['name']} + ${test} ${v}= Run Keyword and Ignore Error Should Contain ${name} network_role + Run Keyword If '${test}' == 'FAIL' Continue For Loop + ${description} Set Variable ${comp['description']} + ${description}= Replace String ${description} ${\n} \ + ${uniqueId} Set Variable ${comp['uniqueId']} + ${parentUniqueId} Set Variable ${comp['parentUniqueId']} + ${ownerId} Set Variable ${comp['ownerId']} + ${dict}= Create Dictionary parentUniqueId=${parentUniqueId} ownerId=${ownerId} uniqueId=${uniqueId} description=${description} + Run Keyword If '${name}'=='network_role' Set To Dictionary ${dict} name=${name} value=${nf_role} + Templating.Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER} + ${data}= Templating.Apply Template sdc ${SDC_CATALOG_NET_RESOURCE_INPUT_TEMPLATE} ${dict} + ${response}= Set SDC Catalog Resource Component Instance Properties ${catalog_parent_service_id} ${catalog_service_id} ${data} + END Setup SDC Catalog Resource AllottedResource Properties [Documentation] Set up Allotted Resource properties and inputs @@ -376,25 +386,27 @@ Setup SDC Catalog Resource AllottedResource Properties ${type}= Run Keyword If ${passed} Evaluate type(${componentInstances}) ${componentInstancesList}= Run Keyword If "${type}"!="<type 'list'>" Create List ${componentInstances} ... ELSE Set Variable ${componentInstances} - :FOR ${item} IN @{componentInstancesList} - \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${item} ${nf_role_lc} - \ Run Keyword If '${test}' == 'FAIL' Continue For Loop - \ ${componentInstance1}= Set Variable ${item} + FOR ${item} IN @{componentInstancesList} + ${test} ${v}= Run Keyword and Ignore Error Should Contain ${item} ${nf_role_lc} + Run Keyword If '${test}' == 'FAIL' Continue For Loop + ${componentInstance1}= Set Variable ${item} + END ${dict}= Create Dictionary - :FOR ${comp} IN @{resp['componentInstancesProperties']["${componentInstance1}"]} - \ ${name} Set Variable ${comp['name']} - \ ${test} ${v}= Run Keyword and Ignore Error Should Contain Any ${name} network_role providing_service_invariant_uuid providing_service_uuid providing_service_name uniqueId - \ Run Keyword If '${test}' == 'FAIL' Continue For Loop - \ ${parentUniqueId} Set Variable ${comp['parentUniqueId']} - \ ${ownerId} Set Variable ${comp['ownerId']} - \ Set To Dictionary ${dict} parentUniqueId=${parentUniqueId} ownerId=${ownerId} - \ Run Keyword If '${name}'=='providing_service_invariant_uuid' Set To Dictionary ${dict} providing_service_invariant_uuid=${invariantUUID} - \ Run Keyword If '${name}'=='providing_service_uuid' Set To Dictionary ${dict} providing_service_uuid=${UUID} - \ Run Keyword If '${name}'=='providing_service_name' Set To Dictionary ${dict} providing_service_name=${node_type} + FOR ${comp} IN @{resp['componentInstancesProperties']["${componentInstance1}"]} + ${name} Set Variable ${comp['name']} + ${test} ${v}= Run Keyword and Ignore Error Should Contain Any ${name} network_role providing_service_invariant_uuid providing_service_uuid providing_service_name uniqueId + Run Keyword If '${test}' == 'FAIL' Continue For Loop + ${parentUniqueId} Set Variable ${comp['parentUniqueId']} + ${ownerId} Set Variable ${comp['ownerId']} + Set To Dictionary ${dict} parentUniqueId=${parentUniqueId} ownerId=${ownerId} + Run Keyword If '${name}'=='providing_service_invariant_uuid' Set To Dictionary ${dict} providing_service_invariant_uuid=${invariantUUID} + Run Keyword If '${name}'=='providing_service_uuid' Set To Dictionary ${dict} providing_service_uuid=${UUID} + Run Keyword If '${name}'=='providing_service_name' Set To Dictionary ${dict} providing_service_name=${node_type} # Sets it for each loop but should be one - \ ${uniqueId} Set Variable ${comp['uniqueId']} - \ ${uniqueId} Fetch From Left ${uniqueId} . - \ Set To Dictionary ${dict} uniqueId=${uniqueId} + ${uniqueId} Set Variable ${comp['uniqueId']} + ${uniqueId} Fetch From Left ${uniqueId} . + Set To Dictionary ${dict} uniqueId=${uniqueId} + END Templating.Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER} ${data}= Templating.Apply Template sdc ${SDC_CATALOG_ALLOTTED_RESOURCE_PROPERTIES_TEMPLATE} ${dict} ${response}= Set SDC Catalog Resource Component Instance Properties For Resource ${catalog_resource_id} ${componentInstance1} ${data} @@ -407,11 +419,12 @@ Setup SDC Catalog Resource AllottedResource Inputs # Set vnf inputs ${resp}= Get SDC Catalog Resource Inputs ${catalog_resource_id} ${dict}= Create Dictionary - :FOR ${comp} IN @{resp['inputs']} - \ ${name} Set Variable ${comp['name']} - \ ${uid} Set Variable ${comp['uniqueId']} - \ Run Keyword If '${name}'=='nf_type' Set To Dictionary ${dict} nf_type=${nf_role} nf_type_uid=${uid} - \ Run Keyword If '${name}'=='nf_role' Set To Dictionary ${dict} nf_role=${nf_role} nf_role_uid=${uid} + FOR ${comp} IN @{resp['inputs']} + ${name} Set Variable ${comp['name']} + ${uid} Set Variable ${comp['uniqueId']} + Run Keyword If '${name}'=='nf_type' Set To Dictionary ${dict} nf_type=${nf_role} nf_type_uid=${uid} + Run Keyword If '${name}'=='nf_role' Set To Dictionary ${dict} nf_role=${nf_role} nf_role_uid=${uid} + END Templating.Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER} ${data}= Templating.Apply Template sdc ${SDC_CATALOG_ALLOTTED_RESOURCE_INPUTS_TEMPLATE} ${dict} ${response}= Set SDC Catalog Resource VNF Inputs ${catalog_resource_id} ${data} @@ -422,33 +435,35 @@ Setup SDC Catalog Resource CDS Properties [Arguments] ${catalog_resource_id} # Set vnf module properties ${resp}= Get SDC Catalog Resource Component Instances ${catalog_resource_id} - :FOR ${comp} IN @{resp['componentInstances']} - \ ${name} Set Variable ${comp['name']} - \ ${uniqueId} Set Variable ${comp['uniqueId']} - \ ${actualComponentUid} Set Variable ${comp['actualComponentUid']} - \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${name} abstract_ - \ Run Keyword If '${test}' == 'FAIL' Continue For Loop - \ ${response}= Get SDC Catalog Resource Component Instance Properties ${catalog_resource_id} ${uniqueId} ${actualComponentUid} - \ ${dict}= Create Dictionary parent_id=${response[6]['parentUniqueId']} - \ Run Keyword If '${name}'=='abstract_vfw' Set To Dictionary ${dict} nfc_function=vfw nfc_naming_policy=SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP - \ Run Keyword If '${name}'=='abstract_vpg' Set To Dictionary ${dict} nfc_function=vpg nfc_naming_policy=SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP - \ Run Keyword If '${name}'=='abstract_vsn' Set To Dictionary ${dict} nfc_function=vsn nfc_naming_policy=SDNC_Policy.ONAP_VSN_NAMING_TIMESTAMP - \ Templating.Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER} - \ ${data}= Templating.Apply Template sdc ${SDC_RESOURCE_INSTANCE_VNF_PROPERTIES_TEMPLATE} ${dict} - \ ${response}= Set SDC Catalog Resource Component Instance Properties ${catalog_resource_id} ${uniqueId} ${data} - \ Log resp=${response} + FOR ${comp} IN @{resp['componentInstances']} + ${name} Set Variable ${comp['name']} + ${uniqueId} Set Variable ${comp['uniqueId']} + ${actualComponentUid} Set Variable ${comp['actualComponentUid']} + ${test} ${v}= Run Keyword and Ignore Error Should Contain ${name} abstract_ + Run Keyword If '${test}' == 'FAIL' Continue For Loop + ${response}= Get SDC Catalog Resource Component Instance Properties ${catalog_resource_id} ${uniqueId} ${actualComponentUid} + ${dict}= Create Dictionary parent_id=${response[6]['parentUniqueId']} + Run Keyword If '${name}'=='abstract_vfw' Set To Dictionary ${dict} nfc_function=vfw nfc_naming_policy=SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP + Run Keyword If '${name}'=='abstract_vpg' Set To Dictionary ${dict} nfc_function=vpg nfc_naming_policy=SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP + Run Keyword If '${name}'=='abstract_vsn' Set To Dictionary ${dict} nfc_function=vsn nfc_naming_policy=SDNC_Policy.ONAP_VSN_NAMING_TIMESTAMP + Templating.Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER} + ${data}= Templating.Apply Template sdc ${SDC_RESOURCE_INSTANCE_VNF_PROPERTIES_TEMPLATE} ${dict} + ${response}= Set SDC Catalog Resource Component Instance Properties ${catalog_resource_id} ${uniqueId} ${data} + Log resp=${response} + END # Set vnf inputs ${resp}= Get SDC Catalog Resource Inputs ${catalog_resource_id} ${dict}= Create Dictionary - :FOR ${comp} IN @{resp['inputs']} - \ ${name} Set Variable ${comp['name']} - \ ${uid} Set Variable ${comp['uniqueId']} - \ Run Keyword If '${name}'=='nf_function' Set To Dictionary ${dict} nf_function=ONAP-FIREWALL nf_function_uid=${uid} - \ Run Keyword If '${name}'=='nf_type' Set To Dictionary ${dict} nf_type=FIREWALL nf_type_uid=${uid} - \ Run Keyword If '${name}'=='nf_naming_code' Set To Dictionary ${dict} nf_naming_code=vfw nf_naming_code_uid=${uid} - \ Run Keyword If '${name}'=='nf_role' Set To Dictionary ${dict} nf_role=vFW nf_role_uid=${uid} - \ Run Keyword If '${name}'=='cloud_env' Set To Dictionary ${dict} cloud_env=openstack cloud_env_uid=${uid} + FOR ${comp} IN @{resp['inputs']} + ${name} Set Variable ${comp['name']} + ${uid} Set Variable ${comp['uniqueId']} + Run Keyword If '${name}'=='nf_function' Set To Dictionary ${dict} nf_function=ONAP-FIREWALL nf_function_uid=${uid} + Run Keyword If '${name}'=='nf_type' Set To Dictionary ${dict} nf_type=FIREWALL nf_type_uid=${uid} + Run Keyword If '${name}'=='nf_naming_code' Set To Dictionary ${dict} nf_naming_code=vfw nf_naming_code_uid=${uid} + Run Keyword If '${name}'=='nf_role' Set To Dictionary ${dict} nf_role=vFW nf_role_uid=${uid} + Run Keyword If '${name}'=='cloud_env' Set To Dictionary ${dict} cloud_env=openstack cloud_env_uid=${uid} + END Templating.Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER} ${data}= Templating.Apply Template sdc ${SDC_RESOURCE_INSTANCE_VNF_INPUTS_TEMPLATE} ${dict} ${response}= Set SDC Catalog Resource VNF Inputs ${catalog_resource_id} ${data} @@ -734,14 +749,15 @@ Get SDC Demo Vnf Catalog Resource ${resp}= Get Service Catalog ${service_name} @{ITEMS}= Copy List ${resp['componentInstances']} ${demo_catalog_resource}= Create Dictionary - :FOR ${ELEMENT} IN @{ITEMS} - \ Log ${ELEMENT['name']} - \ Log ${ELEMENT['groupInstances'][0]['groupName']} - \ ${vnf}= Get VNF From Group Name ${ELEMENT['groupInstances'][0]['groupName']} ${service_name} - \ ${vnf_data}= Create Dictionary vnf_type=${ELEMENT['name']} vf_module=${ELEMENT['groupInstances'][0]['groupName']} - \ LOG ${vnf_data} - \ Set To Dictionary ${demo_catalog_resource} ${vnf}=${vnf_data} - \ LOG ${demo_catalog_resource} + FOR ${ELEMENT} IN @{ITEMS} + Log ${ELEMENT['name']} + Log ${ELEMENT['groupInstances'][0]['groupName']} + ${vnf}= Get VNF From Group Name ${ELEMENT['groupInstances'][0]['groupName']} ${service_name} + ${vnf_data}= Create Dictionary vnf_type=${ELEMENT['name']} vf_module=${ELEMENT['groupInstances'][0]['groupName']} + LOG ${vnf_data} + Set To Dictionary ${demo_catalog_resource} ${vnf}=${vnf_data} + LOG ${demo_catalog_resource} + END [Return] ${demo_catalog_resource} Get VNF From Group Name @@ -886,14 +902,15 @@ Check Catalog Service Distributed ${SO_COMPLETE} Set Variable FALSE ${dist_status} Set Variable CONTINUE Should Not Be Empty ${ITEMS} - :FOR ${ELEMENT} IN @{ITEMS} - \ Log ${ELEMENT['omfComponentID']} - \ Log ${ELEMENT['status']} - \ ${SO_COMPLETE} Set Variable If (('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_OK')) or ('${SO_COMPLETE}'=='TRUE') TRUE - \ Exit For Loop If ('${SO_COMPLETE}'=='TRUE') - \ Run Keyword If ('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_ERROR') Fatal Error "SO DISTRIBUTION_COMPLETE_ERROR" - \ ${dist_status}= Set Variable If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml')) EXIT - \ Exit For Loop If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml')) + FOR ${ELEMENT} IN @{ITEMS} + Log ${ELEMENT['omfComponentID']} + Log ${ELEMENT['status']} + ${SO_COMPLETE} Set Variable If (('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_OK')) or ('${SO_COMPLETE}'=='TRUE') TRUE + Exit For Loop If ('${SO_COMPLETE}'=='TRUE') + Run Keyword If ('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_ERROR') Fatal Error "SO DISTRIBUTION_COMPLETE_ERROR" + ${dist_status}= Set Variable If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml')) EXIT + Exit For Loop If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml')) + END Should Be True ( '${SO_COMPLETE}'=='TRUE') SO Test Get Catalog Service Distribution Details @@ -910,9 +927,10 @@ Run SDC Health Check Should Be Equal As Strings ${resp.status_code} 200 SDC DOWN ${SDC_DE_HEALTH}= Catenate DOWN @{ITEMS}= Copy List ${resp.json()['componentsInfo']} - :FOR ${ELEMENT} IN @{ITEMS} - \ Log ${ELEMENT['healthCheckStatus']} - \ ${SDC_DE_HEALTH} Set Variable If (('DE' in '${ELEMENT['healthCheckComponent']}') and ('${ELEMENT['healthCheckStatus']}' == 'UP')) or ('${SDC_DE_HEALTH}'=='UP') UP + FOR ${ELEMENT} IN @{ITEMS} + Log ${ELEMENT['healthCheckStatus']} + ${SDC_DE_HEALTH} Set Variable If (('DE' in '${ELEMENT['healthCheckComponent']}') and ('${ELEMENT['healthCheckStatus']}' == 'UP')) or ('${SDC_DE_HEALTH}'=='UP') UP + END Log (DMaaP:${SDC_DE_HEALTH}) console=True Run SDC BE ONBOARD Healthcheck @@ -955,12 +973,13 @@ Add CDS Parameters ${component_uuid}= Set Variable ${resp.json()['componentInstances'][0]['uniqueId']} ${skip_post_instatiation}= Set Variable If '${catalog_service_name}' == "demoVLB_CDS" false true @{inputs}= Copy List ${resp.json()['componentInstances'][0]['inputs']} - :FOR ${input} IN @{inputs} - \ Run Keyword If '${input['name']}' == "sdnc_artifact_name" Set Input Parameter ${service_uuid} ${component_uuid} ${input} string vnf + FOR ${input} IN @{inputs} + Run Keyword If '${input['name']}' == "sdnc_artifact_name" Set Input Parameter ${service_uuid} ${component_uuid} ${input} string vnf ... ELSE IF '${input['name']}' == "sdnc_model_name" Set Input Parameter ${service_uuid} ${component_uuid} ${input} string vLB_CDS ... ELSE IF '${input['name']}' == "sdnc_model_version" Set Input Parameter ${service_uuid} ${component_uuid} ${input} string 1.0.0 ... ELSE IF '${input['name']}' == "skip_post_instantiation_configuration" Set Input Parameter ${service_uuid} ${component_uuid} ${input} boolean ${skip_post_instatiation} ... ELSE IF '${input['name']}' == "controller_actor" Set Input Parameter ${service_uuid} ${component_uuid} ${input} string CDS + END Set Input Parameter [Arguments] ${service_uuid} ${component_uuid} ${input} ${input_type} ${input_value} diff --git a/robot/resources/sdnc_interface.robot b/robot/resources/sdnc_interface.robot index 2e714217..aac07468 100644 --- a/robot/resources/sdnc_interface.robot +++ b/robot/resources/sdnc_interface.robot @@ -17,18 +17,18 @@ Resource browser_setup.robot *** Variables *** ${PRELOAD_VNF_TOPOLOGY_OPERATION_PATH} /operations/VNF-API:preload-vnf-topology-operation ${PRELOAD_NETWORK_TOPOLOGY_OPERATION_PATH} /operations/VNF-API:preload-network-topology-operation -${PRELOAD_VNF_CONFIG_PATH} /config/VNF-API:preload-vnfs/vnf-preload-list +${PRELOAD_VNF_CONFIG_PATH} /data/VNF-API:preload-vnfs/vnf-preload-list ${PRELOAD_GRA_TOPOLOGY_OPERATION_PATH} /operations/GENERIC-RESOURCE-API:preload-vf-module-topology-operation -${PRELOAD_GRA_CONFIG_PATH} /config/GENERIC-RESOURCE-API:preload-information +${PRELOAD_GRA_CONFIG_PATH} /data/GENERIC-RESOURCE-API:preload-information ${PRELOAD_TOPOLOGY_OPERATION_BODY} sdnc -${SDNC_INDEX_PATH} /restconf +${SDNC_INDEX_PATH} /rests ${SDNCGC_HEALTHCHECK_OPERATION_PATH} /operations/SLI-API:healthcheck ${SDNC_REST_ENDPOINT} ${GLOBAL_SDNC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SDNC_IP_ADDR}:${GLOBAL_SDNC_REST_PORT} ${SDNC_ADMIN_ENDPOINT} ${GLOBAL_SDNC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SDNC_PORTAL_IP_ADDR}:${GLOBAL_SDNC_ADMIN_PORT} ${SDNC_ADMIN_SIGNUP_URL} ${SDNC_ADMIN_ENDPOINT}/signup ${SDNC_ADMIN_LOGIN_URL} ${SDNC_ADMIN_ENDPOINT}/login ${SDNC_ADMIN_VNF_PROFILE_URL} ${SDNC_ADMIN_ENDPOINT}/mobility/getVnfProfile -${GRAPI_SIPath} ${SDNC_INDEX_PATH}/config/GENERIC-RESOURCE-API:services/service/${GR_SI} +${GRAPI_SIPath} ${SDNC_INDEX_PATH}/data/GENERIC-RESOURCE-API:services/service=${GR_SI} ${Data_GRAPI} { "service": [ { "service-instance-id": "GRSIdummy123" } ] } ${GR_SI} GRSIdummy123 @@ -37,7 +37,7 @@ Run SDNC Health Check [Documentation] Runs an SDNC healthcheck ${resp}= SDNC.Run Post Request ${SDNC_REST_ENDPOINT} ${SDNC_INDEX PATH}${SDNCGC_HEALTHCHECK_OPERATION_PATH} data=${None} auth=${GLOBAL_SDNC_AUTHENTICATION} Should Be Equal As Strings ${resp.status_code} 200 - Should Be Equal As Strings ${resp.json()['output']['response-code']} 200 + Should Be Equal As Strings ${resp.json()['SLI-API:output']['response-code']} 200 Run SDNC Health Check Generic Resource API [Documentation] Runs an GENERIC-RESOURCE-API API check for SDNC healthcheck @@ -52,7 +52,7 @@ Run SDNC Health Check Generic Resource API Should contain ${res_body} ${GR_SI} #Delete Dummy Data ${delete_response} Run SDNC Delete Request ${GRAPI_SIPath} - Should Be Equal As Strings ${delete_response.status_code} 200 + Should Be Equal As Strings ${delete_response.status_code} 204 Run SDNC Delete Request [Documentation] Runs an SDNC Delete Request @@ -117,23 +117,24 @@ Preload Vnf ${closedloop_vf_module}= Create Dictionary ServiceMapping.Set Directory default ${GLOBAL_SERVICE_MAPPING_DIRECTORY} ${templates}= ServiceMapping.Get Service Template Mapping default ${service} ${vnf} - :FOR ${vf_module} IN @{vf_modules} - \ ${vf_module_type}= Get From Dictionary ${vf_module} name + FOR ${vf_module} IN @{vf_modules} + ${vf_module_type}= Get From Dictionary ${vf_module} name # need to pass in vnf_index if non-zero - \ ${dict} Run Keyword If "${generic_vnf_name}".endswith('0') Get From Mapping With Index ${templates} ${vf_module} 0 + ${dict} Run Keyword If "${generic_vnf_name}".endswith('0') Get From Mapping With Index ${templates} ${vf_module} 0 ... ELSE IF "${generic_vnf_name}".endswith('1') Get From Mapping With Index ${templates} ${vf_module} 1 ... ELSE IF "${generic_vnf_name}".endswith('2') Get From Mapping With Index ${templates} ${vf_module} 2 ... ELSE Get From Mapping ${templates} ${vf_module} # skip this iteration if no template - \ ${test_dict_length} = Get Length ${dict} - \ Continue For Loop If ${test_dict_length} == 0 - \ ${filename}= Get From Dictionary ${dict} template - \ ${base_vf_module_type}= Set Variable If '${dict['isBase']}' == 'true' ${vf_module_type} ${base_vf_module_type} - \ ${closedloop_vf_module}= Set Variable If '${dict['isBase']}' == 'false' ${vf_module} ${closedloop_vf_module} - \ ${vf_name}= Update Module Name ${dict} ${vf_module_name} + ${test_dict_length} = Get Length ${dict} + Continue For Loop If ${test_dict_length} == 0 + ${filename}= Get From Dictionary ${dict} template + ${base_vf_module_type}= Set Variable If '${dict['isBase']}' == 'true' ${vf_module_type} ${base_vf_module_type} + ${closedloop_vf_module}= Set Variable If '${dict['isBase']}' == 'false' ${vf_module} ${closedloop_vf_module} + ${vf_name}= Update Module Name ${dict} ${vf_module_name} # Admin portal update no longer #\ Preload Vnf Profile ${vf_module_type} - \ Preload One Vnf Topology ${service_type_uuid} ${generic_vnf_name} ${generic_vnf_type} ${vf_name} ${vf_module_type} ${service} ${filename} ${uuid} ${server_id} + Preload One Vnf Topology ${service_type_uuid} ${generic_vnf_name} ${generic_vnf_type} ${vf_name} ${vf_module_type} ${service} ${filename} ${uuid} ${server_id} + END [Return] ${base_vf_module_type} ${closedloop_vf_module} Preload Gra @@ -142,7 +143,7 @@ Preload Gra ${closedloop_vf_module}= Create Dictionary ServiceMapping.Set Directory default ${GLOBAL_SERVICE_MAPPING_DIRECTORY} ${templates}= ServiceMapping.Get Service Template Mapping default ${service} ${vnf} - :FOR ${vf_module} IN @{vf_modules} + FOR ${vf_module} IN @{vf_modules} \ ${vf_module_type}= Get From Dictionary ${vf_module} name # need to pass in vnf_index if non-zero \ ${dict} Run Keyword If "${generic_vnf_name}".endswith('0') Get From Mapping With Index ${templates} ${vf_module} 0 @@ -157,6 +158,7 @@ Preload Gra \ ${closedloop_vf_module}= Set Variable If '${dict['isBase']}' == 'false' ${vf_module} ${closedloop_vf_module} \ ${vf_name}= Update Module Name ${dict} ${vf_module_name} \ Preload One Gra Topology ${service_type_uuid} ${generic_vnf_name} ${generic_vnf_type} ${vf_name} ${vf_module_type} ${service} ${filename} ${uuid} ${server_id} + END [Return] ${base_vf_module_type} ${closedloop_vf_module} @@ -172,8 +174,9 @@ Get From Mapping With Index [Documentation] Retrieve the appropriate prelad template entry for the passed vf_module [Arguments] ${templates} ${vf_module} ${vnf_index}=0 ${vf_module_name}= Get From DIctionary ${vf_module} name - :FOR ${template} IN @{templates} + FOR ${template} IN @{templates} \ Return From Keyword If '${template['name_pattern']}' in '${vf_module_name}' and ('${template['vnf_index']}' == '${vnf_index}') ${template} + END ${result}= Create Dictionary [Return] ${result} @@ -181,8 +184,9 @@ Get From Mapping [Documentation] Retrieve the appropriate prelad template entry for the passed vf_module [Arguments] ${templates} ${vf_module} ${vf_module_name}= Get From DIctionary ${vf_module} name - :FOR ${template} IN @{templates} + FOR ${template} IN @{templates} \ Return From Keyword If '${template['name_pattern']}' in '${vf_module_name}' ${template} + END ${result}= Create Dictionary [Return] ${result} @@ -234,10 +238,10 @@ Get Template Parameters ${template}= PreloadData.Get Preload Data preload ${service} ${template} # add all of the defaults to template... @{keys}= Get Dictionary Keys ${defaults} - :FOR ${key} IN @{keys} + FOR ${key} IN @{keys} \ ${value}= Get From Dictionary ${defaults} ${key} \ Set To Dictionary ${template} ${key} ${value} - + END # # Get the vnf_parameters to preload # @@ -251,22 +255,24 @@ Resolve VNF Parameters Into Array [Arguments] ${valuemap} ${from} ${vnf_parameters}= Create List ${keys}= Get Dictionary Keys ${from} - :FOR ${key} IN @{keys} + FOR ${key} IN @{keys} \ ${value}= Get From Dictionary ${from} ${key} \ ${value}= Templating.Template String ${value} ${valuemap} \ ${parameter}= Create Dictionary vnf-parameter-name=${key} vnf-parameter-value=${value} \ Append To List ${vnf_parameters} ${parameter} + END [Return] ${vnf_parameters} Resolve GRA Parameters Into Array [Arguments] ${valuemap} ${from} ${vnf_parameters}= Create List ${keys}= Get Dictionary Keys ${from} - :FOR ${key} IN @{keys} - \ ${value}= Get From Dictionary ${from} ${key} - \ ${value}= Templating.Template String ${value} ${valuemap} - \ ${parameter}= Create Dictionary name=${key} value=${value} - \ Append To List ${vnf_parameters} ${parameter} + FOR ${key} IN @{keys} + ${value}= Get From Dictionary ${from} ${key} + ${value}= Templating.Template String ${value} ${valuemap} + ${parameter}= Create Dictionary name=${key} value=${value} + Append To List ${vnf_parameters} ${parameter} + END [Return] ${vnf_parameters} diff --git a/robot/resources/so/add_service_recipe.robot b/robot/resources/so/add_service_recipe.robot index 1e342873..bf6b7c9c 100644 --- a/robot/resources/so/add_service_recipe.robot +++ b/robot/resources/so/add_service_recipe.robot @@ -43,9 +43,10 @@ Get First Free Service Recipe Id Log ${source data} ${serviceRecipes}= Set Variable ${source data['_embedded']['serviceRecipe']} ${ids}= Create List - :FOR ${recipe} IN @{serviceRecipes} - \ ${id}= Get From Dictionary ${recipe} id - \ Append To List ${ids} ${id} + FOR ${recipe} IN @{serviceRecipes} + ${id}= Get From Dictionary ${recipe} id + Append To List ${ids} ${id} + END Sort list ${ids} ${biggest_id}= Get From List ${ids} -1 Log Biggest id is ${biggest_id} first free is ${biggest_id+1} diff --git a/robot/resources/so/direct_instantiate.robot b/robot/resources/so/direct_instantiate.robot index 15f583ad..3a8c6e74 100755 --- a/robot/resources/so/direct_instantiate.robot +++ b/robot/resources/so/direct_instantiate.robot @@ -33,16 +33,17 @@ Instantiate Service Direct To SO ${template}= Create Dictionary @{keys}= Get Dictionary Keys ${preload_dict} ${parameters}= Get Globally Injected Parameters - :FOR ${key} IN @{keys} - \ ${value}= Get From Dictionary ${preload_dict} ${key} - \ ${tmp_value}= Set Variable If 'GLOBAL_' in $value ${value} - \ ${tmp_value}= Run Keyword If 'GLOBAL_' in $value Replace String ${tmp_value} \$ ${EMPTY} - \ ${tmp_value}= Run Keyword If 'GLOBAL_' in $value Replace String ${tmp_value} { ${EMPTY} - \ ${tmp_value}= Run Keyword If 'GLOBAL_' in $value Replace String ${tmp_value} } ${EMPTY} - \ ${value}= Set Variable If 'GLOBAL_' in $value ${parameters["${tmp_value}"]} ${value} - \ ${new_key}= Catenate \$ { ${key} } - \ ${new_key}= Evaluate '${new_key}'.replace(' ','') - \ Set To Dictionary ${template} ${new_key} ${value} + FOR ${key} IN @{keys} + ${value}= Get From Dictionary ${preload_dict} ${key} + ${tmp_value}= Set Variable If 'GLOBAL_' in $value ${value} + ${tmp_value}= Run Keyword If 'GLOBAL_' in $value Replace String ${tmp_value} \$ ${EMPTY} + ${tmp_value}= Run Keyword If 'GLOBAL_' in $value Replace String ${tmp_value} { ${EMPTY} + ${tmp_value}= Run Keyword If 'GLOBAL_' in $value Replace String ${tmp_value} } ${EMPTY} + ${value}= Set Variable If 'GLOBAL_' in $value ${parameters["${tmp_value}"]} ${value} + ${new_key}= Catenate \$ { ${key} } + ${new_key}= Evaluate '${new_key}'.replace(' ','') + Set To Dictionary ${template} ${new_key} ${value} + END ${tmp_key1}= Catenate \$ { ecompnet } ${tmp_key1}= Evaluate '${tmp_key1}'.replace(' ','') diff --git a/robot/resources/ssh/files.robot b/robot/resources/ssh/files.robot index e89e5989..a1d4dcc4 100644 --- a/robot/resources/ssh/files.robot +++ b/robot/resources/ssh/files.robot @@ -30,10 +30,11 @@ Grep File on Hosts [Documentation] Grep the passed file name and return all of the lines that match the passed pattern using passed list of connections [Arguments] ${HOSTS} ${pattern} ${fullpath} &{map}= Create Dictionary - :FOR ${HOST} IN @{HOSTS} - \ Log ${HOST} - \ @{lines}= Grep File on Host ${HOST} ${pattern} ${fullpath} - \ &{map}= Create Dictionary ${HOST}=@{lines} &{map} + FOR ${HOST} IN @{HOSTS} + Log ${HOST} + @{lines}= Grep File on Host ${HOST} ${pattern} ${fullpath} + &{map}= Create Dictionary ${HOST}=@{lines} &{map} + END [Return] &{map} Tail File on Host Until diff --git a/robot/resources/ssh/processes.robot b/robot/resources/ssh/processes.robot index 65960e4f..11980d0b 100644 --- a/robot/resources/ssh/processes.robot +++ b/robot/resources/ssh/processes.robot @@ -27,11 +27,12 @@ Create Process Map [Arguments] ${input} @{lines}= Split To Lines ${input} ${map}= Create Dictionary - :FOR ${line} IN @{lines} - \ @{parts}= Split String ${line} max_split=7 - \ ${pid}= Catenate ${parts[1]} - \ ${name}= Catenate ${parts[7]} - \ Set To Dictionary ${map} ${pid}=${name} + FOR ${line} IN @{lines} + @{parts}= Split String ${line} max_split=7 + ${pid}= Catenate ${parts[1]} + ${name}= Catenate ${parts[7]} + Set To Dictionary ${map} ${pid}=${name} + END [Return] ${map} @@ -56,10 +57,11 @@ Is Process on Host ${pass} ${map}= Run Keyword and Ignore Error Grep Processes ${process_name} @{pids}= Get Dictionary Keys ${map} ${foundpid}= Catenate "" - :FOR ${pid} IN @{pids} - \ ${process_cmd}= Get From Dictionary ${map} ${pid} - \ ${status} ${value}= Run Keyword And Ignore Error Should Match Regexp ${process_cmd} ${process_name} - \ ${foundpid}= Set Variable If '${status}' == 'PASS' ${pid} "" + FOR ${pid} IN @{pids} + ${process_cmd}= Get From Dictionary ${map} ${pid} + ${status} ${value}= Run Keyword And Ignore Error Should Match Regexp ${process_cmd} ${process_name} + ${foundpid}= Set Variable If '${status}' == 'PASS' ${pid} "" + END Should Not Be Equal ${foundpid} "" [Return] ${map}[${foundpid}] diff --git a/robot/resources/stack_validation/packet_generator_interface.robot b/robot/resources/stack_validation/packet_generator_interface.robot index 802c8df7..4baf5811 100644 --- a/robot/resources/stack_validation/packet_generator_interface.robot +++ b/robot/resources/stack_validation/packet_generator_interface.robot @@ -50,13 +50,14 @@ Enable Streams ${comma}= Set Variable ${stream_count}= Evaluate ${stream_count}+1 Templating.Create Environment pgi ${GLOBAL_TEMPLATE_FOLDER} - :FOR ${i} IN RANGE 1 ${stream_count} - \ ${name}= Catenate ${prefix}${i} - \ ${map}= Create Dictionary stream=${name} - \ ${one}= Templating.Apply Template pgi ${PGN_ENABLE_STREAM_TEMPLATE} ${map} - \ ${one}= evaluate json.dumps(${one}) json - \ ${streams}= Set Variable ${streams}${comma}${one} - \ ${comma}= Set Variable , + FOR ${i} IN RANGE 1 ${stream_count} + ${name}= Catenate ${prefix}${i} + ${map}= Create Dictionary stream=${name} + ${one}= Templating.Apply Template pgi ${PGN_ENABLE_STREAM_TEMPLATE} ${map} + ${one}= evaluate json.dumps(${one}) json + ${streams}= Set Variable ${streams}${comma}${one} + ${comma}= Set Variable , + END ${map}= Create Dictionary pgstreams=${streams} ${data}= Templating.Apply Template pgi ${PGN_ENABLE_STREAMS_TEMPLATE} ${map} ${resp}= Put Request ${alias} ${data_path} data=${data} headers=${headers} diff --git a/robot/resources/stack_validation/policy_check_vfw.robot b/robot/resources/stack_validation/policy_check_vfw.robot index 7b73db0f..6700f454 100644 --- a/robot/resources/stack_validation/policy_check_vfw.robot +++ b/robot/resources/stack_validation/policy_check_vfw.robot @@ -85,8 +85,9 @@ Policy Check vLB Stack Get DNSScaling Prefix ServiceMapping.Set Directory default ${GLOBAL_SERVICE_MAPPING_DIRECTORY} ${mapping}= ServiceMapping.Get Service Template Mapping default vLB vLB - :FOR ${dict} IN @{mapping} - \ Return From Keyword If '${dict['isBase']}' == 'false' ${dict['prefix']} + FOR ${dict} IN @{mapping} + Return From Keyword If '${dict['isBase']}' == 'false' ${dict['prefix']} + END [Return] None Start DNS Traffic diff --git a/robot/resources/stack_validation/validate_common.robot b/robot/resources/stack_validation/validate_common.robot index c19d7a5c..7022fed7 100644 --- a/robot/resources/stack_validation/validate_common.robot +++ b/robot/resources/stack_validation/validate_common.robot @@ -74,26 +74,29 @@ Find Openstack 2 Get V4 IP [Arguments] ${ipmaps} - :FOR ${ipmap} IN @{ipmaps} - \ ${ip} Get From Dictionary ${ipmap} addr - \ ${version} Get From Dictionary ${ipmap} version - \ Return from Keyword if '${version}' == '4' ${ip} + FOR ${ipmap} IN @{ipmaps} + ${ip} Get From Dictionary ${ipmap} addr + ${version} Get From Dictionary ${ipmap} version + Return from Keyword if '${version}' == '4' ${ip} + END Fail No Version 4 IP Get V4 IP Openstack [Arguments] ${addresses} ${testtype} ${ipmaps}= Get From Dictionary ${addresses} ${testtype} - :FOR ${ipmap} IN @{ipmaps} - \ ${ip} Get From Dictionary ${ipmap} addr - \ ${version} Get From Dictionary ${ipmap} version - \ Return from Keyword if '${version}'=='4' ${ip} + FOR ${ipmap} IN @{ipmaps} + ${ip} Get From Dictionary ${ipmap} addr + ${version} Get From Dictionary ${ipmap} version + Return from Keyword if '${version}'=='4' ${ip} + END Fail No Version 4 IP Get V4 IP Openstack 2 [Arguments] ${ipmaps} ${testtype} - :FOR ${ipmap} IN @{ipmaps} - \ ${type} Get From Dictionary ${ipmap} OS-EXT-IPS:type - \ ${ip} Get From Dictionary ${ipmap} addr - \ ${version} Get From Dictionary ${ipmap} version - \ Return from Keyword if '${version}'=='4' and '${type}'=='${testtype}' ${ip} + FOR ${ipmap} IN @{ipmaps} + ${type} Get From Dictionary ${ipmap} OS-EXT-IPS:type + ${ip} Get From Dictionary ${ipmap} addr + ${version} Get From Dictionary ${ipmap} version + Return from Keyword if '${version}'=='4' and '${type}'=='${testtype}' ${ip} + END Fail No Version 4 IP 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} diff --git a/robot/resources/vid/teardown_vid.robot b/robot/resources/vid/teardown_vid.robot index 23217704..c5fb6d41 100644 --- a/robot/resources/vid/teardown_vid.robot +++ b/robot/resources/vid/teardown_vid.robot @@ -64,11 +64,12 @@ Delete Next VID Entity Wait Until Page Contains View/Edit Service Instance timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} Wait Until Element Is Visible xpath=//a/span[@class='glyphicon glyphicon-remove'] timeout=${GLOBAL_VID_UI_TIMEOUT_LONG} - :FOR ${remove_first} IN @{remove_order} - \ ${remove_xpath}= Set Variable //li/div[contains(.,'${remove_first}')]/a/span[@class='glyphicon glyphicon-remove'] - \ ${status} ${data}= Run Keyword And Ignore Error Page Should Contain Element xpath=${remove_xpath} - \ Exit For Loop If '${status}' == 'PASS' - \ ${remove_xpath}= Set Variable //li/div/a/span[@class='glyphicon glyphicon-remove'] + FOR ${remove_first} IN @{remove_order} + ${remove_xpath}= Set Variable //li/div[contains(.,'${remove_first}')]/a/span[@class='glyphicon glyphicon-remove'] + ${status} ${data}= Run Keyword And Ignore Error Page Should Contain Element xpath=${remove_xpath} + Exit For Loop If '${status}' == 'PASS' + ${remove_xpath}= Set Variable //li/div/a/span[@class='glyphicon glyphicon-remove'] + END Click On Element When Visible xpath=${remove_xpath} ${status} ${value}= Run Keyword and Ignore Error Wait Until Page Contains Element xpath=//select[@parameter-id='lcpRegion'] diff --git a/robot/resources/vid/vid_interface.robot b/robot/resources/vid/vid_interface.robot index 58ba0e56..00558fdc 100644 --- a/robot/resources/vid/vid_interface.robot +++ b/robot/resources/vid/vid_interface.robot @@ -115,10 +115,11 @@ Get Model UUID from VID ${resp}= Get Text xpath=//body/pre ${json}= To Json ${resp} ${services}= Get From Dictionary ${json} services - :FOR ${dict} IN @{services} - \ ${uuid}= Get From DIctionary ${dict} uuid - \ ${inv}= Get From DIctionary ${dict} invariantUUID - \ Return From Keyword If "${invariantUUID}" == "${inv}" ${uuid} + FOR ${dict} IN @{services} + ${uuid}= Get From DIctionary ${dict} uuid + ${inv}= Get From DIctionary ${dict} invariantUUID + Return From Keyword If "${invariantUUID}" == "${inv}" ${uuid} + END [Return] "" @@ -133,8 +134,9 @@ Get Module Names from VID ${modules}= Create List ${vnfs}= Get From Dictionary ${json} vnfs ${keys}= Get Dictionary Keys ${vnfs} - :FOR ${key} IN @{keys} - \ Add VFModule ${vnfs['${key}']} ${modules} + FOR ${key} IN @{keys} + Add VFModule ${vnfs['${key}']} ${modules} + END [Return] ${modules} Add VFModule @@ -142,7 +144,8 @@ Add VFModule [Arguments] ${vnf} ${modules} ${vfModules}= Get From Dictionary ${vnf} vfModules ${keys}= Get Dictionary Keys ${vfModules} - :FOR ${key} IN @{keys} - \ ${module}= Get From Dictionary ${vfModules} ${key} - \ ${dict}= Create Dictionary name=${module['name']} - \ Append to List ${modules} ${dict} + FOR ${key} IN @{keys} + ${module}= Get From Dictionary ${vfModules} ${key} + ${dict}= Create Dictionary name=${module['name']} + Append to List ${modules} ${dict} + END
\ No newline at end of file diff --git a/robot/testsuites/health-check.robot b/robot/testsuites/health-check.robot index 7f7ed566..100e3ab5 100644 --- a/robot/testsuites/health-check.robot +++ b/robot/testsuites/health-check.robot @@ -65,7 +65,7 @@ Basic DCAE Microservices Health Check Run DCAE Microservices Health Check Basic DMAAP Data Router Health Check - [Tags] health datarouter health-dmaap + [Tags] datarouter health-dmaap Run DR Health Check Basic DMAAP Message Router Health Check @@ -102,7 +102,7 @@ Basic Multicloud API Health Check Run MultiCloud Health Check Basic Multicloud-pike API Health Check - [Tags] health multicloud small health-multicloud + [Tags] multicloud small health-multicloud Run MultiCloud-pike Health Check Basic Multicloud-starlingx API Health Check @@ -311,15 +311,15 @@ Portal CLI Application Access Test Basic Holmes Rule Management API Health Check - [Tags] health-holmes health + [Tags] health-holmes Run Holmes Rule Mgmt Healthcheck Basic Holmes Engine Management API Health Check - [Tags] health-holmes health + [Tags] health-holmes Run Holmes Engine Mgmt Healthcheck Basic Modeling Parser API Health Check - [Tags] health api health-modeling + [Tags] api health-modeling Run Modeling Parser Healthcheck Enhanced CDS Health Check diff --git a/robot/testsuites/update_onap_page.robot b/robot/testsuites/update_onap_page.robot index 7b1a3b3a..654b5ade 100644 --- a/robot/testsuites/update_onap_page.robot +++ b/robot/testsuites/update_onap_page.robot @@ -47,9 +47,10 @@ Update ONAP Page ${values}= Create Dictionary ${keys}= Get Dictionary Keys ${oam_ip_map} - :FOR ${oam_ip} IN @{keys} - \ ${value_name}= Get From Dictionary ${oam_ip_map} ${oam_ip} - \ Set Public Ip ${server_map} ${oam_ip} ${value_name} ${values} + FOR ${oam_ip} IN @{keys} + ${value_name}= Get From Dictionary ${oam_ip_map} ${oam_ip} + Set Public Ip ${server_map} ${oam_ip} ${value_name} ${values} + END Log ${values} Run Keyword If '${WEB_PASSWORD}' != '' Create File ${CREDENTIALS_FILE} ${WEB_USER}:${WEB_PASSWORD} Set To Dictionary ${values} GLOBAL_INJECTED_ARTIFACTS_VERSION=${GLOBAL_INJECTED_ARTIFACTS_VERSION} @@ -80,9 +81,10 @@ Set Public Ip Get Public Ip [Arguments] ${server_map} ${oam_ip} ${servers} Get Dictionary Values ${server_map} - :FOR ${server} IN @{servers} - \ ${status} ${public_ip} Run Keyword And Ignore Error Search Addresses ${server} ${oam_ip} - \ Return From Keyword If '${status}'=='PASS' ${public_ip} + FOR ${server} IN @{servers} + ${status} ${public_ip} Run Keyword And Ignore Error Search Addresses ${server} ${oam_ip} + Return From Keyword If '${status}'=='PASS' ${public_ip} + END Fail ${oam_ip} Server Not Found Search Addresses @@ -122,26 +124,29 @@ Find Openstack 2 Get V4 IP [Arguments] ${ipmaps} - :FOR ${ipmap} IN @{ipmaps} - \ ${ip} Get From Dictionary ${ipmap} addr - \ ${version} Get From Dictionary ${ipmap} version - \ Return from Keyword if '${version}' == '4' ${ip} + FOR ${ipmap} IN @{ipmaps} + ${ip} Get From Dictionary ${ipmap} addr + ${version} Get From Dictionary ${ipmap} version + Return from Keyword if '${version}' == '4' ${ip} + END Fail No Version 4 IP Get V4 IP Openstack [Arguments] ${addresses} ${testtype} ${ipmaps}= Get From Dictionary ${addresses} ${testtype} - :FOR ${ipmap} IN @{ipmaps} - \ ${ip} Get From Dictionary ${ipmap} addr - \ ${version} Get From Dictionary ${ipmap} version - \ Return from Keyword if '${version}'=='4' ${ip} + FOR ${ipmap} IN @{ipmaps} + ${ip} Get From Dictionary ${ipmap} addr + ${version} Get From Dictionary ${ipmap} version + Return from Keyword if '${version}'=='4' ${ip} + END Fail No Version 4 IP Get V4 IP Openstack 2 [Arguments] ${ipmaps} ${testtype} - :FOR ${ipmap} IN @{ipmaps} - \ ${type} Get From Dictionary ${ipmap} OS-EXT-IPS:type - \ ${ip} Get From Dictionary ${ipmap} addr - \ ${version} Get From Dictionary ${ipmap} version - \ Return from Keyword if '${version}'=='4' and '${type}'=='${testtype}' ${ip} + FOR ${ipmap} IN @{ipmaps} + ${type} Get From Dictionary ${ipmap} OS-EXT-IPS:type + ${ip} Get From Dictionary ${ipmap} addr + ${version} Get From Dictionary ${ipmap} version + Return from Keyword if '${version}'=='4' and '${type}'=='${testtype}' ${ip} + END Fail No Version 4 IP diff --git a/robot/testsuites/usecases/5gson.robot b/robot/testsuites/usecases/5gson.robot index 9c58818c..bf1b3b78 100644 --- a/robot/testsuites/usecases/5gson.robot +++ b/robot/testsuites/usecases/5gson.robot @@ -70,10 +70,11 @@ Deploying SON Polciies Create dmaap topics [Tags] 5gson - :FOR ${topic} IN @{TOPICS} - \ ${data_path}= Set Variable /events/${topic} - \ ${resp}= Run MR Post Request data_path=${data_path} - \ Should Be Equal As Strings ${resp.status_code} 200 + FOR ${topic} IN @{TOPICS} + ${data_path}= Set Variable /events/${topic} + ${resp}= Run MR Post Request data_path=${data_path} + Should Be Equal As Strings ${resp.status_code} 200 + END Deploy SON Handler [Tags] 5gson @@ -123,10 +124,11 @@ Post Fault Message to VES Collector [Tags] 5gson ${session}= Create Session configdb http://configdb.onap:8080 ${headers}= Create Dictionary content-type=application/json - :FOR ${NBR} IN @{NEW_NBRS} - \ ${nbr_obj} Set Variable {"targetCellId": "${NBR}", "ho": true} - \ ${resp} Put Request configdb ${CONFIGDB_CREATENBR_PATH}/Chn0005 headers=${headers} data=${nbr_obj} - \ Should Be Equal As Strings ${resp.status_code} 201 + FOR ${NBR} IN @{NEW_NBRS} + ${nbr_obj} Set Variable {"targetCellId": "${NBR}", "ho": true} + ${resp} Put Request configdb ${CONFIGDB_CREATENBR_PATH}/Chn0005 headers=${headers} data=${nbr_obj} + Should Be Equal As Strings ${resp.status_code} 201 + END ${fault_event}= Set Variable ${5GSON_RESOURCES_PATH}/son_fault.json Send Event to VES Collector event=${fault_event} @@ -147,8 +149,9 @@ Verify SDNC Dmaap Message ${resp}= Run MR Get Request /events/SDNR-CL/robot-cg/robot-cid @{messages}= Set Variable ${resp.json()} Should Not Be Empty ${messages} - :FOR ${msg} IN @{messages} - \ ${msg_json}= Convert String to JSON ${msg} - \ ${rpc_name}= Set Variable ${msg_json.get("rpc-name")} - \ ${no_of_msgs}= Set Variable If "${rpc_name}" == "modifyconfig" ${no_of_msgs + 1} + FOR ${msg} IN @{messages} + ${msg_json}= Convert String to JSON ${msg} + ${rpc_name}= Set Variable ${msg_json.get("rpc-name")} + ${no_of_msgs}= Set Variable If "${rpc_name}" == "modifyconfig" ${no_of_msgs + 1} + END Should Be Equal As Numbers ${no_of_msgs} 4 diff --git a/robot/testsuites/vnf-orchestration-ovp.robot b/robot/testsuites/vnf-orchestration-ovp.robot index aeabb4d3..ec797af9 100644 --- a/robot/testsuites/vnf-orchestration-ovp.robot +++ b/robot/testsuites/vnf-orchestration-ovp.robot @@ -79,15 +79,15 @@ Add Service Mapping ${template_mapping_list} Create List ${module_index}= Set Variable 0 - :FOR ${module} IN @{module_list} - \ ${empty_dict} Create Dictionary - \ ${base}= Set Variable ${module["isBase"]} - \ ${filename}= Set Variable ${module["filename"]} - \ ${index}= Set Variable If '${base}'=='true' 0 ${module_index} + 1 - \ ${name}= Remove String ${filename} .yaml .yml - \ ${preload}= Set Variable ${module["preload"]} - \ set to dictionary ${empty_dict} isBase=${base} template="" vnf_index=${index} name_pattern=${name} preload_file=${preload} - \ Append To List ${template_mapping_list} ${empty_dict} + FOR ${module} IN @{module_list} + ${empty_dict} Create Dictionary + ${base}= Set Variable ${module["isBase"]} + ${filename}= Set Variable ${module["filename"]} + ${index}= Set Variable If '${base}'=='true' 0 ${module_index} + 1 + ${name}= Remove String ${filename} .yaml .yml + ${preload}= Set Variable ${module["preload"]} + set to dictionary ${empty_dict} isBase=${base} template="" vnf_index=${index} name_pattern=${name} preload_file=${preload} + Append To List ${template_mapping_list} ${empty_dict} ${GLOBAL_SERVICE_TEMPLATE_MAPPING} Create Dictionary ${GLOBAL_SERVICE_FOLDER_MAPPING} Create Dictionary |