diff options
-rw-r--r-- | red.xml | 4 | ||||
-rw-r--r-- | robot/assets/service_mappings.py | 80 | ||||
-rw-r--r-- | robot/resources/asdc_interface.robot | 13 | ||||
-rw-r--r-- | robot/resources/heatbridge.robot | 14 | ||||
-rw-r--r-- | robot/resources/sdngc_interface.robot | 6 | ||||
-rw-r--r-- | robot/resources/stack_validation/policy_check_vfw.robot | 5 | ||||
-rw-r--r-- | robot/resources/test_templates/model_test_template.robot | 6 | ||||
-rw-r--r-- | robot/resources/test_templates/model_test_template_vcperescust.robot | 6 | ||||
-rw-r--r-- | robot/resources/test_templates/vnf_orchestration_test_template.robot | 28 |
9 files changed, 47 insertions, 115 deletions
@@ -10,8 +10,6 @@ <referencedLibrary type="PYTHON" name="SSHLibrary" path="testsuite/robot/library"/> <referencedLibrary type="PYTHON" name="HTTPUtils" path="testsuite/robot/library/eteutils"/> <referencedLibrary type="PYTHON" name="JSONUtils" path="testsuite/robot/library/eteutils"/> - <referencedLibrary type="PYTHON" name="HttpLibrary" path="testsuite/robot/library"/> - <referencedLibrary type="PYTHON" name="HttpLibrary.HTTP" path="testsuite/robot/library"/> <referencedLibrary type="PYTHON" name="StringTemplater" path="testsuite/robot/library/eteutils"/> <referencedLibrary type="PYTHON" name="OpenstackLibrary" path="testsuite/robot/library/eteutils"/> <referencedLibrary type="PYTHON" name="TemplatingEngine" path="testsuite/robot/library/eteutils"/> @@ -24,6 +22,7 @@ <referencedLibrary type="PYTHON" name="KafkaLibrary" path="testsuite/robot/library"/> <referencedLibrary type="PYTHON" name="DateTime" path="testsuite/robot/library"/> <referencedLibrary type="PYTHON" name="SocketUtils" path="testsuite/robot/library/eteutils"/> + <referencedLibrary type="PYTHON" name="ONAPLibrary.ServiceMapping" path="testsuite/robot/library"/> <pythonpath> <path location="robot/library"/> </pythonpath> @@ -31,7 +30,6 @@ <variableFiles path="../oom/kubernetes/robot/resources/config/eteshare/config/integration_preload_parameters.py"/> <variableFiles path="../oom/kubernetes/robot/resources/config/eteshare/config/integration_robot_properties.py"/> <variableFiles path="../oom/kubernetes/robot/resources/config/eteshare/config/vm_properties.py"/> - <variableFiles path="testsuite/robot/assets/service_mappings.py"/> <excludedForValidation/> <isValidatedFileSizeCheckingEnabled>true</isValidatedFileSizeCheckingEnabled> <validatedFileMaxSize>1024</validatedFileMaxSize> diff --git a/robot/assets/service_mappings.py b/robot/assets/service_mappings.py deleted file mode 100644 index 908c5401..00000000 --- a/robot/assets/service_mappings.py +++ /dev/null @@ -1,80 +0,0 @@ -import json -import os.path - - -''' -This metadata identifies the folders to be zipped and uploaded to SDC for model distribution for a given VNF -''' -GLOBAL_SERVICE_FOLDER_MAPPING = {} - -''' -Map the service to the list of VNFs to be orchestrated -''' -GLOBAL_SERVICE_VNF_MAPPING = {} - -''' -Map the service to the list of Generic Neutron Networks to be orchestrated -''' -GLOBAL_SERVICE_GEN_NEUTRON_NETWORK_MAPPING = {} - -''' -Map the service to the list of Deployment Artifacts for Closed Loop Control -''' -GLOBAL_SERVICE_DEPLOYMENT_ARTIFACT_MAPPING = {} - -''' -This metadata identifes the preloads that need to be done for a VNF as there may be more than one (vLB) -"template" maps to the parameters in the preload_paramenters.py - - GLOBAL_PRELOAD_PARAMETERS[<testcase>][<template>] - - i.e. GLOBAL_PRELOAD_PARAMETERS['Demo'][dnsscaling_preload.template'] -''' -GLOBAL_SERVICE_TEMPLATE_MAPPING = {} - -''' -Used by the Heatbridge Validate Query to A&AI to locate the vserver name -''' -GLOBAL_VALIDATE_NAME_MAPPING = {} - -# Create dictionaries for new MAPPING data to join to original MAPPING data -GLOBAL_SERVICE_FOLDER_MAPPING2 = {} -GLOBAL_SERVICE_VNF_MAPPING2 = {} -GLOBAL_SERVICE_GEN_NEUTRON_NETWORK_MAPPING2 = {} -GLOBAL_SERVICE_DEPLOYMENT_ARTIFACT_MAPPING2 = {} -GLOBAL_SERVICE_TEMPLATE_MAPPING2 = {} -GLOBAL_VALIDATE_NAME_MAPPING2 = {} - - -folder=os.path.join('./demo/service_mapping') -subfolders = [d for d in os.listdir(folder) if os.path.isdir(os.path.join(folder, d))] - -for service in subfolders: - filepath=os.path.join('./demo/service_mapping', service, 'service_mapping.json') - with open(filepath, 'r') as f: - service_mappings = json.load(f) - for mapping in service_mappings: - if mapping == 'GLOBAL_SERVICE_FOLDER_MAPPING': - GLOBAL_SERVICE_FOLDER_MAPPING2[service]=service_mappings[mapping][service] - if mapping == 'GLOBAL_SERVICE_VNF_MAPPING': - GLOBAL_SERVICE_VNF_MAPPING2[service]=service_mappings[mapping][service] - if mapping == 'GLOBAL_SERVICE_GEN_NEUTRON_NETWORK_MAPPING': - GLOBAL_SERVICE_GEN_NEUTRON_NETWORK_MAPPING2[service]=service_mappings[mapping][service] - if mapping == 'GLOBAL_SERVICE_DEPLOYMENT_ARTIFACT_MAPPING': - GLOBAL_SERVICE_DEPLOYMENT_ARTIFACT_MAPPING2[service]=service_mappings[mapping][service] - if mapping == 'GLOBAL_SERVICE_TEMPLATE_MAPPING': - # service changes for complex vnf - #GLOBAL_SERVICE_TEMPLATE_MAPPING2[service]=service_mappings[mapping][service] - for vnftype in service_mappings[mapping]: - GLOBAL_SERVICE_TEMPLATE_MAPPING2[vnftype]=service_mappings[mapping][vnftype] - if mapping == 'GLOBAL_VALIDATE_NAME_MAPPING': - # service changes for complex vnf - #GLOBAL_VALIDATE_NAME_MAPPING2[service]=service_mappings[mapping][service] - for vnftype in service_mappings[mapping]: - GLOBAL_VALIDATE_NAME_MAPPING2[vnftype]=service_mappings[mapping][vnftype] - -# Merge dictionaries -GLOBAL_SERVICE_FOLDER_MAPPING = dict(GLOBAL_SERVICE_FOLDER_MAPPING.items() + GLOBAL_SERVICE_FOLDER_MAPPING2.items()) -GLOBAL_SERVICE_VNF_MAPPING = dict(GLOBAL_SERVICE_VNF_MAPPING.items() + GLOBAL_SERVICE_VNF_MAPPING2.items()) -GLOBAL_SERVICE_GEN_NEUTRON_NETWORK_MAPPING = dict(GLOBAL_SERVICE_GEN_NEUTRON_NETWORK_MAPPING.items() + GLOBAL_SERVICE_GEN_NEUTRON_NETWORK_MAPPING2.items()) -GLOBAL_SERVICE_DEPLOYMENT_ARTIFACT_MAPPING = dict(GLOBAL_SERVICE_DEPLOYMENT_ARTIFACT_MAPPING.items() + GLOBAL_SERVICE_DEPLOYMENT_ARTIFACT_MAPPING2.items()) -GLOBAL_SERVICE_TEMPLATE_MAPPING = dict(GLOBAL_SERVICE_TEMPLATE_MAPPING.items() + GLOBAL_SERVICE_TEMPLATE_MAPPING2.items()) -GLOBAL_VALIDATE_NAME_MAPPING = dict(GLOBAL_VALIDATE_NAME_MAPPING.items() + GLOBAL_VALIDATE_NAME_MAPPING2.items()) diff --git a/robot/resources/asdc_interface.robot b/robot/resources/asdc_interface.robot index b790525c..fc17034d 100644 --- a/robot/resources/asdc_interface.robot +++ b/robot/resources/asdc_interface.robot @@ -11,6 +11,7 @@ Library StringTemplater Library ArchiveLibrary Library HEATUtils Library DateTime +Library ONAPLibrary.ServiceMapping Resource global_properties.robot Resource browser_setup.robot Resource json_templater.robot @@ -78,8 +79,8 @@ Distribute Model From ASDC ${catalog_resources}= Create Dictionary ##### TODO: Support for Multiple resources of one type in a service ###### # The zip list is the resources - no mechanism to indicate more than 1 of the items in the zip list - # GLOBAL_SERVICE_VNF_MAPPING has the logical mapping but it is not the same key as model_zip_path - # ${vnflist}= Get From Dictionary ${GLOBAL_SERVICE_VNF_MAPPING} ${service} + # Get Service Vnf Mapping has the logical mapping but it is not the same key as model_zip_path + # ${vnflist}= Get Service Vnf Mapping alias ${service} # Save the resource_id in a dictionary keyed by the resource name in the zipfile name (vFWDT_vFWSNK.zip or vFWDT_vPKG.zip) # Create the resources but do not immediately add resource # Add Resource to Service in a separate FOR loop @@ -94,8 +95,8 @@ Distribute Model From ASDC \ Set To Dictionary ${resource_types} ${resource_type_string} ${loop_catalog_resource_id} \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id} - - ${vnflist}= Get From Dictionary ${GLOBAL_SERVICE_VNF_MAPPING} ${service} + Set Directory default ./demo/service_mapping + ${vnflist}= Get Service Vnf Mapping default ${service} # Spread the icons on the pallette starting on the left ${xoffset}= Set Variable ${0} @@ -110,7 +111,7 @@ Distribute Model From ASDC ${vf_module}= Find Element In Array ${loop_catalog_resource_resp['groups']} type org.openecomp.groups.VfModule # # do network - ${networklist}= Get From Dictionary ${GLOBAL_SERVICE_GEN_NEUTRON_NETWORK_MAPPING} ${service} + ${networklist}= 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} @@ -125,7 +126,7 @@ Distribute Model From ASDC # # do deployment artifacts # - ${deploymentlist}= Get From Dictionary ${GLOBAL_SERVICE_DEPLOYMENT_ARTIFACT_MAPPING} ${service} + ${deploymentlist}= Get Service Deployment Artifact Mapping default ${service} :FOR ${deployment} IN @{deploymentlist} \ ${loop_catalog_resource_resp}= Get ASDC 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} diff --git a/robot/resources/heatbridge.robot b/robot/resources/heatbridge.robot index f155c8f3..e3202e07 100644 --- a/robot/resources/heatbridge.robot +++ b/robot/resources/heatbridge.robot @@ -4,6 +4,7 @@ Library Collections Library StringTemplater Library OperatingSystem Library UUID +Library ONAPLibrary.ServiceMapping Resource openstack/keystone_interface.robot Resource openstack/heat_interface.robot @@ -63,7 +64,7 @@ Execute Heatbridge Should Match Regexp ${status_string} ^(201|200)$ ${reverse_heatbridge}= Generate Reverse Heatbridge From Stack Info ${stack_info} Set Test Variable ${REVERSE_HEATBRIDGE} ${reverse_heatbridge} - Run Validation Query ${stack_info} ${service} + Run Validation Query ${stack_info} ${service} ${vnf_id} Run Create VNFC [Documentation] Create a VNFC for a vServer @@ -80,9 +81,12 @@ Run Create VNFC Run Validation Query [Documentation] Run A&AI query to validate the bulk add - [Arguments] ${stack_info} ${service} + [Arguments] ${stack_info} ${service} ${vnf_id} Return from Keyword If '${service}' == '' - ${server_name_parameter}= Get From Dictionary ${GLOBAL_VALIDATE_NAME_MAPPING} ${service} + Set Directory default ./demo/service_mapping + ${payload}= Run Get Generic VNF by VnfId ${vnf_id} + ${vnf_type}= Catenate ${payload.json()[vnf-type]} + ${server_name_parameter}= Get Validate Name Mapping default ${service} ${vnf_type} ${vserver_name}= Get From Dictionary ${stack_info} ${server_name_parameter} Run Vserver Query ${vserver_name} @@ -100,9 +104,9 @@ Run Set VNF Params [Documentation] Run A&A GET and PUT to set prov-status, orchestration status, and ipv4-oam-address [Arguments] ${vnf_id} ${ipv4_vnf_address} ${prov_status}=ACTIVE ${orch_status}=Active ${payload}= Run Get Generic VNF by VnfId ${vnf_id} - + ${vnf_type}= Catenate ${payload.json()[vnf-type]} #${payload_json}= evaluate json.loads('''${payload}''') json - set to dictionary ${payload} prov-status ${prov_status} + set to dictionary ${payload} vnf-type ${prov_status} set to dictionary ${payload} orchestration-status ${orch_status} set to dictionary ${payload} ipv4-oam-address ${ipv4_vnf_address} ${payload_string}= evaluate json.dumps(${payload}) json diff --git a/robot/resources/sdngc_interface.robot b/robot/resources/sdngc_interface.robot index 0570be8a..d4a16ac9 100644 --- a/robot/resources/sdngc_interface.robot +++ b/robot/resources/sdngc_interface.robot @@ -7,11 +7,12 @@ Library SeleniumLibrary Library Collections Library String Library StringTemplater +Library ONAPLibrary.ServiceMapping + Resource global_properties.robot Resource ../resources/json_templater.robot Resource browser_setup.robot -Variables ../assets/service_mappings.py *** Variables *** ${PRELOAD_VNF_TOPOLOGY_OPERATION_PATH} /operations/VNF-API:preload-vnf-topology-operation @@ -85,7 +86,8 @@ Preload Vnf [Arguments] ${service_type_uuid} ${generic_vnf_name} ${generic_vnf_type} ${vf_module_name} ${vf_modules} ${service} ${uuid} ${base_vf_module_type}= Catenate ${closedloop_vf_module}= Create Dictionary - ${templates}= Get From Dictionary ${GLOBAL_SERVICE_TEMPLATE_MAPPING} ${service} + Set Directory default ./demo/service_mapping + ${templates}= Get Service Template Mapping default ${service} ${generic_vnf_type} :FOR ${vf_module} IN @{vf_modules} \ ${vf_module_type}= Get From Dictionary ${vf_module} name # need to pass in vnf_index if non-zero diff --git a/robot/resources/stack_validation/policy_check_vfw.robot b/robot/resources/stack_validation/policy_check_vfw.robot index 35f7dea3..b3c225aa 100644 --- a/robot/resources/stack_validation/policy_check_vfw.robot +++ b/robot/resources/stack_validation/policy_check_vfw.robot @@ -9,6 +9,8 @@ Library OpenstackLibrary Library HEATUtils Library Collections Library String +Library ONAPLibrary.ServiceMapping + Resource ../openstack/keystone_interface.robot Resource ../openstack/nova_interface.robot Resource ../openstack/heat_interface.robot @@ -91,7 +93,8 @@ Policy Check vLB Stack [Return] ${dnsscaling} Get DNSScaling Prefix - ${mapping}= Get From Dictionary ${GLOBAL_SERVICE_TEMPLATE_MAPPING} vLB + Set Directory default ./demo/service_mapping + ${mapping}= Get Service Template Mapping default vLB vLB :FOR ${dict} IN @{mapping} \ Return From Keyword If '${dict['isBase']}' == 'false' ${dict['prefix']} [Return] None diff --git a/robot/resources/test_templates/model_test_template.robot b/robot/resources/test_templates/model_test_template.robot index 47083c3b..67c95e98 100644 --- a/robot/resources/test_templates/model_test_template.robot +++ b/robot/resources/test_templates/model_test_template.robot @@ -5,10 +5,9 @@ Library ArchiveLibrary Library Collections Library String Library DateTime +Library ONAPLibrary.ServiceMapping Resource ../asdc_interface.robot -Variables ../../assets/service_mappings.py - *** Variables *** ${ASDC_BASE_PATH} /sdc1 ${ASDC_DESIGNER_PATH} /proxy-designer1#/dashboard @@ -23,7 +22,8 @@ ${CATALOG_SERVICE_ID} Model Distribution For Directory [Arguments] ${service} ${catalog_service_name}= ${cds}= - ${directory_list}= Get From Dictionary ${GLOBAL_SERVICE_FOLDER_MAPPING} ${service} + Set Directory default ./demo/service_mapping + ${directory_list}= Get Service Folder Mapping default ${service} ${ziplist}= Create List ${uuid}= Get Current Date ${service_name}= Catenate ${service} ${uuid} diff --git a/robot/resources/test_templates/model_test_template_vcperescust.robot b/robot/resources/test_templates/model_test_template_vcperescust.robot index 17e3965d..b096a302 100644 --- a/robot/resources/test_templates/model_test_template_vcperescust.robot +++ b/robot/resources/test_templates/model_test_template_vcperescust.robot @@ -5,10 +5,9 @@ Library ArchiveLibrary Library Collections Library String Library DateTime +Library ONAPLibrary.ServiceMapping Resource ../asdc_interface.robot -Variables ../../assets/service_mappings.py - *** Variables *** ${ASDC_BASE_PATH} /sdc1 ${ASDC_DESIGNER_PATH} /proxy-designer1#/dashboard @@ -23,7 +22,8 @@ ${CATALOG_SERVICE_ID} Model Distribution For vCPEResCust Directory [Arguments] ${service} ${catalog_service_name}= ${cds}= - ${directory_list}= Get From Dictionary ${GLOBAL_SERVICE_FOLDER_MAPPING} ${service} + Set Directory default ./demo/service_mapping + ${directory_list}= Get Service Folder Mapping default ${service} ${ziplist}= Create List ${uuid}= Get Current Date ${service_name}= Catenate ${service} ${uuid} diff --git a/robot/resources/test_templates/vnf_orchestration_test_template.robot b/robot/resources/test_templates/vnf_orchestration_test_template.robot index ec22265b..49201b50 100644 --- a/robot/resources/test_templates/vnf_orchestration_test_template.robot +++ b/robot/resources/test_templates/vnf_orchestration_test_template.robot @@ -23,6 +23,7 @@ Library SeleniumLibrary Library UUID Library Collections Library JSONUtils +Library ONAPLibrary.ServiceMapping @@ -66,7 +67,8 @@ Orchestrate VNF ${service_instance_id}= Wait Until Keyword Succeeds 300s 5s Create VID Service Instance ${customer_name} ${service_model_type} ${service} ${service_name} ${project_name} ${owning_entity} Set Test Variable ${SERVICE_INSTANCE_ID} ${service_instance_id} Validate Service Instance ${service_instance_id} ${service} ${customer_name} - ${vnflist}= Get From Dictionary ${GLOBAL_SERVICE_VNF_MAPPING} ${service} + Set Directory default ./demo/service_mapping + ${vnflist}= Get Service Vnf Mapping default ${service} ${generic_vnfs}= Create Dictionary ${vnf_name_index}= Set Variable 0 ${vf_module_name_list}= Create List @@ -76,8 +78,8 @@ Orchestrate VNF \ ${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} - \ ${vf_module}= Get VF Module ${catalog_resources} ${vnf} + \ ${vnf_type}= Get VNF Type ${catalog_resources} ${vnf} ${service} + \ ${vf_module}= Get VF Module ${catalog_resources} ${vnf} ${service} \ Append To List ${STACK_NAMES} ${vf_module_name} \ Wait Until Keyword Succeeds 300s 5s Create VID VNF ${service_instance_id} ${vnf_name} ${product_family} ${lcp_region} ${tenant} ${vnf_type} ${CUSTOMER_NAME} \ ${vf_module_type} ${closedloop_vf_module}= Preload Vnf ${service_instance_id} ${vnf_name} ${vnf_type} ${vf_module_name} ${vf_module} ${vnf} ${uuid} @@ -116,7 +118,8 @@ Orchestrate Demo VNF ${service_instance_id}= Wait Until Keyword Succeeds 300s 5s Create VID Service Instance ${customer_name} ${service_model_type} ${service} ${service_name} ${project_name} ${owning_entity} Set Test Variable ${SERVICE_INSTANCE_ID} ${service_instance_id} Validate Service Instance ${service_instance_id} ${service} ${customer_name} - ${vnflist}= Get From Dictionary ${GLOBAL_SERVICE_VNF_MAPPING} ${service} + Set Directory default ./demo/service_mapping + ${vnflist}= Get Service Vnf Mapping default ${service} ${generic_vnfs}= Create Dictionary :FOR ${vnf} IN @{vnflist} \ ${vnf_name}= Catenate Ete_${vnf}_${uuid} @@ -141,23 +144,23 @@ Orchestrate Demo VNF Get VNF Type [Documentation] To support services with multiple VNFs, we need to dig the vnf type out of the SDC catalog resources to select in the VID UI - [Arguments] ${resources} ${vnf} - ${cr}= Get Catalog Resource ${resources} ${vnf} + [Arguments] ${resources} ${vnf} ${service} + ${cr}= Get Catalog Resource ${resources} ${vnf} ${service} ${vnf_type}= Get From Dictionary ${cr} name [Return] ${vnf_type} Get VF Module [Documentation] To support services with multiple VNFs, we need to dig the vnf type out of the SDC catalog resources to select in the VID UI - [Arguments] ${resources} ${vnf} - ${cr}= Get Catalog Resource ${resources} ${vnf} + [Arguments] ${resources} ${vnf} ${service} + ${cr}= Get Catalog Resource ${resources} ${vnf} ${service} ${vf_module}= Find Element In Array ${cr['groups']} type org.openecomp.groups.VfModule [Return] ${vf_module} Get Catalog Resource [Documentation] To support services with multiple VNFs, we need to dig the vnf type out of the SDC catalog resources to select in the VID UI - [Arguments] ${resources} ${vnf} + [Arguments] ${resources} ${vnf} ${service} - ${base_name}= Get Name Pattern ${vnf} + ${base_name}= Get Name Pattern ${vnf} ${service} ${keys}= Get Dictionary Keys ${resources} :FOR ${key} IN @{keys} @@ -168,8 +171,9 @@ Get Catalog Resource Get Name Pattern [Documentation] To support services with multiple VNFs, we need to dig the vnf type out of the SDC catalog resources to select in the VID UI - [Arguments] ${vnf} - ${list}= Get From Dictionary ${GLOBAL_SERVICE_TEMPLATE_MAPPING} ${vnf} + [Arguments] ${vnf} ${service} + Set Directory default ./demo/service_mapping + ${list}= 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} |