blob: 3408c8c27d009555878536ee0d8850cba3132921 [file] [log] [blame]
Krzysztof Kuzmicki5e6967f2021-10-01 12:22:06 +02001*** Settings ***
2Documentation The main interface for interacting with 5G Bulkpm.
3Library RequestsLibrary
4Library OperatingSystem
5Library String
6Library JSONLibrary
7Resource ../mr_interface.robot
8Resource ../dr_interface.robot
Krzysztof Kuzmickibae8d832021-11-24 12:00:45 +01009Resource ../bc_interface.robot
Krzysztof Kuzmicki5e6967f2021-10-01 12:22:06 +020010Resource ../consul_interface.robot
11Resource ../chart_museum.robot
12
13*** Variables ***
14${INVENTORY_SERVER} ${GLOBAL_INVENTORY_SERVER_PROTOCOL}://${GLOBAL_INVENTORY_SERVER_NAME}:${GLOBAL_INVENTORY_SERVER_PORT}
15${DEPLOYMENT_SERVER} ${GLOBAL_DEPLOYMENT_HANDLER_SERVER_PROTOCOL}://${GLOBAL_DEPLOYMENT_HANDLER_SERVER_NAME}:${GLOBAL_DEPLOYMENT_HANDLER_SERVER_PORT}
16${DR_ENDPOINT} ${GLOBAL_DMAAP_DR_PROV_SERVER_PROTOCOL}://${GLOBAL_INJECTED_DMAAP_DR_PROV_IP_ADDR}:${GLOBAL_DMAAP_DR_PROV_SERVER_PORT}
17${DMAAP_BC_SERVER} ${GLOBAL_BC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_BC_IP_ADDR}:${GLOBAL_BC_HTTPS_SERVER_PORT}
18${VES_HEALTH_CHECK_PATH} ${GLOBAL_DCAE_VES_HTTPS_PROTOCOL}://${GLOBAL_INJECTED_DCAE_VES_HOST}:${GLOBAL_DCAE_VES_HTTPS_SERVER_PORT}
19${MR_PUBLISH_TEMPLATE} mr/mr_publish.jinja
20${INVENTORY_ENDPOINT} /dcae-service-types
21${XNF_SFTP_BLUEPRINT_PATH} ${EXECDIR}/robot/assets/usecases/5gbulkpm/k8s-sftp.yaml
22${XNF_HTTPS_BLUEPRINT_PATH} ${EXECDIR}/robot/assets/usecases/5gbulkpm/k8s-https.yaml
23${BLUEPRINT_TEMPLATE_PATH} ${EXECDIR}/robot/assets/usecases/5gbulkpm/blueprintTemplate.json
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${MR_TOPIC_URL_PATH_FOR_POST} /events/org.onap.dmaap.mr.PERFORMANCE_MEASUREMENTS
29${DMAAP_BC_MR_CLIENT_PATH} /webapi/mr_clients
30${DMAAP_BC_MR_CLUSTER_PATH} /webapi/mr_clusters
31${PMMAPPER_HEALTH_CHECK_PATH} /healthcheck
32${JSON_DATA_FILE} ${EXECDIR}/robot/assets/usecases/5gbulkpm/Notification.json
33${VES_LISTENER_PATH} /eventListener/v7
34${PMMAPPER_SUB_ROLE_DATA} ${EXECDIR}/robot/assets/usecases/5gbulkpm/sub.json
35${PMMAPPER_MR_CLUSTER_DATA} ${EXECDIR}/robot/assets/usecases/5gbulkpm/mr_clusters.json
36${NEXUS3} ${GLOBAL_INJECTED_NEXUS_DOCKER_REPO}
37${SET_KNOWN_HOSTS_FILE_PATH} kubectl set env deployment/$(kubectl get deployment -n onap | grep datafile | awk '{print $1}') KNOWN_HOSTS_FILE_PATH=/home/datafile/.ssh/known_hosts -n onap
38${CHECK_ENV_SET} kubectl set env pod/$(kubectl get pod -n onap | grep datafile | awk '{print $1}') --list -n onap
39${COPY_RSA_KEY} kubectl cp /tmp/known_hosts $(kubectl get pod -n onap | grep datafile | awk '{print $1}'):/home/datafile/.ssh/known_hosts -n onap
Krzysztof Kuzmickie0403922022-02-25 12:49:52 +010040${CHECK_DFC_LOGS} kubectl logs $(kubectl get pod -n onap | grep datafile | awk '{print $1}') -n onap --tail=10
Krzysztof Kuzmickibae8d832021-11-24 12:00:45 +010041${CHECK_ALL_DFC_LOGS} kubectl logs $(kubectl get pod -n onap | grep datafile | awk '{print $1}') -n onap --all-containers
42${CHECK_ALL_PMMAPPER_LOGS} kubectl logs $(kubectl get pod -n onap | grep pm-mapper | awk '{print $1}') -n onap --all-containers
Krzysztof Kuzmicki5e6967f2021-10-01 12:22:06 +020043${EXPECTED_PRINT} StrictHostKeyChecking is enabled but environment variable KNOWN_HOSTS_FILE_PATH is not set or points to not existing file
44${MONGO_BLUEPRINT_PATH} ${EXECDIR}/robot/assets/cmpv2/k8s-mongo.yaml
45${PNF_SIMULATOR_BLUEPRINT_PATH} ${EXECDIR}/robot/assets/cmpv2/k8s-pnf-simulator.yaml
46${MONGO_VES_CLIENT_BLUEPRINT_PATH} ${EXECDIR}/robot/assets/cmpv2/k8s-mongo-ves-client.yaml
47${VES_CLIENT_BLUEPRINT_PATH} ${EXECDIR}/robot/assets/cmpv2/k8s-ves-client.yaml
48${VES_INPUTS} deployment/VesTlsCmpv2Inputs.jinja
49${pm_notification_event} dfc/notification.jinja
50${consul_change_event} dfc/consul.jinja
51${ves_client_single_event}= ves/pnf_simulator_single_event.jinja
52${SFTP_HELM_CHARTS} ${EXECDIR}/robot/assets/helm/sftp
Krzysztof Kuzmickibae8d832021-11-24 12:00:45 +010053${HTTPS_SERVER_HELM_CHARTS} ${EXECDIR}/robot/assets/helm/pm-https-server
Krzysztof Kuzmicki5e6967f2021-10-01 12:22:06 +020054${HELM_RELEASE} kubectl --namespace onap get pods | sed 's/ .*//' | grep robot | sed 's/-.*//'
55
56*** Keywords ***
57
58xNF PM File Validate
59 [Documentation]
60 ... This keyword gathers all events from message router topic and validates if in recived data is present an expected string: "${expected_pm_str}" .
61 [Arguments] ${expected_pm_str}
62 ${timestamp}= Get Time epoch
63 ${resp}= Run MR Auth Get Request ${MR_TOPIC_URL_PATH} ${GLOBAL_DCAE_USERNAME} ${GLOBAL_DCAE_PASSWORD}
64 Should Contain ${resp.text} ${expected_pm_str}
65
66Topic Validate
67 [Arguments] ${value}
68 ${timestamp}= Get Current Date
69 ${dict}= Create Dictionary timestamp=${timestamp}
70 Templating.Create Environment mr ${GLOBAL_TEMPLATE_FOLDER}
71 ${data}= Templating.Apply Template mr ${MR_PUBLISH_TEMPLATE} ${dict}
72 ${resp}= Run MR Auth Post Request (User And Pass) ${MR_TOPIC_URL_PATH_FOR_POST} ${GLOBAL_DCAE_USERNAME} ${GLOBAL_DCAE_PASSWORD} ${data}
73 Should Be Equal As Strings ${resp.status_code} 200
74 ${resp}= Run MR Auth Get Request ${MR_TOPIC_URL_PATH} ${GLOBAL_DCAE_USERNAME} ${GLOBAL_DCAE_PASSWORD}
75 Should Contain ${resp.text} ${value}
76
77Send File Ready Event to VES Collector and Deploy all DCAE Applications
78 [Arguments] ${pm_file} ${file_format_type} ${file_format_version}
79 Disable Warnings
Krzysztof Kuzmickibae8d832021-11-24 12:00:45 +010080 Delete PERFORMANCE_MEASUREMENTS topic
Krzysztof Kuzmicki5e6967f2021-10-01 12:22:06 +020081 Setting Global Variables
82 Send File Ready Event to VES Collector ${pm_file} ${file_format_type} ${file_format_version}
83 Add chart repository chart-museum http://chart-museum:80 onapinitializer demo123456!
84 Log To Console Deploying Data File Collector
85 Deploying Data File Collector
86 Log To Console Deploying 3GPP PM Mapper
87 Deploying 3GPP PM Mapper
88 Log To Console Deploying SFTP Server As xNF
89 Deploying SFTP Server As xNF
Krzysztof Kuzmickibae8d832021-11-24 12:00:45 +010090 Log To Console Deploying HTTPS Server with correct CMPv2 certificates as xNF
91 Deploying HTTPS server with correct certificates
92 Log To Console Deploying HTTPS Server with wrong subject alternatives in CMPv2 certificates as xNF
93 Deploying HTTPS server with wrong certificates - wrong SAN-s
Krzysztof Kuzmicki5e6967f2021-10-01 12:22:06 +020094 Checking PERFORMANCE_MEASUREMENTS Topic In Message Router
95 DR Bulk PM Feed Check
96 DR PM Mapper Subscriber Check
97
98Usecase Teardown
99 Disable Warnings
Krzysztof Kuzmickibae8d832021-11-24 12:00:45 +0100100 Get all logs from PM Mapper
101 Get all logs from Data File Collector
102 Uninstall helm charts ${ONAP_HELM_RELEASE}-dcae-datafile-collector
103 Uninstall helm charts ${ONAP_HELM_RELEASE}-dcae-pm-mapper
Krzysztof Kuzmicki5e6967f2021-10-01 12:22:06 +0200104 Uninstall helm charts ${ONAP_HELM_RELEASE}-sftp
Krzysztof Kuzmickibae8d832021-11-24 12:00:45 +0100105 Uninstall helm charts ${ONAP_HELM_RELEASE}-pm-https-server-correct-sans
106 Uninstall helm charts ${ONAP_HELM_RELEASE}-pm-https-server-wrong-sans
107
108Delete PERFORMANCE_MEASUREMENTS topic
109 ${resp}= Delete MR topic /webapi/topics/org.onap.dmaap.mr.PERFORMANCE_MEASUREMENTS
Krzysztof Kuzmicki5e6967f2021-10-01 12:22:06 +0200110
111Setting Global Variables
112 ${test_variables} = Create Dictionary
113 Set To Dictionary ${test_variables} FILE_FORMAT_TYPE=org.3GPP.32.435#measCollec
114 ... FILE_FORMAT_VERSION=V10
115 ... PM_FILE_PATH=${EXECDIR}/robot/assets/usecases/5gbulkpm/pmfiles/A20181002.0000-1000-0015-1000_5G.xml.gz
116 ... EXPECTED_PM_STR=perf3gpp_RnNode-Ericsson_pmMeasResult
117 Set Global Variable ${GLOBAL_TEST_VARIABLES} ${test_variables}
118 ${command_output} = Run And Return Rc And Output ${HELM_RELEASE}
119 Should Be Equal As Integers ${command_output[0]} 0
120 Set Global Variable ${ONAP_HELM_RELEASE} ${command_output[1]}
121
122Send File Ready Event to VES Collector
123 [Arguments] ${pm_file} ${file_format_type} ${file_format_version}
124 Disable Warnings
125 ${headers}= Create Dictionary content-type=application/json
126 ${fileready}= OperatingSystem.Get File ${JSON_DATA_FILE}
127 ${auth}= Create List ${GLOBAL_DCAE_VES_USERNAME} ${GLOBAL_DCAE_VES_PASSWORD}
128 ${session}= Create Session ves ${VES_HEALTH_CHECK_PATH} auth=${auth}
129 ${resp}= Post Request ves ${VES_LISTENER_PATH} data=${fileready} headers=${headers}
130 Should Be Equal As Strings ${resp.status_code} 202
131 ${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":"${pm_file}","hashMap":{"location":"sftp://bulkpm:bulkpm@${ONAP_HELM_RELEASE}-sftp:22/upload/${pm_file}","compression":"gzip","fileFormatType":"${file_format_type}","fileFormatVersion":"${file_format_version}"}}]}}}
132 ${resp}= Post Request ves ${VES_LISTENER_PATH} data=${VES_FILE_READY_NOTIFICATION} headers=${headers}
133 Should Be Equal As Strings ${resp.status_code} 202
134
135Upload PM Files to xNF SFTP Server
136 [Arguments] ${pm_file_path}
137 Open Connection ${ONAP_HELM_RELEASE}-sftp
138 Login bulkpm bulkpm
139 ${epoch}= Get Current Date result_format=epoch
140 ${pm_file}= Set Variable A${epoch}.xml.gz
141 Put File ${pm_file_path} upload/${pm_file}
142 [Return] ${pm_file}
143
Krzysztof Kuzmicki5e6967f2021-10-01 12:22:06 +0200144Check Given Print In DFC Log
145 [Arguments] ${check_dfc_logs}
146 ${dfc_logs}= Run Given Command On DFC Container ${CHECK_DFC_LOGS}
147 Should Contain ${dfc_logs} HostKey has been changed
148
149Run Given Command On DFC Container
150 [Arguments] ${user_command}
151 ${run_command} = Run And Return Rc And Output ${user_command}
Krzysztof Kuzmickie0403922022-02-25 12:49:52 +0100152 Should Be Equal As Integers ${run_command[0]} 0
Krzysztof Kuzmicki5e6967f2021-10-01 12:22:06 +0200153 ${command_output} = Set Variable ${run_command[1]}
154 ${regexp_matches} = Get Regexp Matches ${command_output} .*(\\s|\\[)+(.+-datafile-collector).* 2
Krzysztof Kuzmickie0403922022-02-25 12:49:52 +0100155 ${matches_length} = Get length ${regexp_matches}
156 ${log} = Run Keyword If "${matches_length}"!='0' Get DFC log by container name ${command_output} ${regexp_matches}
157 ... ELSE Set Variable ${command_output}
158 [Return] ${log}
159
160Get DFC log by container name
161 [Arguments] ${command_output} ${regexp_matches}
Krzysztof Kuzmicki5e6967f2021-10-01 12:22:06 +0200162 ${dfc_container_name} = Set Variable ${regexp_matches[0]}
163 ${new_command} = Set Variable ${user_command} ${dfc_container_name}
164 ${command_output} = Run And Return Rc And Output ${new_command}
Krzysztof Kuzmickie0403922022-02-25 12:49:52 +0100165 Should Be Equal As Integers ${run_command[0]} 0
166 ${log} = Set Variable ${run_command[1]}
Krzysztof Kuzmicki5e6967f2021-10-01 12:22:06 +0200167 [Return] ${log}
168
169Check Known Hosts In Env
170 [Arguments] ${CHECK_KNOWN_HOSTS}
171 ${check} = Run And Return Rc And Output ${CHECK_KNOWN_HOSTS}
172 Should Be Equal As Integers ${check[0]} 0
173 ${env} = Set Variable ${check[1]}
174 ${string_matches} = Get Lines Containing String ${env} KNOWN_HOSTS_FILE_PATH=/home/datafile/.ssh/known_host case_insensitive=True
175 ${output} = Should Not Be Empty ${string_matches}
176 [Return] ${output}
177
178Deploying Data File Collector
Krzysztof Kuzmicki83837dc2022-03-23 10:29:20 +0100179 Install helm charts chart-museum dcae-datafile-collector ${ONAP_HELM_RELEASE}-dcae-datafile-collector 6m --set useCmpv2Certificates=true --set global.cmpv2Enabled=true --set masterPasswordOverride=test --set global.centralizedLoggingEnabled=false --debug
Krzysztof Kuzmicki5e6967f2021-10-01 12:22:06 +0200180
181Deploying 3GPP PM Mapper
Krzysztof Kuzmicki83837dc2022-03-23 10:29:20 +0100182 Install helm charts chart-museum dcae-pm-mapper ${ONAP_HELM_RELEASE}-dcae-pm-mapper 6m --set global.centralizedLoggingEnabled=false --debug
Krzysztof Kuzmicki5e6967f2021-10-01 12:22:06 +0200183
184Deploying SFTP Server As xNF
Krzysztof Kuzmickibae8d832021-11-24 12:00:45 +0100185 ${override} = Set Variable --set fullnameOverride=${ONAP_HELM_RELEASE}-sftp --debug
Krzysztof Kuzmicki5e6967f2021-10-01 12:22:06 +0200186 Install helm charts from folder ${SFTP_HELM_CHARTS} ${ONAP_HELM_RELEASE}-sftp set_values_override=${override}
187
Krzysztof Kuzmickibae8d832021-11-24 12:00:45 +0100188Deploying HTTPS server with correct certificates
189 ${name} = Set Variable ${ONAP_HELM_RELEASE}-pm-https-server-correct-sans
190 ${override} = Set Variable --set fullnameOverride=${name} --set nameOverride=${name} --set certificates.name=${name} --set certificates.commonName=${name} --set certificates.dnsNames={${name}} --debug
191 Install helm charts from folder ${HTTPS_SERVER_HELM_CHARTS} ${name} set_values_override=${override}
192
193Deploying HTTPS server with wrong certificates - wrong SAN-s
194 ${name} = Set Variable ${ONAP_HELM_RELEASE}-pm-https-server-wrong-sans
195 ${override} = Set Variable --set fullnameOverride=${name} --set nameOverride=${name} --set certificates.name=${name} --set certificates.commonName=wrong-sans-1 --set certificates.dnsNames={wrong-sans-2} --debug
196 Install helm charts from folder ${HTTPS_SERVER_HELM_CHARTS} ${name} set_values_override=${override}
197
Krzysztof Kuzmicki5e6967f2021-10-01 12:22:06 +0200198Checking PERFORMANCE_MEASUREMENTS Topic In Message Router
199 ${headers}= Create Dictionary content-type=application/json
200 ${subdata}= OperatingSystem.Get File ${PMMAPPER_SUB_ROLE_DATA}
201 ${session}= Create Session dmaapbc ${DMAAP_BC_SERVER}
202 ${resp}= Post Request dmaapbc ${DMAAP_BC_MR_CLIENT_PATH} data=${subdata} headers=${headers}
203 Wait Until Keyword Succeeds 5 minute 5 sec Topic Validate success
204 ${resp}= Run MR Get Request ${MR_TOPIC_CHECK_PATH}
205 Should Be Equal As Strings ${resp.status_code} 200
206 ${topics}= Set Variable ${resp.json().get('topics')}
207 List Should Contain Value ${topics} org.onap.dmaap.mr.PERFORMANCE_MEASUREMENTS
208 ${resp}= Run MR Auth Get Request ${MR_TOPIC_URL_PATH} ${GLOBAL_DCAE_USERNAME} ${GLOBAL_DCAE_PASSWORD}
209 Should Be Equal As Strings ${resp.status_code} 200
210
211DR Bulk PM Feed Check
212 ${resp}= Run DR Get Request ${DR_SUB_CHECK_PATH}
213 Should Contain ${resp.text} bulk_pm_feed
214
215DR PM Mapper Subscriber Check
216 ${resp}= Run DR Get Request ${DR_SUB_CHECK_PATH}
217 Should Contain ${resp.text} https://dcae-pm-mapper:8443/delivery
218
219Setting KNOWN_HOSTS_FILE_PATH Environment Variable in DFC
220 ${rc}= Run and Return RC ${SET_KNOWN_HOSTS_FILE_PATH}
221 Should Be Equal As Integers ${rc} 0
Krzysztof Kuzmicki93b32fa2022-03-02 12:23:04 +0100222 Wait Until Keyword Succeeds 7 min 10s Check Known Hosts In Env ${CHECK_ENV_SET}
Krzysztof Kuzmicki5e6967f2021-10-01 12:22:06 +0200223 ${GET_RSA_KEY}= Set Variable kubectl exec $(kubectl get pod -n onap | grep ${ONAP_HELM_RELEASE}-sftp | awk '{print $1}') -n onap -- ssh-keyscan -t rsa ${ONAP_HELM_RELEASE}-sftp > /tmp/known_hosts
224 ${rc}= Run and Return RC ${GET_RSA_KEY}
225 Should Be Equal As Integers ${rc} 0
226 ${rc}= Run and Return RC ${COPY_RSA_KEY}
227 Should Be Equal As Integers ${rc} 0
228
229Uploading PM Files to xNF SFTP Server
230 ${pm_file}= Upload PM Files to xNF SFTP Server ${GLOBAL_TEST_VARIABLES["PM_FILE_PATH"]}
231 Set Global Variable ${PM_FILE} ${pm_file}
232
233Sending File Ready Event to VES Collector
234 Send File Ready Event to VES Collector ${PM_FILE} ${GLOBAL_TEST_VARIABLES["FILE_FORMAT_TYPE"]} ${GLOBAL_TEST_VARIABLES["FILE_FORMAT_VERSION"]}
235
236Verifying 3GPP Perf VES Content On PERFORMANCE_MEASUREMENTS Topic
237 Wait Until Keyword Succeeds 2 min 5 sec xNF PM File Validate ${GLOBAL_TEST_VARIABLES["EXPECTED_PM_STR"]}
238
239Changing SFTP Server RSA Key in DFC
240 ${get_known_hosts_file}= OperatingSystem.Get File /tmp/known_hosts
241 ${change_rsa_key}= Replace String ${get_known_hosts_file} A a
242 Create File /tmp/known_hosts ${change_rsa_key}
243 ${rc}= Run and Return RC ${COPY_RSA_KEY}
244 Should Be Equal As Integers ${rc} 0
245
246Checking DFC Logs After KNOWN_HOSTS_FILE_PATH Env Variable Added
247 ${dfc_logs}= Run Given Command On DFC Container ${CHECK_DFC_LOGS}
248 Should Not Contain ${dfc_logs} ${EXPECTED_PRINT}
249
Krzysztof Kuzmickibae8d832021-11-24 12:00:45 +0100250Get all logs from PM Mapper
251 ${pmmapper_logs}= Check logs ${CHECK_ALL_PMMAPPER_LOGS}
252 Log ${pmmapper_logs}
253
254Get all logs from Data File Collector
255 ${pmmapper_logs}= Check logs ${CHECK_ALL_DFC_LOGS}
256 Log ${pmmapper_logs}
257
Krzysztof Kuzmicki5e6967f2021-10-01 12:22:06 +0200258Checking DFC Logs After SFTP Server RSA Key Changed
259 Wait Until Keyword Succeeds 5 min 30 sec Check Given Print In DFC LOG ${CHECK_DFC_LOGS}
260
Krzysztof Kuzmickibae8d832021-11-24 12:00:45 +0100261Check logs
262 [Arguments] ${LOG_CHECK}
263 ${rc} = Run And Return Rc And Output ${LOG_CHECK}
264 Should Be Equal As Integers ${rc[0]} 0
265 [Return] ${rc[1]}
266
267Change DFC httpsHostnameVerify configuration in Consul
268 [Documentation] Changes DFC httpsHostnameVerify config.
269 [Arguments] ${httpsHostnameVerify}
270 ${httpsHostnameVerify_conf} Create Dictionary httpsHostnameVerify=${httpsHostnameVerify}
271 Templating.Create Environment pm ${GLOBAL_TEMPLATE_FOLDER}
272 ${event}= Templating.Apply Template pm ${consul_change_event} ${httpsHostnameVerify_conf}
273 ${rc} ${container_name} = Run and Return RC and Output kubectl get pods -n onap | grep datafile-collector | awk '{print $1}' | grep -v NAME | awk -F'-' '{print $2}'
274 Should Be Equal As Integers ${rc} 0
275 ${resp}= Run Consul Put Request /v1/kv/${container_name}-datafile-collector?raw=1 ${event}
276 Should Be Equal As Strings ${resp.status_code} 200
277 ${rc} = Run and Return RC kubectl delete pods -n onap $(kubectl get pods -n onap | grep datafile-collector | awk '{print $1}' | grep -v NAME)
278 Should Be Equal As Integers ${rc} 0
Krzysztof Kuzmicki93b32fa2022-03-02 12:23:04 +0100279 Wait Until Keyword Succeeds 360 sec 15 sec Check logs kubectl logs -n onap $(kubectl get pods -n onap | grep datafile-collector | awk '{print $1}' | grep -v NAME) ${container_name}-datafile-collector
Krzysztof Kuzmickibae8d832021-11-24 12:00:45 +0100280
281Sending File Ready Event to VES Collector for HTTPS Server
282 [Arguments] ${https-server_host}
283 Send File Ready Event to VES Collector for HTTPS Server ${PM_FILE} ${GLOBAL_TEST_VARIABLES["FILE_FORMAT_TYPE"]} ${GLOBAL_TEST_VARIABLES["FILE_FORMAT_VERSION"]} ${https-server_host}
284
285Send File Ready Event to VES Collector for HTTPS Server
286 [Arguments] ${pm_file} ${file_format_type} ${file_format_version} ${https_server_host}
287 Disable Warnings
288 ${pm_event} Create Dictionary https_server_host=${https_server_host} pm_file=${pm_file} fileFormatType=${file_format_type} fileFormatVersion=${file_format_version}
289 Templating.Create Environment pm ${GLOBAL_TEMPLATE_FOLDER}
290 ${VES_FILE_READY_NOTIFICATION}= Templating.Apply Template pm ${pm_notification_event} ${pm_event}
291 ${headers}= Create Dictionary content-type=application/json
292 ${auth}= Create List ${GLOBAL_DCAE_VES_USERNAME} ${GLOBAL_DCAE_VES_PASSWORD}
293 ${session}= Create Session ves ${VES_HEALTH_CHECK_PATH} auth=${auth}
294 ${resp}= Post Request ves ${VES_LISTENER_PATH} data=${VES_FILE_READY_NOTIFICATION} headers=${headers}
295 Should Be Equal As Strings ${resp.status_code} 202
296
297
298Uploading PM Files to xNF HTTPS Server
299 [Arguments] ${https-server_host}
300 ${pm_file}= Upload PM Files to xNF HTTPS Server ${GLOBAL_TEST_VARIABLES["PM_FILE_PATH"]} ${https-server_host}
301 Set Global Variable ${PM_FILE} ${pm_file}
302
303Upload PM Files to xNF HTTPS Server
304 [Arguments] ${pm_file_path} ${https_server}
305 ${epoch}= Get Current Date result_format=epoch
306 ${pm_file} = Set Variable A${epoch}.xml.gz
307 Copy File ${pm_file_path} tmp/${pm_file}
308 ${fileData}= Get Binary File tmp/${pm_file}
309 ${file_part}= Create List ${pm_file} ${fileData} application/octet-stream
310 ${fileParts}= Create Dictionary
311 Set to Dictionary ${fileParts} uploaded_file=${file_part}
312 ${auth}= Create List demo demo123456!
313 ${session}= Create Session https http://${https_server}:80 auth=${auth}
314 ${resp}= Post Request https /upload.php files=${fileParts}
315 Should Be Equal As Strings ${resp.status_code} 200
316 [Return] ${pm_file}