blob: 1a0252cbc2051091c4a4c0e28e7037257d045ba1 [file] [log] [blame]
rajendrajaiswal9b723a82019-11-25 12:18:51 +00001*** Settings ***
2Documentation 5G Bulk PM Usecase functionality
3
4Library RequestsLibrary
5Library OperatingSystem
6Library Collections
7Library String
8Library DateTime
9Library SSHLibrary
10Library JSONLibrary
11Library Process
12Library ONAPLibrary.JSON
13Library ONAPLibrary.Utilities
14Resource ../resources/usecases/5gbulkpm_interface.robot
15Resource ../resources/mr_interface.robot
16Resource ../resources/dr_interface.robot
17Suite Teardown Usecase Teardown
18
19*** Variables ***
20${INVENTORY_ENDPOINT} /dcae-service-types
rajendrajaiswal9b723a82019-11-25 12:18:51 +000021${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 Kuzmicki52a02b22020-04-08 12:02:05 +020035${NEXUS3} ${GLOBAL_INJECTED_NEXUS_DOCKER_REPO}
rajendrajaiswal9b723a82019-11-25 12:18:51 +000036
37*** Test Cases ***
38
39Deploying Data File Collector
40 [Tags] 5gbulkpm
rajendrajaiswal9b723a82019-11-25 12:18:51 +000041 ${headers}= Create Dictionary content-type=application/json
42 ${session}= Create Session dfc ${INVENTORY_SERVER}
Krzysztof Kuzmicki52a02b22020-04-08 12:02:05 +020043 ${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}
rajendrajaiswal9b723a82019-11-25 12:18:51 +000048 Set Global Variable ${serviceTypeId-Dfc}
Krzysztof Kuzmicki52a02b22020-04-08 12:02:05 +020049 ${deployment_data}= Set Variable {"serviceTypeId": "${serviceTypeId-Dfc}", "inputs": {"tag_version": "${image}"}}
rajendrajaiswal9b723a82019-11-25 12:18:51 +000050 ${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 Kuzmicki52a02b22020-04-08 12:02:05 +020054 Wait Until Keyword Succeeds 5 minute 20 sec Deployment Status ${DEPLOYMENT_SERVER} ${DEPLOYMENT_ENDPOINT} datafile ${operationId}
rajendrajaiswal9b723a82019-11-25 12:18:51 +000055
56Deploying 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}
rajendrajaiswal9b723a82019-11-25 12:18:51 +000062 ${session}= Create Session pmmapper ${INVENTORY_SERVER}
Krzysztof Kuzmicki52a02b22020-04-08 12:02:05 +020063 ${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}
rajendrajaiswal9b723a82019-11-25 12:18:51 +000068 Set Global Variable ${serviceTypeId-Pmmapper}
Krzysztof Kuzmicki52a02b22020-04-08 12:02:05 +020069 ${deployment_data}= Set Variable {"inputs":{"client_password": "${GLOBAL_DCAE_PASSWORD}", "tag_version": "${image}"},"serviceTypeId": "${serviceTypeId-Pmmapper}"}
rajendrajaiswal9b723a82019-11-25 12:18:51 +000070 ${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 Kuzmicki52a02b22020-04-08 12:02:05 +020074 Wait Until Keyword Succeeds 3 minute 10 sec Deployment Status ${DEPLOYMENT_SERVER} ${DEPLOYMENT_ENDPOINT} pmmapper ${operationId}
rajendrajaiswal9b723a82019-11-25 12:18:51 +000075
76Deploying 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 Kuzmicki52a02b22020-04-08 12:02:05 +020088 ${deployment_data}= Set Variable {"serviceTypeId": "${serviceTypeId-Sftp}" }
rajendrajaiswal9b723a82019-11-25 12:18:51 +000089 ${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 Kuzmicki52a02b22020-04-08 12:02:05 +020093 Wait Until Keyword Succeeds 2 minute 5 sec Deployment Status ${DEPLOYMENT_SERVER} ${DEPLOYMENT_ENDPOINT} sftpserver ${operationId}
rajendrajaiswal9b723a82019-11-25 12:18:51 +000094
95
96Checking 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
109Upload 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
117DR 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
122DR 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
127Sending 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 Kuzmicki52a02b22020-04-08 12:02:05 +0200131 ${auth}= Create List ${GLOBAL_DCAE_VES_USERNAME} ${GLOBAL_DCAE_VES_PASSWORD}
132 ${session}= Create Session ves ${VES_HEALTH_CHECK_PATH} auth=${auth}
rajendrajaiswal9b723a82019-11-25 12:18:51 +0000133 ${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
139Verifying 3GPP Perf VES Content On PERFORMANCE_MEASUREMENTS Topic
140 [Tags] 5gbulkpm
Krzysztof Kuzmicki52a02b22020-04-08 12:02:05 +0200141 Wait Until Keyword Succeeds 1 minute 5 sec xNF PM File Validate perf3gpp_RnNode-Ericsson_pmMeasResult