diff options
author | Krzysztof Kuzmicki <krzysztof.kuzmicki@nokia.com> | 2020-05-29 12:35:06 +0200 |
---|---|---|
committer | Morgan Richomme <morgan.richomme@orange.com> | 2020-06-02 11:22:02 +0000 |
commit | 6ba032346a961f749f6f1ef965c31d0f5c691920 (patch) | |
tree | b03b42361e6af2f8fbe398817886f05f12e7a7a1 | |
parent | bd888238170b8069d81b1530ebbff4973ad98ca1 (diff) |
Fix 5g_bulk_PM and pnf_registrate test case errors
Issue-ID: INT-1521
Signed-off-by: Krzysztof Kuzmicki <krzysztof.kuzmicki@nokia.com>
Change-Id: I48b012b2a2d88b55eb83037654ee92272e4b7684
(cherry picked from commit ae8615f04089716e99b4721954d08ae2b6c20804)
7 files changed, 57 insertions, 22 deletions
diff --git a/robot/assets/templates/mr/mr_publish.jinja b/robot/assets/templates/mr/mr_publish.jinja index 9b6cfaa4..d795fe56 100644 --- a/robot/assets/templates/mr/mr_publish.jinja +++ b/robot/assets/templates/mr/mr_publish.jinja @@ -1,4 +1,4 @@ { "test": "success", - "timestamp": "${timestamp}" + "timestamp": "{{timestamp}}" }
\ No newline at end of file diff --git a/robot/resources/mr_interface.robot b/robot/resources/mr_interface.robot index 8204315a..2d3cda28 100644 --- a/robot/resources/mr_interface.robot +++ b/robot/resources/mr_interface.robot @@ -106,6 +106,19 @@ Run MR Auth Get Request Log Received response from message router ${resp.text} [Return] ${resp} +Run MR Auth Post Request (User And Pass) + [Documentation] Runs MR Authenticated Post Request + [Arguments] ${data_path} ${username} ${password} ${data} + ${auth}= Create List ${username} ${password} + ${session}= Create Session mr ${MR_ENDPOINT} auth=${auth} + ${uuid}= Generate UUID4 + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} + ${resp}= Post Request mr ${data_path} headers=${headers} data=${data} + ${status_string}= Convert To String ${resp.status_code} + Should Match Regexp ${status_string} ^(204|200)$ + Log Received response from message router ${resp.text} + [Return] ${resp} + Run MR Get Request [Documentation] Runs MR Get request [Arguments] ${data_path} diff --git a/robot/resources/test_templates/pnf_orchestration_test_template.robot b/robot/resources/test_templates/pnf_orchestration_test_template.robot index 6bfa1029..0302ef65 100644 --- a/robot/resources/test_templates/pnf_orchestration_test_template.robot +++ b/robot/resources/test_templates/pnf_orchestration_test_template.robot @@ -30,7 +30,7 @@ Orchestrate PNF Macro Flow Setup Browser Login To VID GUI ${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} - Wait Until Keyword Succeeds 60s 20s Validate Service Instance ${service_instance_id} ${service} ${full_customer_name} + Wait Until Keyword Succeeds 120s 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 @@ -72,8 +72,8 @@ Orchestrate PNF Building Block Flow 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 120s 20s Validate Service Instance ${service_instance_id} ${service} ${full_customer_name} - Wait Until Keyword Succeeds 60s 20s Check PNF orchestration status in A&AI ${pnf_correlation_id} Register + Wait Until Keyword Succeeds 180 20s Validate Service Instance ${service_instance_id} ${service} ${full_customer_name} + Wait Until Keyword Succeeds 180 20s Check PNF orchestration status in A&AI ${pnf_correlation_id} Register [Return] ${service_instance_id} /onap/so/infra/orchestrationRequests/v7/${request_id} ${full_customer_name} 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 fe373e6e..fd8aaed1 100644 --- a/robot/resources/test_templates/pnf_registration_without_SO_template.robot +++ b/robot/resources/test_templates/pnf_registration_without_SO_template.robot @@ -135,7 +135,7 @@ Instantiate PNF_macro service and succesfully registrate PNF template 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} ${region} Project-${customer_name} OE-${customer_name} ... ELSE Orchestrate PNF Building Block Flow ${catalog_service_name} ${customer_name} ${service} ${product_family} ${pnf_correlation_id} ${region} project_name=Project-${customer_name} owning_entity=OE-${customer_name} lineOfBusinessName=LOB-${customer_name} platformName=Platform-${customer_name} - Wait Until Keyword Succeeds 120s 40s Send and verify VES integration request in SO and A&AI ${request_id} ${PNF_entry_dict} + Wait Until Keyword Succeeds 180s 40s Send and verify VES integration request in SO and A&AI ${request_id} ${PNF_entry_dict} Run Keyword If "${building_block_flow}"=='true' Check PNF orchestration status in A&AI ${pnf_correlation_id} Active [Teardown] Instantiate PNF_macro service Teardown ${catalog_service_id} ${catalog_resource_ids} ${PNF_entry_dict} diff --git a/robot/resources/usecases/5gbulkpm_interface.robot b/robot/resources/usecases/5gbulkpm_interface.robot index 91d4d08e..86b0ca00 100644 --- a/robot/resources/usecases/5gbulkpm_interface.robot +++ b/robot/resources/usecases/5gbulkpm_interface.robot @@ -8,9 +8,9 @@ Library String ${INVENTORY_SERVER} ${GLOBAL_INVENTORY_SERVER_PROTOCOL}://${GLOBAL_INVENTORY_SERVER_NAME}:${GLOBAL_INVENTORY_SERVER_PORT} ${DEPLOYMENT_SERVER} ${GLOBAL_DEPLOYMENT_HANDLER_SERVER_PROTOCOL}://${GLOBAL_DEPLOYMENT_HANDLER_SERVER_NAME}:${GLOBAL_DEPLOYMENT_HANDLER_SERVER_PORT} ${DR_ENDPOINT} ${GLOBAL_DMAAP_DR_PROV_SERVER_PROTOCOL}://${GLOBAL_INJECTED_DMAAP_DR_PROV_IP_ADDR}:${GLOBAL_DMAAP_DR_PROV_SERVER_PORT} -${MR_ENDPOINT} ${GLOBAL_MR_SERVER_PROTOCOL}://${GLOBAL_DMAAP_MESSAGE_ROUTER_SERVER_NAME}:${GLOBAL_DMAAP_MESSAGE_ROUTER_SERVER_PORT} ${DMAAP_BC_SERVER} ${GLOBAL_BC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_BC_IP_ADDR}:${GLOBAL_BC_HTTPS_SERVER_PORT} ${VES_HEALTH_CHECK_PATH} ${GLOBAL_DCAE_VES_HTTPS_PROTOCOL}://${GLOBAL_INJECTED_DCAE_VES_HOST}:${GLOBAL_DCAE_VES_HTTPS_SERVER_PORT} +${MR_PUBLISH_TEMPLATE} mr/mr_publish.jinja *** Keywords *** Undeploy Service @@ -31,8 +31,33 @@ xNF PM File Validate ${resp}= Run MR Auth Get Request ${MR_TOPIC_URL_PATH} ${GLOBAL_DCAE_USERNAME} ${GLOBAL_DCAE_PASSWORD} Should Contain ${resp.text} ${value} +Topic Validate + [Arguments] ${value} + ${timestamp}= Get Current Date + ${dict}= Create Dictionary timestamp=${timestamp} + Templating.Create Environment mr ${GLOBAL_TEMPLATE_FOLDER} + ${data}= Templating.Apply Template mr ${MR_PUBLISH_TEMPLATE} ${dict} + ${resp}= Run MR Auth Post Request (User And Pass) ${MR_TOPIC_URL_PATH_FOR_POST} ${GLOBAL_DCAE_USERNAME} ${GLOBAL_DCAE_PASSWORD} ${data} + Should Be Equal As Strings ${resp.status_code} 200 + ${resp}= Run MR Auth Get Request ${MR_TOPIC_URL_PATH} ${GLOBAL_DCAE_USERNAME} ${GLOBAL_DCAE_PASSWORD} + Should Contain ${resp.text} ${value} + + Usecase Teardown Undeploy Service ${DEPLOYMENT_SERVER} /${DEPLOYMENT_ENDPOINT}/pmmapper Undeploy Service ${DEPLOYMENT_SERVER} /${DEPLOYMENT_ENDPOINT}/sftpserver Undeploy Service ${INVENTORY_SERVER} ${INVENTORY_ENDPOINT}/${serviceTypeId-Sftp} - Undeploy Service ${DEPLOYMENT_SERVER} /${DEPLOYMENT_ENDPOINT}/datafile
\ No newline at end of file + Undeploy Service ${DEPLOYMENT_SERVER} /${DEPLOYMENT_ENDPOINT}/datafile + + +Send File Ready Event to VES Collector + [Arguments] ${epoch} + ${headers}= Create Dictionary content-type=application/json + ${fileready}= OperatingSystem.Get File ${JSON_DATA_FILE} + ${auth}= Create List ${GLOBAL_DCAE_VES_USERNAME} ${GLOBAL_DCAE_VES_PASSWORD} + ${session}= Create Session ves ${VES_HEALTH_CHECK_PATH} auth=${auth} + ${resp}= Post Request ves ${VES_LISTENER_PATH} data=${fileready} headers=${headers} + Should Be Equal As Strings ${resp.status_code} 202 + ${VES_FILE_READY_NOTIFICATION} Set Variable {"event":{"commonEventHeader":{"version":"4.0.1","vesEventListenerVersion":"7.0.1","domain":"notification","eventName":"Noti_RnNode-Ericsson_FileReady","eventId":"FileReady_1797490e-10ae-4d48-9ea7-3d7d790b25e1","lastEpochMicrosec":8745745764578,"priority":"Normal","reportingEntityName":"otenb5309","sequence":0,"sourceName":"oteNB5309","startEpochMicrosec":8745745764578,"timeZoneOffset":"UTC+05.30"},"notificationFields":{"changeIdentifier":"PM_MEAS_FILES","changeType":"FileReady","notificationFieldsVersion":"2.0","arrayOfNamedHashMap":[{"name":"A${epoch}.xml.gz","hashMap":{"location":"sftp://bulkpm:bulkpm@sftpserver:22/upload/A${epoch}.xml.gz","compression":"gzip","fileFormatType":"org.3GPP.32.435#measCollec","fileFormatVersion":"V10"}}]}}} + ${resp}= Post Request ves ${VES_LISTENER_PATH} data=${VES_FILE_READY_NOTIFICATION} headers=${headers} + Should Be Equal As Strings ${resp.status_code} 202
\ No newline at end of file diff --git a/robot/testsuites/usecases/5gbulkpm.robot b/robot/testsuites/usecases/5gbulkpm.robot index 31e8949f..6ead3811 100644 --- a/robot/testsuites/usecases/5gbulkpm.robot +++ b/robot/testsuites/usecases/5gbulkpm.robot @@ -14,6 +14,7 @@ Library ONAPLibrary.Utilities Resource ../../resources/usecases/5gbulkpm_interface.robot Resource ../../resources/mr_interface.robot Resource ../../resources/dr_interface.robot +Suite Setup Send File Ready Event to VES Collector test Suite Teardown Usecase Teardown *** Variables *** @@ -25,6 +26,7 @@ ${DEPLOYMENT_ENDPOINT} dcae-deployments ${MR_TOPIC_CHECK_PATH} /topics ${DR_SUB_CHECK_PATH} /internal/prov ${MR_TOPIC_URL_PATH} /events/org.onap.dmaap.mr.PERFORMANCE_MEASUREMENTS/CG1/C1 +${MR_TOPIC_URL_PATH_FOR_POST} /events/org.onap.dmaap.mr.PERFORMANCE_MEASUREMENTS ${DMAAP_BC_MR_CLIENT_PATH} /webapi/mr_clients ${DMAAP_BC_MR_CLUSTER_PATH} /webapi/mr_clusters ${PMMAPPER_HEALTH_CHECK_PATH} /healthcheck @@ -34,6 +36,8 @@ ${PMMAPPER_SUB_ROLE_DATA} ${EXECDIR}/robot/assets/usecases/5gbulkpm/su ${PMMAPPER_MR_CLUSTER_DATA} ${EXECDIR}/robot/assets/usecases/5gbulkpm/mr_clusters.json ${NEXUS3} ${GLOBAL_INJECTED_NEXUS_DOCKER_REPO} + + *** Test Cases *** Deploying Data File Collector @@ -57,8 +61,8 @@ Deploying 3GPP PM Mapper [Tags] 5gbulkpm ${clusterdata}= OperatingSystem.Get File ${PMMAPPER_MR_CLUSTER_DATA} ${headers}= Create Dictionary content-type=application/json - ${session}= Create Session dmaapbc ${DMAAP_BC_SERVER} - ${resp}= Post Request dmaapbc ${DMAAP_BC_MR_CLUSTER_PATH} data=${clusterdata} headers=${headers} + ${session}= Create Session dmaapbc ${DMAAP_BC_SERVER} + ${resp}= Post Request dmaapbc ${DMAAP_BC_MR_CLUSTER_PATH} data=${clusterdata} headers=${headers} ${session}= Create Session pmmapper ${INVENTORY_SERVER} ${resp}= Get Request pmmapper ${INVENTORY_ENDPOINT}?typeName=k8s-pm-mapper headers=${headers} ${json}= Set Variable ${resp.json()} @@ -97,13 +101,14 @@ Checking PERFORMANCE_MEASUREMENTS Topic In Message Router [Tags] 5gbulkpm ${headers}= Create Dictionary content-type=application/json ${subdata}= OperatingSystem.Get File ${PMMAPPER_SUB_ROLE_DATA} - ${session}= Create Session dmaapbc ${DMAAP_BC_SERVER} - ${resp}= Post Request dmaapbc ${DMAAP_BC_MR_CLIENT_PATH} data=${subdata} headers=${headers} + ${session}= Create Session dmaapbc ${DMAAP_BC_SERVER} + ${resp}= Post Request dmaapbc ${DMAAP_BC_MR_CLIENT_PATH} data=${subdata} headers=${headers} + Wait Until Keyword Succeeds 5 minute 5 sec Topic Validate success ${resp}= Run MR Get Request ${MR_TOPIC_CHECK_PATH} Should Be Equal As Strings ${resp.status_code} 200 ${topics}= Set Variable ${resp.json().get('topics')} List Should Contain Value ${topics} org.onap.dmaap.mr.PERFORMANCE_MEASUREMENTS - ${resp}= Run MR Auth Get Request ${MR_TOPIC_URL_PATH} ${GLOBAL_DCAE_USERNAME} ${GLOBAL_DCAE_PASSWORD} + ${resp}= Run MR Auth Get Request ${MR_TOPIC_URL_PATH} ${GLOBAL_DCAE_USERNAME} ${GLOBAL_DCAE_PASSWORD} Should Be Equal As Strings ${resp.status_code} 200 Upload PM Files to xNF SFTP Server @@ -126,15 +131,7 @@ DR PM Mapper Subscriber Check Sending File Ready Event to VES Collector [Tags] 5gbulkpm - ${headers}= Create Dictionary content-type=application/json - ${fileready}= OperatingSystem.Get File ${JSON_DATA_FILE} - ${auth}= Create List ${GLOBAL_DCAE_VES_USERNAME} ${GLOBAL_DCAE_VES_PASSWORD} - ${session}= Create Session ves ${VES_HEALTH_CHECK_PATH} auth=${auth} - ${resp}= Post Request ves ${VES_LISTENER_PATH} data=${fileready} headers=${headers} - Should Be Equal As Strings ${resp.status_code} 202 - ${VES_FILE_READY_NOTIFICATION} Set Variable {"event":{"commonEventHeader":{"version":"4.0.1","vesEventListenerVersion":"7.0.1","domain":"notification","eventName":"Noti_RnNode-Ericsson_FileReady","eventId":"FileReady_1797490e-10ae-4d48-9ea7-3d7d790b25e1","lastEpochMicrosec":8745745764578,"priority":"Normal","reportingEntityName":"otenb5309","sequence":0,"sourceName":"oteNB5309","startEpochMicrosec":8745745764578,"timeZoneOffset":"UTC+05.30"},"notificationFields":{"changeIdentifier":"PM_MEAS_FILES","changeType":"FileReady","notificationFieldsVersion":"2.0","arrayOfNamedHashMap":[{"name":"A${epoch}.xml.gz","hashMap":{"location":"sftp://bulkpm:bulkpm@sftpserver:22/upload/A${epoch}.xml.gz","compression":"gzip","fileFormatType":"org.3GPP.32.435#measCollec","fileFormatVersion":"V10"}}]}}} - ${resp}= Post Request ves ${VES_LISTENER_PATH} data=${VES_FILE_READY_NOTIFICATION} headers=${headers} - Should Be Equal As Strings ${resp.status_code} 202 + Send File Ready Event to VES Collector ${epoch} Verifying 3GPP Perf VES Content On PERFORMANCE_MEASUREMENTS Topic [Tags] 5gbulkpm diff --git a/robot/testsuites/vnfsdk_validation.robot b/robot/testsuites/vnfsdk_validation.robot index 8d962d40..eba20ba1 100644 --- a/robot/testsuites/vnfsdk_validation.robot +++ b/robot/testsuites/vnfsdk_validation.robot @@ -5,7 +5,7 @@ Test Timeout 1m Resource ../resources/test_templates/vnfsdk_validation_template.robot Library String Test Template Validate Onboarding Package -Default Tags vnfsdk +Default Tags vnfsdk pnf_preonboarding_onboarding *** Variables *** |