rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation 5G Bulk PM Usecase functionality |
| 3 | |
| 4 | Library RequestsLibrary |
| 5 | Library OperatingSystem |
| 6 | Library Collections |
| 7 | Library String |
| 8 | Library DateTime |
| 9 | Library SSHLibrary |
| 10 | Library JSONLibrary |
| 11 | Library Process |
| 12 | Library ONAPLibrary.JSON |
| 13 | Library ONAPLibrary.Utilities |
| 14 | Resource ../resources/usecases/5gbulkpm_interface.robot |
| 15 | Resource ../resources/mr_interface.robot |
| 16 | Resource ../resources/dr_interface.robot |
| 17 | Suite Teardown Usecase Teardown |
| 18 | |
| 19 | *** Variables *** |
| 20 | ${INVENTORY_ENDPOINT} /dcae-service-types |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 21 | ${XNF_SFTP_BLUEPRINT_PATH} ${EXECDIR}/robot/assets/usecases/5gbulkpm/k8s-sftp.yaml |
| 22 | ${BLUEPRINT_TEMPLATE_PATH} ${EXECDIR}/robot/assets/usecases/5gbulkpm/blueprintTemplate.json |
| 23 | ${FTP_FILE_PATH} ${EXECDIR}/robot/assets/usecases/5gbulkpm/pmfiles/A20181002.0000-1000-0015-1000_5G.xml.gz |
| 24 | ${DEPLOYMENT_ENDPOINT} dcae-deployments |
| 25 | ${MR_TOPIC_CHECK_PATH} /topics |
| 26 | ${DR_SUB_CHECK_PATH} /internal/prov |
| 27 | ${MR_TOPIC_URL_PATH} /events/org.onap.dmaap.mr.PERFORMANCE_MEASUREMENTS/CG1/C1 |
| 28 | ${DMAAP_BC_MR_CLIENT_PATH} /webapi/mr_clients |
| 29 | ${DMAAP_BC_MR_CLUSTER_PATH} /webapi/mr_clusters |
| 30 | ${PMMAPPER_HEALTH_CHECK_PATH} /healthcheck |
| 31 | ${JSON_DATA_FILE} ${EXECDIR}/robot/assets/usecases/5gbulkpm/Notification.json |
| 32 | ${VES_LISTENER_PATH} /eventListener/v7 |
| 33 | ${PMMAPPER_SUB_ROLE_DATA} ${EXECDIR}/robot/assets/usecases/5gbulkpm/sub.json |
| 34 | ${PMMAPPER_MR_CLUSTER_DATA} ${EXECDIR}/robot/assets/usecases/5gbulkpm/mr_clusters.json |
Krzysztof Kuzmicki | 52a02b2 | 2020-04-08 12:02:05 +0200 | [diff] [blame^] | 35 | ${NEXUS3} ${GLOBAL_INJECTED_NEXUS_DOCKER_REPO} |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 36 | |
| 37 | *** Test Cases *** |
| 38 | |
| 39 | Deploying Data File Collector |
| 40 | [Tags] 5gbulkpm |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 41 | ${headers}= Create Dictionary content-type=application/json |
| 42 | ${session}= Create Session dfc ${INVENTORY_SERVER} |
Krzysztof Kuzmicki | 52a02b2 | 2020-04-08 12:02:05 +0200 | [diff] [blame^] | 43 | ${resp}= Get Request dfc ${INVENTORY_ENDPOINT}?typeName=k8s-datafile headers=${headers} |
| 44 | ${json}= Set Variable ${resp.json()} |
| 45 | ${serviceTypeId-Dfc} Set Variable ${json['items'][0]['typeId']} |
| 46 | ${image} Get Regexp Matches ${json['items'][0]['blueprintTemplate']} nexus3(.)*?(?=\\") |
| 47 | ${image} Replace String ${image}[0] nexus3.onap.org:10001 ${NEXUS3} |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 48 | Set Global Variable ${serviceTypeId-Dfc} |
Krzysztof Kuzmicki | 52a02b2 | 2020-04-08 12:02:05 +0200 | [diff] [blame^] | 49 | ${deployment_data}= Set Variable {"serviceTypeId": "${serviceTypeId-Dfc}", "inputs": {"tag_version": "${image}"}} |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 50 | ${session}= Create Session deployment-dfc ${DEPLOYMENT_SERVER} |
| 51 | ${resp}= Put Request deployment-dfc /${DEPLOYMENT_ENDPOINT}/datafile data=${deployment_data} headers=${headers} |
| 52 | ${operationLink} Set Variable ${resp.json().get('links').get('status')} |
| 53 | ${operationId} Fetch From Right ${operationLink} / |
Krzysztof Kuzmicki | 52a02b2 | 2020-04-08 12:02:05 +0200 | [diff] [blame^] | 54 | Wait Until Keyword Succeeds 5 minute 20 sec Deployment Status ${DEPLOYMENT_SERVER} ${DEPLOYMENT_ENDPOINT} datafile ${operationId} |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 55 | |
| 56 | Deploying 3GPP PM Mapper |
| 57 | [Tags] 5gbulkpm |
| 58 | ${clusterdata}= OperatingSystem.Get File ${PMMAPPER_MR_CLUSTER_DATA} |
| 59 | ${headers}= Create Dictionary content-type=application/json |
| 60 | ${session}= Create Session dmaapbc ${DMAAP_BC_SERVER} |
| 61 | ${resp}= Post Request dmaapbc ${DMAAP_BC_MR_CLUSTER_PATH} data=${clusterdata} headers=${headers} |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 62 | ${session}= Create Session pmmapper ${INVENTORY_SERVER} |
Krzysztof Kuzmicki | 52a02b2 | 2020-04-08 12:02:05 +0200 | [diff] [blame^] | 63 | ${resp}= Get Request pmmapper ${INVENTORY_ENDPOINT}?typeName=k8s-pm-mapper headers=${headers} |
| 64 | ${json}= Set Variable ${resp.json()} |
| 65 | ${serviceTypeId-Pmmapper} Set Variable ${json['items'][0]['typeId']} |
| 66 | ${image} Get Regexp Matches ${json['items'][0]['blueprintTemplate']} nexus3(.)*?(?=\') |
| 67 | ${image} Replace String ${image}[0] nexus3.onap.org:10001 ${NEXUS3} |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 68 | Set Global Variable ${serviceTypeId-Pmmapper} |
Krzysztof Kuzmicki | 52a02b2 | 2020-04-08 12:02:05 +0200 | [diff] [blame^] | 69 | ${deployment_data}= Set Variable {"inputs":{"client_password": "${GLOBAL_DCAE_PASSWORD}", "tag_version": "${image}"},"serviceTypeId": "${serviceTypeId-Pmmapper}"} |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 70 | ${session}= Create Session deployment-pmmapper ${DEPLOYMENT_SERVER} |
| 71 | ${resp}= Put Request deployment-pmmapper /${DEPLOYMENT_ENDPOINT}/pmmapper data=${deployment_data} headers=${headers} |
| 72 | ${operationLink} Set Variable ${resp.json().get('links').get('status')} |
| 73 | ${operationId} Fetch From Right ${operationLink} / |
Krzysztof Kuzmicki | 52a02b2 | 2020-04-08 12:02:05 +0200 | [diff] [blame^] | 74 | Wait Until Keyword Succeeds 3 minute 10 sec Deployment Status ${DEPLOYMENT_SERVER} ${DEPLOYMENT_ENDPOINT} pmmapper ${operationId} |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 75 | |
| 76 | Deploying SFTP Server As xNF |
| 77 | [Tags] 5gbulkpm |
| 78 | ${blueprint}= OperatingSystem.Get File ${XNF_SFTP_BLUEPRINT_PATH} |
| 79 | ${templatejson}= Load JSON From File ${BLUEPRINT_TEMPLATE_PATH} |
| 80 | ${templatejson}= Update Value To Json ${templatejson} blueprintTemplate ${blueprint} |
| 81 | ${templatejson}= Update Value To Json ${templatejson} typeName sftpserver |
| 82 | ${json_data} Convert JSON To String ${templatejson} |
| 83 | ${headers}= Create Dictionary content-type=application/json |
| 84 | ${session}= Create Session sftp ${INVENTORY_SERVER} |
| 85 | ${resp}= Post Request sftp ${INVENTORY_ENDPOINT} data=${json_data} headers=${headers} |
| 86 | ${serviceTypeId-Sftp}= Set Variable ${resp.json().get('typeId')} |
| 87 | Set Global Variable ${serviceTypeId-Sftp} |
Krzysztof Kuzmicki | 52a02b2 | 2020-04-08 12:02:05 +0200 | [diff] [blame^] | 88 | ${deployment_data}= Set Variable {"serviceTypeId": "${serviceTypeId-Sftp}" } |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 89 | ${session}= Create Session deployment-sftpserver ${DEPLOYMENT_SERVER} |
| 90 | ${resp}= Put Request deployment-sftpserver /${DEPLOYMENT_ENDPOINT}/sftpserver data=${deployment_data} headers=${headers} |
| 91 | ${operationLink}= Set Variable ${resp.json().get('links').get('status')} |
| 92 | ${operationId} Fetch From Right ${operationLink} / |
Krzysztof Kuzmicki | 52a02b2 | 2020-04-08 12:02:05 +0200 | [diff] [blame^] | 93 | Wait Until Keyword Succeeds 2 minute 5 sec Deployment Status ${DEPLOYMENT_SERVER} ${DEPLOYMENT_ENDPOINT} sftpserver ${operationId} |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 94 | |
| 95 | |
| 96 | Checking PERFORMANCE_MEASUREMENTS Topic In Message Router |
| 97 | [Tags] 5gbulkpm |
| 98 | ${headers}= Create Dictionary content-type=application/json |
| 99 | ${subdata}= OperatingSystem.Get File ${PMMAPPER_SUB_ROLE_DATA} |
| 100 | ${session}= Create Session dmaapbc ${DMAAP_BC_SERVER} |
| 101 | ${resp}= Post Request dmaapbc ${DMAAP_BC_MR_CLIENT_PATH} data=${subdata} headers=${headers} |
| 102 | ${resp}= Run MR Get Request ${MR_TOPIC_CHECK_PATH} |
| 103 | Should Be Equal As Strings ${resp.status_code} 200 |
| 104 | ${topics}= Set Variable ${resp.json().get('topics')} |
| 105 | List Should Contain Value ${topics} org.onap.dmaap.mr.PERFORMANCE_MEASUREMENTS |
| 106 | ${resp}= Run MR Auth Get Request ${MR_TOPIC_URL_PATH} ${GLOBAL_DCAE_USERNAME} ${GLOBAL_DCAE_PASSWORD} |
| 107 | Should Be Equal As Strings ${resp.status_code} 200 |
| 108 | |
| 109 | Upload PM Files to xNF SFTP Server |
| 110 | [Tags] 5gbulkpm |
| 111 | Open Connection sftpserver |
| 112 | Login bulkpm bulkpm |
| 113 | ${epoch}= Get Current Date result_format=epoch |
| 114 | Set Global Variable ${epoch} |
| 115 | Put File ${FTP_FILE_PATH} upload/A${epoch}.xml.gz |
| 116 | |
| 117 | DR Bulk PM Feed Check |
| 118 | [Tags] 5gbulkpm |
| 119 | ${resp}= Run DR Get Request ${DR_SUB_CHECK_PATH} |
| 120 | Should Contain ${resp.text} bulk_pm_feed |
| 121 | |
| 122 | DR PM Mapper Subscriber Check |
| 123 | [Tags] 5gbulkpm |
| 124 | ${resp}= Run DR Get Request ${DR_SUB_CHECK_PATH} |
| 125 | Should Contain ${resp.text} https://dcae-pm-mapper:8443/delivery |
| 126 | |
| 127 | Sending File Ready Event to VES Collector |
| 128 | [Tags] 5gbulkpm |
| 129 | ${headers}= Create Dictionary content-type=application/json |
| 130 | ${fileready}= OperatingSystem.Get File ${JSON_DATA_FILE} |
Krzysztof Kuzmicki | 52a02b2 | 2020-04-08 12:02:05 +0200 | [diff] [blame^] | 131 | ${auth}= Create List ${GLOBAL_DCAE_VES_USERNAME} ${GLOBAL_DCAE_VES_PASSWORD} |
| 132 | ${session}= Create Session ves ${VES_HEALTH_CHECK_PATH} auth=${auth} |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 133 | ${resp}= Post Request ves ${VES_LISTENER_PATH} data=${fileready} headers=${headers} |
| 134 | Should Be Equal As Strings ${resp.status_code} 202 |
| 135 | ${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"}}]}}} |
| 136 | ${resp}= Post Request ves ${VES_LISTENER_PATH} data=${VES_FILE_READY_NOTIFICATION} headers=${headers} |
| 137 | Should Be Equal As Strings ${resp.status_code} 202 |
| 138 | |
| 139 | Verifying 3GPP Perf VES Content On PERFORMANCE_MEASUREMENTS Topic |
| 140 | [Tags] 5gbulkpm |
Krzysztof Kuzmicki | 52a02b2 | 2020-04-08 12:02:05 +0200 | [diff] [blame^] | 141 | Wait Until Keyword Succeeds 1 minute 5 sec xNF PM File Validate perf3gpp_RnNode-Ericsson_pmMeasResult |