diff options
author | Krzysztof Kuzmicki <krzysztof.kuzmicki@nokia.com> | 2020-03-06 14:06:48 +0100 |
---|---|---|
committer | Morgan Richomme <morgan.richomme@orange.com> | 2020-04-01 06:55:30 +0000 |
commit | 888614e469ca672ddac67cdc2b57ce48497da441 (patch) | |
tree | 9db2188d058097967f2b96795f70cc583e94139f /robot/resources | |
parent | 9f863418055651d4b6fa9772e1f9a94c3efe8c6c (diff) |
Extend PnF registrate test cases for GR API
Issue-ID: INT-1477
Signed-off-by: Krzysztof Kuzmicki <krzysztof.kuzmicki@nokia.com>
Change-Id: If7ade6850bd59799d5445cebe27db5c948522e06
Diffstat (limited to 'robot/resources')
-rw-r--r-- | robot/resources/aai/create_customer.robot | 13 | ||||
-rw-r--r-- | robot/resources/aai/create_service.robot | 11 | ||||
-rw-r--r-- | robot/resources/sdc_interface.robot | 23 | ||||
-rw-r--r-- | robot/resources/so/create_service_instance.robot | 24 | ||||
-rw-r--r-- | robot/resources/test_templates/pnf_orchestration_test_template.robot | 49 | ||||
-rw-r--r-- | robot/resources/test_templates/pnf_registration_without_SO_template.robot | 28 |
6 files changed, 126 insertions, 22 deletions
diff --git a/robot/resources/aai/create_customer.robot b/robot/resources/aai/create_customer.robot index 6fbb84c7..c0498b6c 100644 --- a/robot/resources/aai/create_customer.robot +++ b/robot/resources/aai/create_customer.robot @@ -33,4 +33,15 @@ Delete Customer Exists [Documentation] Deletes a customer in A&AI [Arguments] ${customer_id} ${resource_version_id} ${put_resp}= AAI.Run Delete Request ${AAI_FRONTEND_ENDPOINT} ${INDEX PATH}${ROOT_CUSTOMER_PATH}${customer_id} ${resource_version_id} auth=${GLOBAL_AAI_AUTHENTICATION} - Should Be Equal As Strings ${put_resp.status_code} 204
\ No newline at end of file + Should Be Equal As Strings ${put_resp.status_code} 204 + +Get OwningEntity Id + [Documentation] Returns OwningEntity Id based on OwningEntity name + [Arguments] ${name} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} /aai/v11/business/owning-entities auth=${GLOBAL_AAI_AUTHENTICATION} + @{list}= Copy List ${resp.json['owning-entity']} + :FOR ${map} IN @{list} + \ ${owning_entity_name}= Run Keyword And Ignore Error Get From Dictionary ${map} owning-entity-name + \ ${owning_entity_id}= Run Keyword And Ignore Error 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 diff --git a/robot/resources/aai/create_service.robot b/robot/resources/aai/create_service.robot index e473d491..0dc7a2f2 100644 --- a/robot/resources/aai/create_service.robot +++ b/robot/resources/aai/create_service.robot @@ -59,6 +59,17 @@ Get Services Run Keyword If '${status}' == 'PASS' Update Service Dictionary ${dict} ${resp.json()} [Return] ${dict} +Get Service Id + [Documentation] Gets a service id in A&AI + [Arguments] ${service_description} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${INDEX PATH}${ROOT_SERVICE_PATH} auth=${GLOBAL_AAI_AUTHENTICATION} + @{list}= Copy List ${resp.json['service']} + :FOR ${map} IN @{list} + \ ${service_type}= Run Keyword And Ignore Error Get From Dictionary ${map} service-description + \ ${service_id}= Run Keyword And Ignore Error Get From Dictionary ${map} service-id + \ ${id} Run Keyword If '${service_type}' == '${service_description}' Set Variable ${service_id} + [Return] ${id} + Update Service Dictionary [Arguments] ${dict} ${json} @{list}= Copy List ${json['service']} diff --git a/robot/resources/sdc_interface.robot b/robot/resources/sdc_interface.robot index 4b1d61ba..a85ba27f 100644 --- a/robot/resources/sdc_interface.robot +++ b/robot/resources/sdc_interface.robot @@ -91,7 +91,7 @@ Distribute Model From SDC ... 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} + \ Set To Dictionary ${resource_types} ${resource_type_string} ${loop_catalog_resource_id} \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id} ServiceMapping.Set Directory default ${GLOBAL_SERVICE_MAPPING_DIRECTORY} @@ -260,14 +260,19 @@ Download CSAR Get Generic NeutronNet UUID [Documentation] Look up the UUID of the Generic NeutronNetwork Resource - ${resp}= SDC.Run Get Request ${SDC_BE_ENDPOINT} ${SDC_CATALOG_RESOURCES_QUERY_PATH}/Generic%20NeutronNet/resourceVersion/1.0 ${SDC_DESIGNER_USER_ID} auth=${GLOBAL_SDC_AUTHENTICATION} - [Return] ${resp.json()['allVersions']['1.0']} + ${json}= Get Resource Catalog Generic%20NeutronNet + [Return] ${json['allVersions']['1.0']} Get AllottedResource UUID [Documentation] Look up the UUID of the Allotted Resource # if this fails then the AllottedResource template got deleted from SDC by mistake - ${resp}= SDC.Run Get Request ${SDC_BE_ENDPOINT} ${SDC_CATALOG_RESOURCES_QUERY_PATH}/AllottedResource/resourceVersion/1.0 ${SDC_DESIGNER_USER_ID} auth=${GLOBAL_SDC_AUTHENTICATION} - [Return] ${resp.json()['allVersions']['1.0']} + ${json}= Get Resource Catalog AllottedResource + [Return] ${json['allVersions']['1.0']} + +Get Resource Catalog + [Arguments] ${resource_name} + ${resp}= SDC.Run Get Request ${SDC_BE_ENDPOINT} ${SDC_CATALOG_RESOURCES_QUERY_PATH}/${resource_name}/resourceVersion/1.0 ${SDC_DESIGNER_USER_ID} auth=${GLOBAL_SDC_AUTHENTICATION} + [Return] ${resp.json()} Loop Over Check Catalog Service Distributed [Arguments] ${catalog_service_id} @@ -456,7 +461,7 @@ Add SDC License Model ${resp}= SDC.Run Post Request ${SDC_BE_ONBOARD_ENDPOINT} ${SDC_VENDOR_LICENSE_MODEL_PATH} ${data} ${SDC_DESIGNER_USER_ID} auth=${GLOBAL_SDC_AUTHENTICATION} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']} - + Get SDC License Model [Documentation] gets an SDC license model by its id [Arguments] ${id} ${version_id}=0.1 @@ -717,7 +722,7 @@ Set SDC Catalog Resource VNF Inputs [Return] ${resp.json()} Get Service Catalog - [Arguments] ${service_name} + [Arguments] ${service_name} ${resp}= SDC.Run Get Request ${SDC_BE_ENDPOINT} ${SDC_CATALOG_SERVICES_PATH}/serviceName/${service_name}/serviceVersion/1.0 ${SDC_DESIGNER_USER_ID} auth=${GLOBAL_SDC_AUTHENTICATION} [Return] ${resp.json()} @@ -894,7 +899,7 @@ Get Catalog Service Distribution Details ${resp}= SDC.Run Get Request ${SDC_BE_ENDPOINT} ${SDC_CATALOG_SERVICES_PATH}${SDC_CATALOG_SERVICE_DISTRIBUTION_PATH}/${catalog_service_distribution_id} ${SDC_DESIGNER_USER_ID} auth=${GLOBAL_SDC_AUTHENTICATION} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} - + Run SDC Health Check [Documentation] Runs a SDC health check ${resp}= SDC.Run Get Request ${SDC_FE_ENDPOINT} ${SDC_HEALTH_CHECK_PATH} user=${None} @@ -945,7 +950,7 @@ Add CDS Parameters Set Input Parameter - [Arguments] ${service_uuid} ${component_uuid} ${input} ${input_type} ${input_value} + [Arguments] ${service_uuid} ${component_uuid} ${input} ${input_type} ${input_value} ${resp}= SDC.Run Post Request ${SDC_BE_ENDPOINT} ${SDC_CATALOG_SERVICES_PATH}/${service_uuid}/resourceInstance/${component_uuid}/inputs {"constraints":[],"name":"${input['name']}","parentUniqueId":"${input['parentUniqueId']}","password":false,"required":false,"schema":{"property":{}},"type":"${input_type}","uniqueId":"${input['uniqueId']}","value":"${input_value}","definition":false,"toscaPresentation":{"ownerId":"${input['ownerId']}"}} ${SDC_DESIGNER_USER_ID} auth=${GLOBAL_SDC_AUTHENTICATION} Should Be Equal As Strings ${resp.status_code} 200 diff --git a/robot/resources/so/create_service_instance.robot b/robot/resources/so/create_service_instance.robot new file mode 100644 index 00000000..44e526b6 --- /dev/null +++ b/robot/resources/so/create_service_instance.robot @@ -0,0 +1,24 @@ +*** Settings *** +Documentation Creates a macro service recipe in SO Catalog DB + +Library OperatingSystem +Library Collections +Library ONAPLibrary.SO WITH NAME SO +Library ONAPLibrary.Templating WITH NAME Templating +Resource ../global_properties.robot + +*** Variables *** +${CREATE_SERVICE_PATH} /onap/so/infra/serviceInstantiation/v7/serviceInstances + +${SYSTEM USER} robot-ete +${CREATE_PNF_SERVICE_GR_API} so/create_pnf_service_building_block.jinja + +*** Keywords *** +Create PNF Service Using GR Api + [Documentation] Creates a PNF service using GR Api + [Arguments] ${arguments} + Templating.Create Environment so ${GLOBAL_TEMPLATE_FOLDER} + ${data}= Templating.Apply Template so ${CREATE_PNF_SERVICE_GR_API} ${arguments} + ${auth}= Create List ${GLOBAL_SO_USERNAME} ${GLOBAL_SO_PASSWORD} + ${request_id} ${service_instance_id} SO.Run Create Request ${GLOBAL_SO_ENDPOINT} ${CREATE_SERVICE_PATH} ${data} auth=${auth} + [Return] ${request_id} ${service_instance_id}
\ No newline at end of file diff --git a/robot/resources/test_templates/pnf_orchestration_test_template.robot b/robot/resources/test_templates/pnf_orchestration_test_template.robot index 6877441e..8a5b58f4 100644 --- a/robot/resources/test_templates/pnf_orchestration_test_template.robot +++ b/robot/resources/test_templates/pnf_orchestration_test_template.robot @@ -8,6 +8,7 @@ Resource model_test_template.robot Resource ../openstack/neutron_interface.robot Resource ../sdc_interface.robot Resource vnf_orchestration_test_template.robot +Resource ../so/create_service_instance.robot Library ONAPLibrary.Openstack @@ -17,13 +18,12 @@ Library ONAPLibrary.Utilities *** Keywords *** -Orchestrate PNF +Orchestrate PNF Macro Flow [Documentation] Use ONAP to Orchestrate a PNF Macro service. - [Arguments] ${customer_name} ${service} ${product_family} ${pnf_correlation_id} ${tenant_id} ${tenant_name} ${service_model_type} ${project_name}=Project-Demonstration ${owning_entity}=OE-Demonstration + [Arguments] ${customer_name} ${service} ${product_family} ${pnf_correlation_id} ${tenant_id} ${tenant_name} ${service_model_type} ${project_name}=Project-Demonstration ${owning_entity}=OE-Demonstration ${lcp_region}= Set Variable ${GLOBAL_INJECTED_REGION} ${uuid}= Generate UUID4 ${full_customer_name}= Catenate ${customer_name}_${uuid} - ${list}= Create List ${service_name}= Catenate Service_Ete_Name${uuid} ${service_type}= Set Variable ${service} Create Customer For PNF ${full_customer_name} ${full_customer_name} INFRA ${service_type} ${GLOBAL_AAI_CLOUD_OWNER} ${tenant_id} ${GLOBAL_INJECTED_REGION} @@ -33,6 +33,49 @@ Orchestrate PNF Wait Until Keyword Succeeds 60s 20s Validate Service Instance ${service_instance_id} ${service} ${full_customer_name} [Return] ${service_instance_id} ${request_id} ${full_customer_name} +Orchestrate PNF Building Block Flow + [Documentation] Use ONAP to Orchestrate a PNF using GR api + [Arguments] ${service_model_name} ${customer_name} ${service} ${product_family} ${pnf_correlation_id} ${project_name}=Project-Demonstration ${owning_entity}=OE-Demonstration ${lineOfBusinessName}=LOB-Demonstration ${platformName}=Platform-Demonstration + ${service_ctalog_json}= Get Service Catalog ${service_model_name} + ${service_model_uuid}= Set Variable ${json_resp["uuid"]} + ${service_model_invariant_uuid }= Set Variable ${json_resp["invariantUUID"]} + ${nf_resource_name}= Set Variable ${json_resp["componentInstances"][0]["name"]} + ${nf_resource_uuid}= Set Variable ${json_resp["componentInstances"][0]["customizationUUID"]} + ${componentName}= Set Variable ${json_resp["componentInstances"][0]["componentName"]} + ${resource_ctalog_json}= Get Resource Catalog ${componentName} + ${nf_model_invariant_uuid}= Set Variable ${json_resp["invariantUUID"]} + ${nf_model_uuid}= Set Variable ${json_resp["uuid]} + ${nf_model_name}= Set Variable ${json_resp["name"]} + ${productFamilyId}= Get Service Id ${product_family} + ${owningEntityId}= Get Owning Entity Id ${owningEntityName} + ${uuid}= Generate UUID4 + ${full_customer_name}= Catenate ${customer_name}_${uuid} + ${service_name}= Catenate Service_Ete_Name${uuid} + ${service_type}= Set Variable ${service} + Create Customer For PNF ${full_customer_name} ${full_customer_name} INFRA ${service_type} ${GLOBAL_AAI_CLOUD_OWNER} ${tenant_id} ${GLOBAL_INJECTED_REGION} + ${arguments}= Create Dictionary service_model_invariant_uuid=${service_model_invariant_uuid} + Set To Dictionary ${arguments} service_model_uuid ${service_model_uuid} + Set To Dictionary ${arguments} service_model_name ${service_model_name} + Set To Dictionary ${arguments} owningEntityId ${owningEntityId} + Set To Dictionary ${arguments} owningEntityName ${owningEntityName} + Set To Dictionary ${arguments} full_customer_name ${full_customer_name} + Set To Dictionary ${arguments} service_name ${service_name} + Set To Dictionary ${arguments} productFamilyId ${productFamilyId} + Set To Dictionary ${arguments} service ${service} + Set To Dictionary ${arguments} nf_resource_name ${nf_resource_name} + Set To Dictionary ${arguments} nf_resource_uuid ${nf_resource_uuid} + Set To Dictionary ${arguments} nf_model_invariant_uuid ${nf_model_invariant_uuid} + Set To Dictionary ${arguments} nf_model_uuid ${nf_model_uuid} + Set To Dictionary ${arguments} nf_model_name ${nf_model_name} + Set To Dictionary ${arguments} platformName ${platformName} + Set To Dictionary ${arguments} lineOfBusinessName ${lineOfBusinessName} + Set To Dictionary ${arguments} productFamilyId ${productFamilyId} + Set To Dictionary ${arguments} nf_instance_name ${pnf_correlation_id} + ${request_id} ${service_instance_id}= Create PNF Service Using GR Api ${arguments} + Wait Until Keyword Succeeds 60s 20s Validate Service Instance ${service_instance_id} ${service} ${full_customer_name} + Check PNF orchestration status in A&AI ${pnf_correlation_id} register + [Return] ${service_instance_id} ${request_id} + Create Customer For PNF [Documentation] PNF Orchestration Test setup.... diff --git a/robot/resources/test_templates/pnf_registration_without_SO_template.robot b/robot/resources/test_templates/pnf_registration_without_SO_template.robot index 63131b8f..af9b4140 100644 --- a/robot/resources/test_templates/pnf_registration_without_SO_template.robot +++ b/robot/resources/test_templates/pnf_registration_without_SO_template.robot @@ -1,6 +1,7 @@ *** Settings *** Documentation PNF Registration Handler (PRH) test cases Resource ../aai/aai_interface.robot +Resource ../aai/create_customer.robot Resource ../sdc_interface.robot Resource ../mr_interface.robot Resource ../so/add_service_recipe.robot @@ -77,6 +78,14 @@ Query PNF A&AI updated entry Should Be Equal As Strings ${json_resp["pnf-name"]} ${PNF_entry_dict.correlation_id} Log PNF integration request in A&AI has been verified and contains all necessary entries +Check PNF orchestration status in A&AI + [Documentation] Query PNF A&AI updated entry + [Arguments] ${PNF_entry_dict} ${status} + ${get_resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} /aai/v11/network/pnfs/pnf/${pnf_correlation_id} auth=${GLOBAL_AAI_AUTHENTICATION} + Should Be Equal As Strings ${get_resp.status_code} 200 + ${json_resp}= Set Variable ${get_resp.json()} + Should Be Equal As Strings ${status} ${PNF_entry_dict.orchestrationStatus} + Check VES_PNFREG_OUTPUT topic presence in MR [Documentation] Verify if unauthenticated.VES_PNFREG_OUTPUT topic is present in MR ${get_resp}= Run MR Get Request ${DMAAP_MESSAGE_ROUTER_UNAUTHENTICATED_VES_PNFREG_OUTPUT_PATH} @@ -111,22 +120,23 @@ Check SO service completition status ${so_status}= Set Variable ${so_status_request_data['request']['requestStatus']['requestState']} Should Be Equal As Strings ${so_status} ${so_expected_status} - Instantiate PNF_macro service and succesfully registrate PNF template [Documentation] Test case template for design, create, instantiate PNF/macro service and succesfully registrate PNF - [Arguments] ${service_name} ${PNF_entry_dict} ${pnf_correlation_id} ${service}=pNF ${product_family}=pNF ${customer_name}=ETE_Customer + [Arguments] ${service_name} ${PNF_entry_dict} ${pnf_correlation_id} ${service}=pNF ${product_family}=pNF ${customer_name}=ETE_Customer ${building_block_flow}=false Log To Console \nDistributing TOSCA Based PNF Model ${catalog_service_name} ${catalog_resource_name} ${vf_modules} ${catalog_resources} ${catalog_resource_ids} ${catalog_service_id} Model Distribution For Directory ${service} ${service_name} cds=False instantiationType=Macro resourceType=PNF ${UUID}= Get Service Model Parameter from SDC Service Catalog ${service_name} uuid - Log To Console Creating Service Recipe for TOSCA Based PNF Model - ${service_recipe_id}= Add Service Recipe ${UUID} mso/async/services/CreateVcpeResCustService_simplified + ${service_recipe_id}= Run Keyword If "${building_block_flow}"=='false' Add Service Recipe ${UUID} mso/async/services/CreateVcpeResCustService_simplified Inventory Tenant If Not Exists CloudOwner ${region} SharedNode OwnerType v1 CloudZone ${tenant_id} ${tenant_name} Load OwningEntity project Project-${customer_name} Load OwningEntity owningEntity OE-${customer_name} - ${service_instance_id} ${request_id} ${full_customer_name} Orchestrate PNF ${customer_name} ${service} ${product_family} ${pnf_correlation_id} ${tenant_id} ${tenant_name} ${service_name} Project-${customer_name} OE-${customer_name} + Load OwningEntity lineOfBusiness LOB-${customer_name} + Load OwningEntity platform Platform-${customer_name} + ${service_instance_id} ${request_id} ${full_customer_name} Run Keyword If "${building_block_flow}"=='false' Orchestrate PNF Macro Flow ${customer_name} ${service} ${product_family} ${pnf_correlation_id} ${tenant_id} ${tenant_name} ${service_name} Project-${customer_name} OE-${customer_name} + ... ELSE Orchestrate PNF Building Block Flow ${service_model_name} ${customer_name} ${service} ${product_family} ${pnf_correlation_id} ${project_name}=Project-Demonstration ${owning_entity}=OE-Demonstration ${lineOfBusinessName}=LOB-Demonstration ${platformName}=Platform-Demonstration Wait Until Keyword Succeeds 120s 40s Send and verify VES integration request in SO and A&AI ${request_id} ${PNF_entry_dict} - [Teardown] Instantiate PNF_macro service Teardown ${catalog_service_id} ${catalog_resource_ids} ${PNF_entry_dict} ${service_instance_id} ${service_recipe_id} - + Run Keyword If "${building_block_flow}"=='true' Check PNF orchestration status in A&AI ${pnf_correlation_id} registered + [Teardown] Instantiate PNF_macro service Teardown ${catalog_service_id} ${catalog_resource_ids} ${PNF_entry_dict} ${service_instance_id} ${service_recipe_id} ${building_block_flow} Send and verify VES integration request in SO and A&AI [Documentation] Gets service status and compares with expected status @@ -136,7 +146,7 @@ Send and verify VES integration request in SO and A&AI Wait Until Keyword Succeeds 30s 10s Check SO service completition status ${request_id} COMPLETE Instantiate PNF_macro service Teardown - [Arguments] ${catalog_service_id} ${catalog_resource_ids} ${PNF_entry_dict} ${service_instance_id} ${service_recipe_id} + [Arguments] ${catalog_service_id} ${catalog_resource_ids} ${PNF_entry_dict} ${service_instance_id} ${service_recipe_id} ${building_block_flow} Teardown Models ${catalog_service_id} ${catalog_resource_ids} - Delete Service Recipe ${service_recipe_id} + Run Keyword If "${building_block_flow}"=='false' Delete Service Recipe ${service_recipe_id} Cleanup PNF entry in A&AI ${PNF_entry_dict}
\ No newline at end of file |