2 Documentation PNF Registration Handler (PRH) test cases
3 Resource ../aai/aai_interface.robot
4 Resource ../aai/create_customer.robot
5 Resource ../sdc_interface.robot
6 Resource ../mr_interface.robot
7 Resource ../so/add_service_recipe.robot
8 Resource ../test_templates/pnf_orchestration_test_template.robot
9 Resource ../demo_preload.robot
10 Library ONAPLibrary.Openstack
11 Library OperatingSystem
12 Library RequestsLibrary
14 Library ONAPLibrary.JSON
15 Library ONAPLibrary.Utilities
16 Library ONAPLibrary.Templating WITH NAME Templating
17 Library ONAPLibrary.AAI WITH NAME AAI
18 Library ONAPLibrary.SDC WITH NAME SDC
19 Library ONAPLibrary.SO WITH NAME SO
22 ${aai_so_registration_entry_template}= aai/add_pnf_registration_info.jinja
23 ${pnf_ves_integration_request}= ves/pnf_registration_request.jinja
24 ${DMAAP_MESSAGE_ROUTER_UNAUTHENTICATED_VES_PNFREG_OUTPUT_PATH} /events/unauthenticated.VES_PNFREG_OUTPUT/2/1
25 ${VES_ENDPOINT} ${GLOBAL_DCAE_VES_HTTPS_PROTOCOL}://${GLOBAL_INJECTED_DCAE_VES_HOST}:${GLOBAL_DCAE_VES_HTTPS_SERVER_PORT}
26 ${VES_data_path} /eventListener/v7
27 ${tenant_name} dummy_tenant_for_pnf
28 ${tenant_id} dummy_tenant_id_for_pnf
29 ${region} RegionForPNF
33 Create A&AI antry without SO and succesfully registrate PNF
34 [Documentation] Test case template for create A&AI antry without SO and succesfully registrate PNF
35 [Arguments] ${PNF_entry_dict}
36 Send VES integration request ${PNF_entry_dict}
37 Wait Until Keyword Succeeds 10x 5s Check VES_PNFREG_OUTPUT topic presence in MR
38 Create PNF initial entry in A&AI ${PNF_entry_dict}
39 Send VES integration request ${PNF_entry_dict}
40 Verify PNF Integration Request in A&AI ${PNF_entry_dict}
42 Create PNF initial entry in A&AI
43 [Documentation] Creates PNF initial entry in A&AI registry. Entry contains only correlation id (pnf-name)
44 [Arguments] ${PNF_entry_dict}
45 Templating.Create Environment aai ${GLOBAL_TEMPLATE_FOLDER}
46 ${template}= Templating.Apply Template aai ${aai_so_registration_entry_template} ${PNF_entry_dict}
47 Log Filled A&AI entry template ${template}
48 ${correlation_id}= Get From Dictionary ${PNF_entry_dict} correlation_id
49 ${del_resp}= Delete A&AI Entity /network/pnfs/pnf/${PNF_entry_dict.correlation_id}
50 Log Removing existing entry "${PNF_entry_dict.correlation_id}" from A&AI registry
51 ${put_resp}= AAI.Run Put Request ${AAI_FRONTEND_ENDPOINT} /aai/v11/network/pnfs/pnf/${PNF_entry_dict.correlation_id} ${template} auth=${GLOBAL_AAI_AUTHENTICATION}
52 Log Adding new entry with correlation ID "${PNF_entry_dict.correlation_id}" to A&AI registry (empty IPv4 and IPv6 address)
54 Send VES integration request
55 [Documentation] Send VES integration request. Request contains correlation id (sourceName), oamV4IpAddress and oamV6IpAddress
56 [Arguments] ${PNF_entry_dict}
57 Templating.Create Environment aai ${GLOBAL_TEMPLATE_FOLDER}
58 ${template}= Templating.Apply Template aai ${pnf_ves_integration_request} ${PNF_entry_dict}
59 ${post_resp}= Run VES HTTP Post Request ${template}
60 Should Be Equal As Strings ${post_resp.status_code} 202
61 Log VES integration request has been send
63 Verify PNF integration request in A&AI
64 [Documentation] Verify if PNF integration request entries are present in A&AI
65 [Arguments] ${PNF_entry_dict}
66 Wait Until Keyword Succeeds 10x 5s Query PNF A&AI updated entry ${PNF_entry_dict}
67 Log PNF integration request in A&AI has been verified and contains all necessary entries
69 Query PNF A&AI updated entry
70 [Documentation] Query PNF A&AI updated entry
71 [Arguments] ${PNF_entry_dict}
72 ${get_resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} /aai/v11/network/pnfs/pnf/${PNF_entry_dict.correlation_id} auth=${GLOBAL_AAI_AUTHENTICATION}
73 Should Be Equal As Strings ${get_resp.status_code} 200
74 ${json_resp}= Set Variable ${get_resp.json()}
75 Log JSON recieved from A&AI endpoint ${json_resp}
76 Should Be Equal As Strings ${json_resp["ipaddress-v4-oam"]} ${PNF_entry_dict.PNF_IPv4_address}
77 Should Be Equal As Strings ${json_resp["ipaddress-v6-oam"]} ${PNF_entry_dict.PNF_IPv6_address}
78 Should Be Equal As Strings ${json_resp["pnf-name"]} ${PNF_entry_dict.correlation_id}
79 Log PNF integration request in A&AI has been verified and contains all necessary entries
81 Check PNF orchestration status in A&AI
82 [Documentation] Query PNF A&AI updated entry
83 [Arguments] ${pnf_correlation_id} ${status}
84 ${get_resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} /aai/v19/network/pnfs/pnf/${pnf_correlation_id} auth=${GLOBAL_AAI_AUTHENTICATION}
85 Should Be Equal As Strings ${get_resp.status_code} 200
86 ${json_resp}= Set Variable ${get_resp.json()}
87 Should Be Equal As Strings ${status} ${json_resp['orchestration-status']}
89 Check VES_PNFREG_OUTPUT topic presence in MR
90 [Documentation] Verify if unauthenticated.VES_PNFREG_OUTPUT topic is present in MR
91 ${get_resp}= Run MR Get Request ${DMAAP_MESSAGE_ROUTER_UNAUTHENTICATED_VES_PNFREG_OUTPUT_PATH}
92 Should Be Equal As Strings ${get_resp.status_code} 200
93 Log unauthenticated.VES_PNFREG_OUTPUT topic is present in MR
95 Run VES HTTP Post Request
96 [Documentation] Runs a VES Post request
99 ${auth}= Create List ${GLOBAL_DCAE_VES_USERNAME} ${GLOBAL_DCAE_VES_PASSWORD}
100 ${session}= Create Session ves ${VES_ENDPOINT} auth=${auth}
101 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
102 ${post_resp}= Post Request ves ${VES_data_path} data=${data} headers=${headers}
103 Log PNF integration request ${data}
104 Should Be Equal As Strings ${post_resp.status_code} 202
105 Log VES has accepted event with status code ${post_resp.status_code}
106 [Return] ${post_resp}
108 Cleanup PNF entry in A&AI
109 [Documentation] Creates PNF initial entry in A&AI registry
110 [Arguments] ${PNF_entry_dict}
111 ${del_resp}= Delete A&AI Entity /network/pnfs/pnf/${PNF_entry_dict.correlation_id}
112 Log Teardown complete
115 Check SO service completition status
116 [Documentation] Gets service status and compares with expected status
117 [Arguments] ${request_id} ${so_expected_status}
118 ${auth}= Create List ${GLOBAL_SO_USERNAME} ${GLOBAL_SO_PASSWORD}
119 ${so_status_request}= SO.Run Get Request ${GLOBAL_SO_ENDPOINT} ${request_id} auth=${auth}
120 ${so_status_request_data}= Set Variable ${so_status_request.json()}
121 ${so_status}= Set Variable ${so_status_request_data['request']['requestStatus']['requestState']}
122 Should Be Equal As Strings ${so_status} ${so_expected_status}
124 Instantiate PNF_macro service and succesfully registrate PNF template
125 [Documentation] Test case template for design, create, instantiate PNF/macro service and succesfully registrate PNF
126 [Arguments] ${service_name} ${PNF_entry_dict} ${pnf_correlation_id} ${service}=pNF ${product_family}=pNF ${customer_name}=ETE_Customer ${building_block_flow}=false
127 Log To Console \nDistributing TOSCA Based PNF Model
128 ${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
129 ${UUID}= Get Service Model Parameter from SDC Service Catalog ${service_name} uuid
130 ${service_recipe_id}= Run Keyword If "${building_block_flow}"=='false' Add Service Recipe ${UUID} mso/async/services/CreateVcpeResCustService_simplified
131 Inventory Tenant If Not Exists CloudOwner ${region} SharedNode OwnerType v1 CloudZone ${tenant_id} ${tenant_name}
132 ${uuid_oe}= Generate UUID4
133 ${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} ${region} Project-${customer_name} OE-${customer_name}
134 ... ELSE Orchestrate PNF Building Block Flow ${catalog_service_name} ${customer_name} ${service} ${product_family} ${pnf_correlation_id} ${region} owning_entity=OE-${customer_name}-${uuid_oe} owningEntityId=${uuid_oe} project_name=Project-${customer_name} lineOfBusinessName=LOB-${customer_name} platformName=Platform-${customer_name}
135 Wait Until Keyword Succeeds 180s 40s Send and verify VES integration request in SO and A&AI ${request_id} ${PNF_entry_dict}
136 Run Keyword If "${building_block_flow}"=='true' Check PNF orchestration status in A&AI ${pnf_correlation_id} Active
137 [Teardown] Instantiate PNF_macro service Teardown ${catalog_service_id} ${catalog_resource_ids} ${PNF_entry_dict}
139 Send and verify VES integration request in SO and A&AI
140 [Documentation] Gets service status and compares with expected status
141 [Arguments] ${request_id} ${PNF_entry_dict}
142 Send VES integration request ${PNF_entry_dict}
143 Verify PNF Integration Request in A&AI ${PNF_entry_dict}
144 Wait Until Keyword Succeeds 30s 10s Check SO service completition status ${request_id} COMPLETE
146 Instantiate PNF_macro service Teardown
147 [Arguments] ${catalog_service_id} ${catalog_resource_ids} ${PNF_entry_dict}
148 Teardown Models ${catalog_service_id} ${catalog_resource_ids}
149 Cleanup PNF entry in A&AI ${PNF_entry_dict}