diff options
Diffstat (limited to 'robot/resources/test_templates')
3 files changed, 42 insertions, 71 deletions
diff --git a/robot/resources/test_templates/closedloop_test_template.robot b/robot/resources/test_templates/closedloop_test_template.robot index 95af32b9..e43233e0 100644 --- a/robot/resources/test_templates/closedloop_test_template.robot +++ b/robot/resources/test_templates/closedloop_test_template.robot @@ -1,14 +1,12 @@ *** Settings *** Documentation Policy Closed Loop Test cases -Resource ../policy_interface.robot Resource ../stack_validation/policy_check_vfw.robot -Resource ../stack_validation/packet_generator_interface.robot -Resource vnf_orchestration_test_template.robot Library String Library Process Library ONAPLibrary.Templating +Library ONAPLibrary.Utilities *** Variables *** ${RESOURCE_PATH_CREATE} /pdp/createPolicy @@ -54,24 +52,18 @@ ${DNSSCALINGSTACK} VFW Policy Log Suite name ${SUITE NAME} ${TEST NAME} ${PREV TEST NAME} Initialize VFW Policy - ${stackname}= Orchestrate VNF vFW closedloop + ${stackname} ${generic_vnfs} ${server_id} ${service_instance_id} ${customer_name}= Orchestrate VNF vFW closedloop Policy Check FirewallCL Stack ${stackname} ${VFWPOLICYRATE} - # there is none of this - Delete VNF ${None} ${None} + Delete VNF ${None} ${server_id} ${customer_name} ${service_instance_id} ${stackname} VDNS Policy Initialize VDNS Policy - ${stackname}= Orchestrate VNF vDNS closedloop + ${stackname} ${generic_vnfs} ${server_id} ${service_instance_id} ${customer_name}= Orchestrate VNF vDNS closedloop ${dnsscaling}= Policy Check vLB Stack ${stackname} ${VLBPOLICYRATE} Set Test Variable ${DNSSCALINGSTACK} ${dnsscaling} - # there is none of this - Delete VNF ${None} ${None} + Delete VNF ${None} ${server_id} ${customer_name} ${service_instance_id} ${stackname} Initialize VFW Policy -# Create Config Policy -# Push Config Policy ${CONFIG_POLICY_NAME} ${CONFIG_POLICY_TYPE} -# Create Ops Policy -# Push Ops Policy ${OPS_POLICY_NAME} ${OPS_POLICY_TYPE} Get Configs VFW Policy Initialize VDNS Policy @@ -116,8 +108,9 @@ Get Configs VDNS Policy Teardown Closed Loop [Documentation] Tear down a closed loop test case + [Arguments] ${customer_name} Terminate All Processes - Teardown VNF + Teardown VNF ${customer_name} Log Teardown complete Create Config Policy @@ -193,15 +186,19 @@ Orchestrate VNF vFW closedloop [Documentation] VNF Orchestration for vFW Log VNF Orchestration flow TEST NAME=${TEST NAME} ${tenant_id} ${tenant_name}= Setup Orchestrate VNF ${GLOBAL_AAI_CLOUD_OWNER} SharedNode OwnerType v1 CloudZone - ${stack_name}= Orchestrate VNF ETE_CLP vFWCL vFWCL ${tenant_id} ${tenant_name} - [Return] ${stack_name} + ${uuid}= Generate UUID4 + ${stack_names} ${generic_vnfs} ${server_id} ${service_instance_id}= Orchestrate VNF ETE_CLP_${uuid} vFWCL vFWCL ${tenant_id} ${tenant_name} + ${customer_name}= Catenate ETE_CLP_${uuid} + [Return] ${stack_names} ${generic_vnfs} ${server_id} ${service_instance_id} ${customer_name} Orchestrate VNF vDNS closedloop [Documentation] VNF Orchestration for vLB Log VNF Orchestration flow TEST NAME=${TEST NAME} ${tenant_id} ${tenant_name}= Setup Orchestrate VNF ${GLOBAL_AAI_CLOUD_OWNER} SharedNode OwnerType v1 CloudZone - ${stack_name}= Orchestrate VNF ETE_CLP vLB vLB ${tenant_id} ${tenant_name} - [Return] ${stack_name} + ${uuid}= Generate UUID4 + ${stack_names} ${generic_vnfs} ${server_id} ${service_instance_id}= Orchestrate VNF ETE_CLP_${uuid} vLB vLB ${tenant_id} ${tenant_name} + ${customer_name}= Catenate ETE_CLP_${uuid} + [Return] ${stack_names} ${generic_vnfs} ${server_id} ${service_instance_id} ${customer_name} VFWCL High Test [Documentation] Test Control Loop for High Traffic diff --git a/robot/resources/test_templates/vnf_orchestration_test_template.robot b/robot/resources/test_templates/vnf_orchestration_test_template.robot index dc239a8d..64c4a215 100644 --- a/robot/resources/test_templates/vnf_orchestration_test_template.robot +++ b/robot/resources/test_templates/vnf_orchestration_test_template.robot @@ -26,42 +26,30 @@ Library ONAPLibrary.JSON Library ONAPLibrary.ServiceMapping WITH NAME ServiceMapping - -*** Variables *** - -#**************** TEST CASE VARIABLES ************************** -${CUSTOMER_NAME} -${STACK_NAME} -${STACK_NAMES} -${SERVICE_INSTANCE_ID} - *** Keywords *** Orchestrate VNF Template - [Teardown] Teardown VNF [Documentation] Use openECOMP to Orchestrate a service. [Arguments] ${customer_name} ${service} ${product_family} ${delete_flag}=DELETE ${tenant_id} ${tenant_name}= Setup Orchestrate VNF ${GLOBAL_AAI_CLOUD_OWNER} SharedNode OwnerType v1 CloudZone - ${vf_module_name_list} ${generic_vnfs} ${server_id}= Orchestrate VNF ${customer_name} ${service} ${product_family} ${tenant_id} ${tenant_name} - Run Keyword If '${delete_flag}' == 'DELETE' Delete VNF ${tenant_name} ${server_id} + ${uuid}= Generate UUID4 + ${vf_module_name_list} ${generic_vnfs} ${server_id} ${service_instance_id}= Orchestrate VNF ${customer_name}_${uuid} ${service} ${product_family} ${tenant_id} ${tenant_name} + Run Keyword If '${delete_flag}' == 'DELETE' Delete VNF ${tenant_name} ${server_id} ${customer_name}_${uuid} ${service_instance_id} ${vf_module_name_list} + [Teardown] Teardown VNF ${customer_name}_${uuid} Orchestrate VNF [Documentation] Use openECOMP to Orchestrate a service. [Arguments] ${customer_name} ${service} ${product_family} ${tenant_id} ${tenant_name} ${project_name}=Project-Demonstration ${owning_entity}=OE-Demonstration ${lcp_region}= Get Openstack Region ${uuid}= Generate UUID4 - Set Test Variable ${CUSTOMER_NAME} ${customer_name}_${uuid} - ${list}= Create List - Set Test Variable ${STACK_NAMES} ${list} ${service_name}= Catenate Service_Ete_Name${uuid} ${service_type}= Set Variable ${service} ${service_model_type} ${vnf_type} ${vf_modules} ${catalog_resources}= Model Distribution For Directory ${service} Set Suite Variable ${SUITE_SERVICE_MODEL_NAME} ${service_model_type} ${server_id}= Run Keyword If '${service}' == 'vVG' Create VVG Server ${uuid} - Create Customer For VNF ${CUSTOMER_NAME} ${CUSTOMER_NAME} INFRA ${service_type} ${GLOBAL_AAI_CLOUD_OWNER} ${tenant_id} + Create Customer For VNF ${customer_name} ${customer_name} INFRA ${service_type} ${GLOBAL_AAI_CLOUD_OWNER} ${tenant_id} Setup Browser Login To VID GUI ${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} ServiceMapping.Set Directory default ./demo/service_mapping ${vnflist}= ServiceMapping.Get Service Vnf Mapping default ${service} @@ -76,18 +64,16 @@ Orchestrate VNF \ ${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} - \ 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_name} ${vnf_type} ${CUSTOMER_NAME} + \ Wait Until Keyword Succeeds 300s 5s Create VID VNF ${service_instance_id} ${vnf_name} ${product_family} ${lcp_region} ${tenant_name} ${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} - \ ${vf_module_id}= Create VID VNF module ${service_instance_id} ${vf_module_name} ${lcp_region} ${tenant_name} ${vf_module_type} ${CUSTOMER_NAME} ${vnf_name} + \ ${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} - \ Set Test Variable ${STACK_NAME} ${vf_module_name} # TODO: Need to look at a better way to default ipv4_oam_interface search for Heatbridge - \ Execute Heatbridge ${vf_module_name} ${service_instance_id} ${vnf} ipv4_oam_interface + \ Execute Heatbridge ${vf_module_name} ${vnf} ipv4_oam_interface \ Validate VF Module ${vf_module_name} ${vnf} \ Append To List ${vf_module_name_list} ${vf_module_name} - [Return] ${vf_module_name_list} ${generic_vnfs} ${server_id} + [Return] ${vf_module_name_list} ${generic_vnfs} ${server_id} ${service_instance_id} Orchestrate Demo VNF @@ -99,18 +85,17 @@ Orchestrate Demo VNF ... '${service}'=='vLB' demoVLB ${lcp_region}= Get Openstack Region ${uuid}= Generate UUID4 - Set Test Variable ${CUSTOMER_NAME} ${customer_name}_${uuid} + ${full_customer_name}= Catenate ${customer_name}_${uuid} ${list}= Create List - Set Test Variable ${STACK_NAMES} ${list} + ${vf_module_name_list}= Create List ${service_name}= Catenate Service_Ete_Name${uuid} ${service_type}= Set Variable ${service} ${vnf_json_resources}= Get SDC Demo Vnf Catalog Resource ${service_model_type} Set Suite Variable ${SUITE_SERVICE_MODEL_NAME} ${service_model_type} - Create Customer For VNF ${CUSTOMER_NAME} ${CUSTOMER_NAME} INFRA ${service_type} ${GLOBAL_AAI_CLOUD_OWNER} ${tenant_id} + Create Customer For VNF ${full_customer_name} ${full_customer_name} INFRA ${service_type} ${GLOBAL_AAI_CLOUD_OWNER} ${tenant_id} Setup Browser Login To VID GUI ${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} ServiceMapping.Set Directory default ./demo/service_mapping ${vnflist}= ServiceMapping.Get Service Vnf Mapping default ${service} @@ -120,18 +105,17 @@ Orchestrate Demo VNF \ ${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']} - \ 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_name} ${vnf_type} ${CUSTOMER_NAME} + \ Wait Until Keyword Succeeds 300s 5s 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} \ ${vf_module_type} ${closedloop_vf_module}= Preload Vnf ${service_instance_id} ${vnf_name} ${vnf_type} ${vf_module_name} ${vf_modules} ${vnf} ${uuid} - \ ${vf_module_id}= Create VID VNF module ${service_instance_id} ${vf_module_name} ${lcp_region} ${tenant_name} ${vf_module_type} ${CUSTOMER_NAME} ${vnf_name} + \ ${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} - \ Set Test Variable ${STACK_NAME} ${vf_module_name} # TODO: Need to look at a better way to default ipv4_oam_interface search for Heatbridge - \ Execute Heatbridge ${vf_module_name} ${service_instance_id} ${vnf} ipv4_oam_interface + \ Execute Heatbridge ${vf_module_name} ${vnf} ipv4_oam_interface \ Validate VF Module ${vf_module_name} ${vnf} + \ Append To List ${vf_module_name_list} ${vf_module_name} [Return] ${vf_module_name} ${service} ${generic_vnfs} @@ -216,19 +200,19 @@ Create VVG Server Delete VNF [Documentation] Called at the end of a test case to tear down the VNF created by Orchestrate VNF - [Arguments] ${tenant_name} ${server_id} + [Arguments] ${tenant_name} ${server_id} ${customer_name} ${service_instance_id} ${vf_module_name_list} ${lcp_region}= Get Openstack Region ${list}= Create List # remove duplicates, sort vFW-> vPKG , revers to get vPKG > vFWSNK ${sorted_stack_names}= Create List - ${sorted_stack_names}= Remove Duplicates ${STACK_NAMES} + ${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} Teardown VVG Server ${server_id} - Run Keyword and Ignore Error Teardown VID ${SERVICE_INSTANCE_ID} ${lcp_region} ${tenant_name} ${CUSTOMER_NAME} + Run Keyword and Ignore Error Teardown VID ${service_instance_id} ${lcp_region} ${tenant_name} ${customer_name} # :FOR ${stack} IN @{sorted_stack_names} \ Run Keyword and Ignore Error Teardown Stack ${stack} @@ -241,8 +225,9 @@ Delete VNF Teardown VNF [Documentation] Called at the end of a test case to tear down the VNF created by Orchestrate VNF + [Arguments] ${customer_name} Run Keyword If '${TEST STATUS}' == 'PASS' Teardown Model Distribution - Run Keyword If '${TEST STATUS}' == 'PASS' Clean A&AI Inventory + Run Keyword If '${TEST STATUS}' == 'PASS' Clean A&AI Inventory ${customer_name} Close All Browsers Log Teardown VNF implemented for successful tests only @@ -286,4 +271,5 @@ Teardown Stack Clean A&AI Inventory [Documentation] Clean up Tenant in A&AI, Create Customer, Create Service and related relationships - Delete Customer ${CUSTOMER_NAME} + [Arguments] ${customer_name} + Delete Customer ${customer_name} 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 34a1be8f..ec746ff0 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 @@ -37,29 +37,18 @@ ${so_request_template} so/cds_request.jinja ${vnf_template_name} so/cds_vnf.jinja ${vfmodule_template_name} so/cds_vfmodule.jinja ${so_uri_path} /onap/so/infra/serviceInstantiation/v7/serviceInstances -*** Variables *** - -#**************** TEST CASE VARIABLES ************************** -${CUSTOMER_NAME} -${STACK_NAME} -${STACK_NAMES} -${SERVICE_INSTANCE_ID} *** Keywords *** Orchestrate VNF With CDS Template [Documentation] Use openECOMP to Orchestrate a service. - [Arguments] ${customer_name} ${service} ${product_family} - Orchestrate VNF With CDS ${customer_name} ${service} ${product_family} + [Arguments] ${customer_name} ${service_instance_name} ${product_family} + ${uuid}= Generate UUID4 + Orchestrate VNF With CDS ${customer_name}_${uuid} ${service_instance_name}${uuid} ${product_family} Orchestrate VNF With CDS [Documentation] Use openECOMP to Orchestrate a service. - [Arguments] ${customer_name} ${service} ${product_family} ${project_name}=Project-Demonstration ${owning_entity}=OE-Demonstration + [Arguments] ${customer_name} ${service_instance_name} ${product_family} ${project_name}=Project-Demonstration ${owning_entity}=OE-Demonstration ${lcp_region}= Get Openstack Region - ${uuid}= Generate UUID4 - Set Test Variable ${CUSTOMER_NAME} ${customer_name}_${uuid} - ${list}= Create List - Set Test Variable ${STACK_NAMES} ${list} - ${service_instance_name}= Catenate Service_Ete_Name${uuid} ${dict}= Create Dictionary Set To Dictionary ${dict} service_instance_name=${service_instance_name} @@ -77,7 +66,6 @@ Orchestrate VNF With CDS Set To Dictionary ${dict} cloud_region=${envjson['cloud_region']} Set To Dictionary ${dict} tenant_id=${envjson['tenant_id']} - ${list}= Create List ${vnfs}= Get From Dictionary ${jsondata['topology_template']} node_templates ${keys}= Get Dictionary Keys ${vnfs} Create Environment cds ${GLOBAL_TEMPLATE_FOLDER} |