fix Get Service Id issue in pnf registartion test case in xtesting gating and master
[testsuite.git] / robot / resources / test_templates / pnf_orchestration_test_template.robot
1 *** Settings ***
2 Documentation     This test template encapsulates the PNF Orchestration use case.
3
4 Resource        ../vid/create_service_instance.robot
5 Resource        ../vid/vid_interface.robot
6 Resource        ../aai/service_instance.robot
7 Resource        model_test_template.robot
8 Resource        ../openstack/neutron_interface.robot
9 Resource          ../sdc_interface.robot
10 Resource          vnf_orchestration_test_template.robot
11 Resource         ../so/create_service_instance.robot
12
13
14 Library         ONAPLibrary.Openstack
15 Library             SeleniumLibrary
16 Library         Collections
17 Library         ONAPLibrary.Utilities
18
19 *** Keywords ***
20
21 Orchestrate PNF Macro Flow
22     [Documentation]   Use ONAP to Orchestrate a PNF Macro service.
23     [Arguments]   ${customer_name}    ${service}    ${product_family}    ${pnf_correlation_id}  ${tenant_id}    ${tenant_name}   ${service_model_type}   ${region}  ${project_name}=Project-Demonstration   ${owning_entity}=OE-Demonstration
24     ${lcp_region}=   Set Variable   ${region}
25     ${uuid}=    Generate UUID4
26     ${full_customer_name}=    Catenate    ${customer_name}_${uuid}
27     ${service_name}=    Catenate    Service_Ete_Name${uuid}
28     ${service_type}=    Set Variable    ${service}
29     Create Customer For PNF     ${full_customer_name}    ${full_customer_name}     INFRA    ${service_type}    ${GLOBAL_AAI_CLOUD_OWNER}  ${tenant_id}  ${region}
30     Setup Browser
31     Login To VID GUI
32     ${service_instance_id}  ${request_id}=   Wait Until Keyword Succeeds    300s   5s    Create VID PNF Service Instance    ${full_customer_name}    ${service_model_type}    ${service}     ${service_name}   ${project_name}   ${owning_entity}  ${product_family}  ${lcp_region}  ${tenant_name}  ${pnf_correlation_id}
33     Wait Until Keyword Succeeds   120s   20s       Validate Service Instance    ${service_instance_id}    ${service}    ${full_customer_name}
34     [Return]     ${service_instance_id}  ${request_id}  ${full_customer_name}
35
36 Orchestrate PNF Building Block Flow
37     [Documentation]   Use ONAP to Orchestrate a PNF using GR api
38     [Arguments]   ${service_model_name}  ${customer_name}    ${service}    ${product_family}    ${pnf_correlation_id}   ${region}   ${owning_entity}  ${owningEntityId}  ${project_name}=Project-Demonstration  ${lineOfBusinessName}=LOB-Demonstration    ${platformName}=Platform-Demonstration
39     ${uuid}=   Generate UUID4
40     ${full_customer_name}=    Catenate    ${customer_name}_${uuid}
41     ${service_name}=    Catenate    Service_Ete_Name${uuid}
42     ${service_type}=    Set Variable    ${service}
43     Create Customer For PNF     ${full_customer_name}    ${full_customer_name}     INFRA    ${service_type}    ${GLOBAL_AAI_CLOUD_OWNER}  ${tenant_id}  ${region}
44     ${json_resp}=  Get Service Catalog  ${service_model_name}
45     ${service_model_uuid}=  Set Variable  ${json_resp["uuid"]}
46     ${service_model_invariant_uuid }=  Set Variable  ${json_resp["invariantUUID"]}
47     ${nf_resource_name}=  Set Variable  ${json_resp["componentInstances"][0]["name"]}
48     ${nf_resource_uuid}=  Set Variable  ${json_resp["componentInstances"][0]["customizationUUID"]}
49     ${componentName}=  Set Variable  ${json_resp["componentInstances"][0]["componentName"]}
50     ${resource_ctalog_json}=  Get Resource Catalog  ${componentName}
51     ${nf_model_invariant_uuid}=  Set Variable  ${json_resp["invariantUUID"]}
52     ${nf_model_uuid}=  Set Variable  ${json_resp["uuid"]}
53     ${nf_model_name}=  Set Variable  ${json_resp["name"]}
54     ${productFamilyId}=  Get Service Id  ${product_family}
55     ${arguments}=    Create Dictionary   service_model_invariant_uuid=${service_model_invariant_uuid}
56     Set To Dictionary  ${arguments}  service_model_uuid  ${service_model_uuid}
57     Set To Dictionary  ${arguments}  service_model_name  ${service_model_name}
58     Set To Dictionary  ${arguments}  owningEntityId  ${owningEntityId}
59     Set To Dictionary  ${arguments}  owningEntityName  ${owning_entity}
60     Set To Dictionary  ${arguments}  full_customer_name  ${full_customer_name}
61     Set To Dictionary  ${arguments}  service_name  ${service_name}
62     Set To Dictionary  ${arguments}  productFamilyId  ${productFamilyId}
63     Set To Dictionary  ${arguments}  service  ${service}
64     Set To Dictionary  ${arguments}  nf_resource_name  ${nf_resource_name}
65     Set To Dictionary  ${arguments}  nf_resource_uuid  ${nf_resource_uuid}
66     Set To Dictionary  ${arguments}  nf_model_invariant_uuid  ${nf_model_invariant_uuid}
67     Set To Dictionary  ${arguments}  nf_model_uuid  ${nf_model_uuid}
68     Set To Dictionary  ${arguments}  nf_model_name  ${nf_model_name}
69     Set To Dictionary  ${arguments}  platformName  ${platformName}
70     Set To Dictionary  ${arguments}  lineOfBusinessName  ${lineOfBusinessName}
71     Set To Dictionary  ${arguments}  productFamilyId  ${productFamilyId}
72     Set To Dictionary  ${arguments}  nf_instance_name  ${pnf_correlation_id}
73     ${request_id}  ${service_instance_id}=   Create PNF Service Using GR Api   ${arguments}
74     Wait Until Keyword Succeeds   180  20s    Validate Service Instance    ${service_instance_id}    ${service}    ${full_customer_name}
75     Wait Until Keyword Succeeds   180  20s    Check PNF orchestration status in A&AI  ${pnf_correlation_id}  Register
76     [Return]     ${service_instance_id}  /onap/so/infra/orchestrationRequests/v7/${request_id}  ${full_customer_name}
77
78
79 Create Customer For PNF
80     [Documentation]    PNF Orchestration Test setup....
81     ...                Create Customer, Create Service and related relationships
82     [Arguments]    ${customer_name}    ${customer_id}    ${customer_type}    ${service_type}    ${cloud_owner}    ${tenant_id}   ${cloud_region_id}
83     Create Service If Not Exists    ${service_type}
84     ${resp}=    Create Customer    ${customer_name}    ${customer_id}    ${customer_type}    ${service_type}   ${cloud_owner}  ${cloud_region_id}    ${tenant_id}
85         Should Be Equal As Strings      ${resp}         201