blob: 8585c3037cd453548e61dbe329266044b04ece14 [file] [log] [blame]
Rahul Maheshwarifaa5d202020-02-24 23:32:57 -06001*** Settings ***
2Documentation This suite tests Platform Event Log (PEL) functionality of OpenBMC.
3
4Library ../../lib/pel_utils.py
Rahul Maheshwaria17a3392020-03-02 04:51:52 -06005Variables ../../data/pel_variables.py
Rahul Maheshwari8f5256f2020-02-26 23:53:55 -06006Resource ../../lib/list_utils.robot
Rahul Maheshwarif4a01aa2020-08-24 23:22:59 -05007Resource ../../lib/logging_utils.robot
Rahul Maheshwarifaa5d202020-02-24 23:32:57 -06008Resource ../../lib/openbmc_ffdc.robot
9
Rahul Maheshwarif575c902020-02-26 04:38:40 -060010Test Setup Redfish.Login
11Test Teardown Run Keywords Redfish.Logout AND FFDC On Test Case Fail
Rahul Maheshwarifaa5d202020-02-24 23:32:57 -060012
13
14*** Variables ***
15
16${CMD_INTERNAL_FAILURE} busctl call xyz.openbmc_project.Logging /xyz/openbmc_project/logging
17... xyz.openbmc_project.Logging.Create Create ssa{ss} xyz.openbmc_project.Common.Error.InternalFailure
18... xyz.openbmc_project.Logging.Entry.Level.Error 0
Rahul Maheshwari97d7ab82020-08-04 00:01:42 -050019
20${CMD_FRU_CALLOUT} busctl call xyz.openbmc_project.Logging /xyz/openbmc_project/logging
21... xyz.openbmc_project.Logging.Create Create ssa{ss} xyz.openbmc_project.Common.Error.Timeout
22... xyz.openbmc_project.Logging.Entry.Level.Error 2 "TIMEOUT_IN_MSEC" "5"
23... "CALLOUT_INVENTORY_PATH" "/xyz/openbmc_project/inventory/system/chassis/motherboard"
24
25${CMD_PROCEDURAL_SYMBOLIC_FRU_CALLOUT} busctl call xyz.openbmc_project.Logging /xyz/openbmc_project/logging
26... xyz.openbmc_project.Logging.Create Create ssa{ss} org.open_power.Logging.Error.TestError1
27... xyz.openbmc_project.Logging.Entry.Level.Error 0
28
manashsarma4e935382020-10-16 12:00:53 -050029${CMD_INFORMATIONAL_ERROR} busctl call xyz.openbmc_project.Logging /xyz/openbmc_project/logging
30... xyz.openbmc_project.Logging.Create Create ssa{ss} xyz.openbmc_project.Common.Error.TestError2
31... xyz.openbmc_project.Logging.Entry.Level.Informational 0
32
Rahul Maheshwari97d7ab82020-08-04 00:01:42 -050033${CMD_INVENTORY_PREFIX} busctl get-property xyz.openbmc_project.Inventory.Manager
34... /xyz/openbmc_project/inventory/system/chassis/motherboard
35
manashsarma15fe5632020-10-18 03:42:58 -050036${CMD_UNRECOVERABLE_ERROR} busctl call xyz.openbmc_project.Logging /xyz/openbmc_project/logging
37... xyz.openbmc_project.Logging.Create Create ssa{ss} xyz.openbmc_project.Common.Error.InternalFailure
38... xyz.openbmc_project.Logging.Entry.Level.Error 0
39
40${CMD_PREDICTIVE_ERROR} busctl call xyz.openbmc_project.Logging /xyz/openbmc_project/logging
41... xyz.openbmc_project.Logging.Create Create ssa{ss} xyz.openbmc_project.Common.Error.InternalFailure
42... xyz.openbmc_project.Logging.Entry.Level.Warning 0
43
Rahul Maheshwari39918682020-07-07 06:42:20 -050044@{mandatory_pel_fileds} Private Header User Header Primary SRC Extended User Header Failing MTMS
Rahul Maheshwarifaa5d202020-02-24 23:32:57 -060045
46
47*** Test Cases ***
48
49Create Test PEL Log And Verify
50 [Documentation] Create PEL log using busctl command and verify via peltool.
51 [Tags] Create_Test_PEL_Log_And_Verify
52
Rahul Maheshwarif575c902020-02-26 04:38:40 -060053 Redfish Purge Event Log
Rahul Maheshwarifaa5d202020-02-24 23:32:57 -060054 Create Test PEL Log
Rahul Maheshwarif575c902020-02-26 04:38:40 -060055 ${pel_id}= Get PEL Log Via BMC CLI
56 Should Not Be Empty ${pel_id} msg=System PEL log entry is empty.
57
58
Rahul Maheshwaria17a3392020-03-02 04:51:52 -060059Verify PEL Log Details
60 [Documentation] Verify PEL log details via peltool.
61 [Tags] Verify_PEL_Log_Details
62
63 Redfish Purge Event Log
64
65 ${bmc_time1}= CLI Get BMC DateTime
66 Create Test PEL Log
67 ${bmc_time2}= CLI Get BMC DateTime
68
69 ${pel_records}= Peltool -l
70
71 # Example output from 'Peltool -l':
72 # pel_records:
73 # [0x50000012]:
74 # [CreatorID]: BMC
75 # [CompID]: 0x1000
76 # [PLID]: 0x50000012
77 # [Subsystem]: BMC Firmware
78 # [Message]: An application had an internal failure
79 # [SRC]: BD8D1002
80 # [Commit Time]: 03/02/2020 09:35:15
81 # [Sev]: Unrecoverable Error
82
83 ${ids}= Get Dictionary Keys ${pel_records}
84 ${id}= Get From List ${ids} 0
85
86 @{pel_fields}= Create List CreatorID Subsystem Message Sev
87 FOR ${field} IN @{pel_fields}
88 Valid Value pel_records['${id}']['${field}'] ['${PEL_DETAILS['${field}']}']
89 END
90
91 Valid Value pel_records['${id}']['PLID'] ['${id}']
92
93 # Verify if "CompID" and "SRC" fields of PEL has alphanumeric value.
94 Should Match Regexp ${pel_records['${id}']['CompID']} [a-zA-Z0-9]
95 Should Match Regexp ${pel_records['${id}']['SRC']} [a-zA-Z0-9]
96
97 ${pel_date_time}= Convert Date ${pel_records['${id}']['Commit Time']}
98 ... date_format=%m/%d/%Y %H:%M:%S exclude_millis=yes
99
100 # Convert BMC and PEL time to epoch time before comparing.
101 ${bmc_time1_epoch}= Convert Date ${bmc_time1} epoch
102 ${pel_time_epoch}= Convert Date ${pel_date_time} epoch
103 ${bmc_time2_epoch}= Convert Date ${bmc_time2} epoch
104
105 Should Be True ${bmc_time1_epoch} <= ${pel_time_epoch} <= ${bmc_time2_epoch}
106
107
Rahul Maheshwari39918682020-07-07 06:42:20 -0500108Verify Mandatory Sections Of Error Log PEL
109 [Documentation] Verify mandatory sections of error log PEL.
110 [Tags] Verify_Mandatory_Sections_Of_Error_Log_PEL
111
112 Create Test PEL Log
113
114 ${pel_ids}= Get PEL Log Via BMC CLI
115 ${pel_id}= Get From List ${pel_ids} -1
116 ${pel_output}= Peltool -i ${pel_id}
117 ${pel_sections}= Get Dictionary Keys ${pel_output}
118
119 List Should Contain Sub List ${pel_sections} ${mandatory_pel_fileds}
120
121
Rahul Maheshwarif575c902020-02-26 04:38:40 -0600122Verify PEL Log Persistence After BMC Reboot
123 [Documentation] Verify PEL log persistence after BMC reboot.
124 [Tags] Verify_PEL_Log_Persistence_After_BMC_Reboot
125
126 Create Test PEL Log
127 ${pel_before_reboot}= Get PEL Log Via BMC CLI
128
129 Redfish OBMC Reboot (off)
130 ${pel_after_reboot}= Get PEL Log Via BMC CLI
131
132 List Should Contain Sub List ${pel_after_reboot} ${pel_before_reboot}
Rahul Maheshwarifaa5d202020-02-24 23:32:57 -0600133
134
Rahul Maheshwari58b99fc2020-03-03 00:05:55 -0600135Verify PEL ID Numbering
136 [Documentation] Verify PEL ID numbering.
137 [Tags] Verify_PEL_ID_Numbering
138
139 Redfish Purge Event Log
140 Create Test PEL Log
141 Create Test PEL Log
142
143 ${pel_ids}= Get PEL Log Via BMC CLI
144
145 # Example of PEL IDs from PEL logs.
146 # [0x50000012]: <--- First PEL ID
147 # [CreatorID]: BMC
148 # [CompID]: 0x1000
149 # [PLID]: 0x50000012
150 # [Subsystem]: BMC Firmware
151 # [Message]: An application had an internal failure
152 # [SRC]: BD8D1002
153 # [Commit Time]: 03/02/2020 09:35:15
154 # [Sev]: Unrecoverable Error
155 #
156 # [0x50000013]: <--- Second PEL ID
157 # [CreatorID]: BMC
158 # [CompID]: 0x1000
159 # [PLID]: 0x50000013
160 # [Subsystem]: BMC Firmware
161 # [Message]: An application had an internal failure
162 # [SRC]: BD8D1002
163 # [Commit Time]: 03/02/2020 09:35:15
164 # [Sev]: Unrecoverable Error
165
166 Should Be True ${pel_ids[1]} == ${pel_ids[0]}+1
167
Rahul Maheshwari371e4f82020-04-06 22:53:52 -0500168Verify Machine Type Model And Serial Number
169 [Documentation] Verify machine type model and serial number from PEL.
170 [Tags] Verify_Machine_Type_Model_And_Serial_Number
171
172 Create Test PEL Log
173
174 ${pel_ids}= Get PEL Log Via BMC CLI
175 ${id}= Get From List ${pel_ids} -1
Rahul Maheshwari56dba362020-05-12 00:59:48 -0500176
Rahul Maheshwari371e4f82020-04-06 22:53:52 -0500177 ${pel_serial_number}= Get PEL Field Value ${id} Failing MTMS Serial Number
Rahul Maheshwari56dba362020-05-12 00:59:48 -0500178 ${pel_serial_number}= Replace String Using Regexp ${pel_serial_number} ^0+ ${EMPTY}
Rahul Maheshwari371e4f82020-04-06 22:53:52 -0500179 ${pel_machine_type_model}= Get PEL Field Value ${id} Failing MTMS Machine Type Model
Rahul Maheshwari56dba362020-05-12 00:59:48 -0500180 ${pel_machine_type_model}= Replace String Using Regexp ${pel_machine_type_model} ^0+ ${EMPTY}
Rahul Maheshwari371e4f82020-04-06 22:53:52 -0500181
182 # Example of "Machine Type Model" and "Serial Number" fields value from "Failing MTMS" section of PEL.
183 # [Failing MTMS]:
184 # [Created by]: 0x2000
185 # [Machine Type Model]: 1234-ABC <---- Machine type
186 # [Section Version]: 1
187 # [Serial Number]: ABCDEFG <---- Serial number
188 # [Sub-section type]: 0
189
190 ${redfish_machine_model}= Redfish.Get Attribute /redfish/v1/Systems/system/ Model
Rahul Maheshwari56dba362020-05-12 00:59:48 -0500191 ${redfish_machine_model}= Replace String Using Regexp ${redfish_machine_model} ^0+ ${EMPTY}
Rahul Maheshwari371e4f82020-04-06 22:53:52 -0500192 ${redfish_serial_number}= Redfish.Get Attribute /redfish/v1/Systems/system/ SerialNumber
Rahul Maheshwari56dba362020-05-12 00:59:48 -0500193 ${redfish_serial_number}= Replace String Using Regexp ${redfish_serial_number} ^0+ ${EMPTY}
Rahul Maheshwari371e4f82020-04-06 22:53:52 -0500194
195 Valid Value pel_machine_type_model ['${redfish_machine_model}']
196 Valid Value pel_serial_number ['${redfish_serial_number}']
197
198 # Check "Machine Type Model" and "Serial Number" fields value from "Extended User Header" section of PEL.
199 ${pel_machine_type_model}= Get PEL Field Value ${id} Extended User Header Reporting Machine Type
Rahul Maheshwari56dba362020-05-12 00:59:48 -0500200 ${pel_machine_type_model}= Replace String Using Regexp ${pel_machine_type_model} ^0+ ${EMPTY}
Rahul Maheshwari371e4f82020-04-06 22:53:52 -0500201 ${pel_serial_number}= Get PEL Field Value ${id} Extended User Header Reporting Serial Number
Rahul Maheshwari56dba362020-05-12 00:59:48 -0500202 ${pel_serial_number}= Replace String Using Regexp ${pel_serial_number} ^0+ ${EMPTY}
Rahul Maheshwari371e4f82020-04-06 22:53:52 -0500203
204 Valid Value pel_machine_type_model ['${redfish_machine_model}']
205 Valid Value pel_serial_number ['${redfish_serial_number}']
206
Rahul Maheshwari58b99fc2020-03-03 00:05:55 -0600207
Rahul Maheshwari1bea6cc2020-03-31 00:53:14 -0500208Verify Host Off State From PEL
209 [Documentation] Verify Host off state from PEL.
210 [Tags] Verify_Host_Off_State_From_PEL
211
212 Redfish Power Off stack_mode=skip
213 Create Test PEL Log
214
215 ${pel_ids}= Get PEL Log Via BMC CLI
216 ${id}= Get From List ${pel_ids} -1
217 ${pel_host_state}= Get PEL Field Value ${id} User Data HostState
218
219 Valid Value pel_host_state ['Off']
220
221
222Verify BMC Version From PEL
223 [Documentation] Verify BMC Version from PEL.
224 [Tags] Verify_BMC_Version_From_PEL
225
226 Create Test PEL Log
227
228 ${pel_ids}= Get PEL Log Via BMC CLI
229 ${id}= Get From List ${pel_ids} -1
230 ${pel_bmc_version}= Get PEL Field Value ${id} User Data BMC Version ID
231
232 ${bmc_version}= Get BMC Version
233 Valid Value bmc_version ['${bmc_version}']
234
235
Rahul Maheshwari8f5256f2020-02-26 23:53:55 -0600236Verify PEL Log After Host Poweron
237 [Documentation] Verify PEL log generation while booting host.
238 [Tags] Verify_PEL_Log_After_Host_Poweron
239
240 Redfish Power Off stack_mode=skip
241 Redfish Purge Event Log
242 Redfish Power On stack_mode=skip
243
244 ${pel_informational_error}= Get PEL Log IDs User Header Event Severity Informational Event
245 ${pel_bmc_created_error}= Get PEL Log IDs Private Header Creator Subsystem BMC
246
247 # Get BMC created non-infomational error.
248 ${pel_bmc_error}= Subtract Lists ${pel_bmc_created_error} ${pel_informational_error}
249
250 Should Be Empty ${pel_bmc_error} msg=Unexpected error log generated during Host poweron.
251
252
Rahul Maheshwari089615b2020-04-02 01:01:38 -0500253Verify BMC Event Log ID
254 [Documentation] Verify BMC Event Log ID from PEL.
255 [Tags] Verify_BMC_Event_Log_ID
256
257 Redfish Purge Event Log
258 Create Test PEL Log
259
260 ${pel_ids}= Get PEL Log Via BMC CLI
261 ${pel_bmc_event_log_id}= Get PEL Field Value ${pel_ids[0]} Private Header BMC Event Log Id
262
263 # Example "BMC Event Log Id" field value from "Private Header" section of PEL.
264 # [Private Header]:
265 # [Created at]: 08/24/1928 12:04:06
266 # [Created by]: 0x584D
267 # [Sub-section type]: 0
268 # [Entry Id]: 0x50000BB7
269 # [Platform Log Id]: 0x8200061D
270 # [CSSVER]:
271 # [Section Version]: 1
272 # [Creator Subsystem]: PHYP
273 # [BMC Event Log Id]: 341 <---- BMC event log id value
274 # [Committed at]: 03/25/1920 12:06:22
275
276 ${redfish_event_logs}= Redfish.Get Properties /redfish/v1/Systems/system/LogServices/EventLog/Entries
277
278 # Example of redfish_event_logs output:
279 # redfish_event_logs:
280 # [@odata.id]: /redfish/v1/Systems/system/LogServices/EventLog/Entries
281 # [Name]: System Event Log Entries
282 # [Members@odata.count]: 1
283 # [@odata.type]: #LogEntryCollection.LogEntryCollection
284 # [Description]: Collection of System Event Log Entries
285 # [Members]:
286 # [0]:
287 # [@odata.id]: /redfish/v1/Systems/system/LogServices/EventLog/Entries/235
288 # [Name]: System Event Log Entry
289 # [Severity]: Critical
290 # [EntryType]: Event
291 # [Created]: 2020-04-02T07:25:13+00:00
292 # [@odata.type]: #LogEntry.v1_5_1.LogEntry
293 # [Id]: 235 <----- Event log ID
294 # [Message]: xyz.openbmc_project.Common.Error.InternalFailure
295
296 Valid Value pel_bmc_event_log_id ['${redfish_event_logs['Members'][0]['Id']}']
297
298
Rahul Maheshwari97d7ab82020-08-04 00:01:42 -0500299Verify FRU Callout
300 [Documentation] Verify FRU callout entries from PEL log.
301 [Tags] Verify_FRU_Callout
302
303 Create Test PEL Log FRU Callout
304
305 ${pel_ids}= Get PEL Log Via BMC CLI
306 ${id}= Get From List ${pel_ids} -1
307 ${pel_callout_section}= Get PEL Field Value ${id} Primary SRC Callout Section
308
309 # Example of PEL Callout Section from "peltool -i <id>" command.
310 # [Callouts]:
311 # [0]:
312 # [FRU Type]: Normal Hardware FRU
313 # [Priority]: Mandatory, replace all with this type as a unit
314 # [Location Code]: U78DA.ND1.1234567-P0
315 # [Part Number]: F191014
316 # [CCIN]: 2E2D
317 # [Serial Number]: YL2E2D010000
318 # [Callout Count]: 1
319
320 Valid Value pel_callout_section['Callout Count'] ['1']
321 Valid Value pel_callout_section['Callouts'][0]['FRU Type'] ['Normal Hardware FRU']
322 Should Contain ${pel_callout_section['Callouts'][0]['Priority']} Mandatory
323
324 # Verify Location Code field of PEL callout with motherboard's Location Code.
325 ${busctl_output}= BMC Execute Command ${CMD_INVENTORY_PREFIX} com.ibm.ipzvpd.Location LocationCode
326 Should Be Equal ${pel_callout_section['Callouts'][0]['Location Code']}
327 ... ${busctl_output[0].split('"')[1].strip('"')}
328
329 # TODO: Compare CCIN and part number fields of PEL callout with Redfish or busctl output.
330 Should Match Regexp ${pel_callout_section['Callouts'][0]['CCIN']} [a-zA-Z0-9]
331 Should Match Regexp ${pel_callout_section['Callouts'][0]['Part Number']} [a-zA-Z0-9]
332
333 # Verify Serial Number field of PEL callout with motherboard's Serial Number.
334 ${busctl_output}= BMC Execute Command
335 ... ${CMD_INVENTORY_PREFIX} xyz.openbmc_project.Inventory.Decorator.Asset SerialNumber
336 Should Be Equal ${pel_callout_section['Callouts'][0]['Serial Number']}
337 ... ${busctl_output[0].split('"')[1].strip('"')}
338
339
340Verify Procedure And Symbolic FRU Callout
341 [Documentation] Verify procedure and symbolic FRU callout from PEL log.
342 [Tags] Verify_Procedure_And_Symbolic_FRU_Callout
343
344 Create Test PEL Log Procedure And Symbolic FRU Callout
345
346 ${pel_ids}= Get PEL Log Via BMC CLI
347 ${id}= Get From List ${pel_ids} -1
348 ${pel_callout_section}= Get PEL Field Value ${id} Primary SRC Callout Section
349
350 # Example of PEL Callout Section from "peltool -i <id>" command.
351 # [Callouts]:
352 # [0]:
353 # [Priority]: Mandatory, replace all with this type as a unit
354 # [Procedure Number]: BMCSP02
355 # [FRU Type]: Maintenance Procedure Required
356 # [1]:
357 # [Priority]: Medium Priority
358 # [Part Number]: SVCDOCS
359 # [FRU Type]: Symbolic FRU
360 # [Callout Count]: 2
361
362 Valid Value pel_callout_section['Callout Count'] ['2']
363
364 # Verify procedural callout info.
365
366 Valid Value pel_callout_section['Callouts'][0]['FRU Type'] ['Maintenance Procedure Required']
367 Should Contain ${pel_callout_section['Callouts'][0]['Priority']} Mandatory
368 # Verify if "Procedure Number" field of PEL has an alphanumeric value.
Rahul Maheshwari6acf0ee2020-10-28 05:37:01 -0500369 Should Match Regexp ${pel_callout_section['Callouts'][0]['Procedure']} [a-zA-Z0-9]
Rahul Maheshwari97d7ab82020-08-04 00:01:42 -0500370
371 # Verify procedural callout info.
372
373 Valid Value pel_callout_section['Callouts'][1]['FRU Type'] ['Symbolic FRU']
374 Should Contain ${pel_callout_section['Callouts'][1]['Priority']} Medium Priority
375 # Verify if "Part Number" field of Symbolic FRU has an alphanumeric value.
376 Should Match Regexp ${pel_callout_section['Callouts'][1]['Part Number']} [a-zA-Z0-9]
377
378
Rahul Maheshwarif4a01aa2020-08-24 23:22:59 -0500379Verify PEL Log Entry For Event Log
380 [Documentation] Create an event log and verify PEL log entry in BMC for the same.
381 [Tags] Verify_PEL_Log_Entry_For_Event_Log
382
383 Redfish Purge Event Log
384 # Create an internal failure error log.
385 BMC Execute Command ${CMD_INTERNAL_FAILURE}
386
387 ${elog_entry}= Get Event Logs
388 # Example of Redfish event logs:
389 # elog_entry:
390 # [0]:
391 # [Message]: xyz.openbmc_project.Common.Error.InternalFailure
392 # [Created]: 2020-04-20T01:55:22+00:00
393 # [Id]: 1
394 # [@odata.id]: /redfish/v1/Systems/system/LogServices/EventLog/Entries/1
395 # [@odata.type]: #LogEntry.v1_4_0.LogEntry
396 # [EntryType]: Event
397 # [Severity]: Critical
398 # [Name]: System Event Log Entry
399
400 ${redfish_log_time}= Convert Date ${elog_entry[0]["Created"]} epoch
401
402 ${pel_records}= Peltool -l
403 # Example output from 'Peltool -l':
404 # pel_records:
405 # [0x50000023]:
406 # [SRC]: BD8D1002
407 # [CreatorID]: BMC
408 # [Message]: An application had an internal failure
409 # [CompID]: 0x1000
410 # [PLID]: 0x50000023
411 # [Commit Time]: 04/20/2020 01:55:22
412 # [Subsystem]: BMC Firmware
413 # [Sev]: Unrecoverable Error
414
415 ${ids}= Get Dictionary Keys ${pel_records}
416 ${id}= Get From List ${ids} 0
417 ${pel_log_time}= Convert Date ${pel_records['${id}']['Commit Time']} epoch
418 ... date_format=%m/%d/%Y %H:%M:%S
419
420 # Verify that both Redfish event and PEL has log entry for internal error with same time stamp.
421 Should Contain Any ${pel_records['${id}']['Message']} internal failure ignore_case=True
422 Should Contain Any ${elog_entry[0]['Message']} InternalFailure ignore_case=True
423
424 Should Be Equal ${redfish_log_time} ${pel_log_time}
425
426
Rahul Maheshwari326d0642020-04-07 06:13:38 -0500427Verify Delete All PEL
428 [Documentation] Verify deleting all PEL logs.
429 [Tags] Verify_Delete_All_PEL
430
431 Create Test PEL Log
432 Create Test PEL Log
433 Peltool --delete-all False
434
435 ${pel_ids}= Get PEL Log Via BMC CLI
436 Should Be Empty ${pel_ids}
437
438
manashsarma4e935382020-10-16 12:00:53 -0500439Verify Informational Error Log
440 [Documentation] Create an informational error log and verify.
441 [Tags] Verify_Informational_Error_Log
442
443 Redfish Purge Event Log
444 # Create an informational error log.
445 BMC Execute Command ${CMD_INFORMATIONAL_ERROR}
446 ${pel_records}= Peltool -lfh
447
448 # An example of information error log data:
449 # {
450 # "0x500006A0": {
451 # "SRC": "BD8D1002",
452 # "Message": "An application had an internal failure",
453 # "PLID": "0x500006A0",
454 # "CreatorID": "BMC",
455 # "Subsystem": "BMC Firmware",
456 # "Commit Time": "10/14/2020 11:41:38",
457 # "Sev": "Informational Event",
458 # "CompID": "0x1000"
459 # }
460 # }
461
462 ${ids}= Get Dictionary Keys ${pel_records}
463 ${id}= Get From List ${ids} 0
464 Should Contain ${pel_records['${id}']['Sev']} Informational
465
466
manashsarma15fe5632020-10-18 03:42:58 -0500467Verify Predictable Error Log
468 [Documentation] Create a predictive error and verify.
469 [Tags] Verify_Predictable_Error_Log
470
471 # Create a predictable error log.
472 BMC Execute Command ${CMD_PREDICTIVE_ERROR}
473 ${pel_records}= Peltool -l
474
475 # An example of predictive error log data:
476 # {
477 # "0x5000069E": {
478 # "SRC": "BD8D1002",
479 # "Message": "An application had an internal failure",
480 # "PLID": "0x5000069E",
481 # "CreatorID": "BMC",
482 # "Subsystem": "BMC Firmware",
483 # "Commit Time": "10/14/2020 11:40:07",
484 # "Sev": "Predictive Error",
485 # "CompID": "0x1000"
486 # }
487 # }
488
489 ${pel_ids}= Get PEL Log Via BMC CLI
490 ${id}= Get From List ${pel_ids} -1
491 Should Contain ${pel_records['${id}']['Sev']} Predictive
492
493
494Verify Unrecoverable Error Log
495 [Documentation] Create an unrecoverable error and verify.
496 [Tags] Verify_Unrecoverable_Error_Log
497
498 # Create an internal failure error log.
499 BMC Execute Command ${CMD_UNRECOVERABLE_ERROR}
500 ${pel_records}= Peltool -l
501
502 # An example of unrecoverable error log data:
503 # {
504 # "0x50000CC5": {
505 # "SRC": "BD8D1002",
506 # "Message": "An application had an internal failure",
507 # "PLID": "0x50000CC5",
508 # "CreatorID": "BMC",
509 # "Subsystem": "BMC Firmware",
510 # "Commit Time": "04/01/2020 16:44:55",
511 # "Sev": "Unrecoverable Error",
512 # "CompID": "0x1000"
513 # }
514 # }
515
516 ${pel_ids}= Get PEL Log Via BMC CLI
517 ${id}= Get From List ${pel_ids} -1
518 Should Contain ${pel_records['${id}']['Sev']} Unrecoverable
519
520
Rahul Maheshwarifaa5d202020-02-24 23:32:57 -0600521*** Keywords ***
522
523Create Test PEL Log
524 [Documentation] Generate test PEL log.
Rahul Maheshwari97d7ab82020-08-04 00:01:42 -0500525 [Arguments] ${pel_type}=Internal Failure
526
527 # Description of argument(s):
528 # pel_type The PEL type (e.g. Internal Failure, FRU Callout, Procedural Callout).
Rahul Maheshwarifaa5d202020-02-24 23:32:57 -0600529
530 # Test PEL log entry example:
531 # {
532 # "0x5000002D": {
533 # "SRC": "BD8D1002",
534 # "Message": "An application had an internal failure",
535 # "PLID": "0x5000002D",
536 # "CreatorID": "BMC",
537 # "Subsystem": "BMC Firmware",
538 # "Commit Time": "02/25/2020 04:47:09",
539 # "Sev": "Unrecoverable Error",
540 # "CompID": "0x1000"
541 # }
542 # }
543
Rahul Maheshwari97d7ab82020-08-04 00:01:42 -0500544 Run Keyword If '${pel_type}' == 'Internal Failure'
545 ... BMC Execute Command ${CMD_INTERNAL_FAILURE}
546 ... ELSE IF '${pel_type}' == 'FRU Callout'
547 ... BMC Execute Command ${CMD_FRU_CALLOUT}
548 ... ELSE IF '${pel_type}' == 'Procedure And Symbolic FRU Callout'
549 ... BMC Execute Command ${CMD_PROCEDURAL_SYMBOLIC_FRU_CALLOUT}
Rahul Maheshwarifaa5d202020-02-24 23:32:57 -0600550
551
Rahul Maheshwari8f5256f2020-02-26 23:53:55 -0600552Get PEL Log IDs
553 [Documentation] Returns the list of PEL log IDs which contains given field's value.
554 [Arguments] ${pel_section} ${pel_field} @{pel_field_value}
555
556 # Description of argument(s):
557 # pel_section The section of PEL (e.g. Private Header, User Header).
558 # pel_field The PEL field (e.g. Event Severity, Event Type).
559 # pel_field_value The list of PEL's field value (e.g. Unrecoverable Error).
560
561 ${pel_ids}= Get PEL Log Via BMC CLI
562 @{pel_id_list}= Create List
563
564 FOR ${id} IN @{pel_ids}
565 ${pel_output}= Peltool -i ${id}
566 # Example of PEL output from "peltool -i <id>" command.
567 # [Private Header]:
568 # [Created at]: 08/24/1928 12:04:06
569 # [Created by]: 0x584D
570 # [Sub-section type]: 0
571 # [Entry Id]: 0x50000BB7
572 # [Platform Log Id]: 0x8200061D
573 # [CSSVER]:
574 # [Section Version]: 1
575 # [Creator Subsystem]: PHYP
576 # [BMC Event Log Id]: 341
577 # [Committed at]: 03/25/1920 12:06:22
578 # [User Header]:
579 # [Log Committed by]: 0x4552
580 # [Action Flags]:
581 # [0]: Report Externally
582 # [Subsystem]: I/O Subsystem
583 # [Event Type]: Miscellaneous, Informational Only
584 # [Sub-section type]: 0
585 # [Event Scope]: Entire Platform
586 # [Event Severity]: Informational Event
587 # [Host Transmission]: Not Sent
588 # [Section Version]: 1
589
590 ${pel_section_output}= Get From Dictionary ${pel_output} ${pel_section}
591 ${pel_field_output}= Get From Dictionary ${pel_section_output} ${pel_field}
592 Run Keyword If '${pel_field_output}' in @{pel_field_value} Append To List ${pel_id_list} ${id}
593 END
594 Sort List ${pel_id_list}
595
596 [Return] ${pel_id_list}
597
598
Rahul Maheshwarif575c902020-02-26 04:38:40 -0600599Get PEL Log Via BMC CLI
600 [Documentation] Returns the list of PEL IDs using BMC CLI.
Rahul Maheshwarifaa5d202020-02-24 23:32:57 -0600601
602 ${pel_records}= Peltool -l
Rahul Maheshwarif575c902020-02-26 04:38:40 -0600603 ${ids}= Get Dictionary Keys ${pel_records}
Rahul Maheshwari1cffc4b2020-04-02 02:58:16 -0500604 Sort List ${ids}
Rahul Maheshwarifaa5d202020-02-24 23:32:57 -0600605
Rahul Maheshwarif575c902020-02-26 04:38:40 -0600606 [Return] ${ids}
Rahul Maheshwari60b58a82020-04-02 02:40:19 -0500607
608
609Get PEL Field Value
610 [Documentation] Returns the value of given PEL's field.
611 [Arguments] ${pel_id} ${pel_section} ${pel_field}
612
613 # Description of argument(s):
614 # pel_id The ID of PEL (e.g. 0x5000002D, 0x5000002E).
615 # pel_section The section of PEL (e.g. Private Header, User Header)
616 # pel_field The PEL field (e.g. Event Severity, Event Type).
617
618 ${pel_output}= Peltool -i ${pel_id}
619
620 # Example of PEL output from "peltool -i <id>" command.
621 # [Private Header]:
622 # [Created at]: 08/24/1928 12:04:06
623 # [Created by]: 0x584D
624 # [Sub-section type]: 0
625 # [Entry Id]: 0x50000BB7
626 # [Platform Log Id]: 0x8200061D
627 # [CSSVER]:
628 # [Section Version]: 1
629 # [Creator Subsystem]: PHYP
630 # [BMC Event Log Id]: 341
631 # [Committed at]: 03/25/1920 12:06:22
632 # [User Header]:
633 # [Log Committed by]: 0x4552
634 # [Action Flags]:
635 # [0]: Report Externally
636 # [Subsystem]: I/O Subsystem
637 # [Event Type]: Miscellaneous, Informational Only
638 # [Sub-section type]: 0
639 # [Event Scope]: Entire Platform
640 # [Event Severity]: Informational Event
641 # [Host Transmission]: Not Sent
642 # [Section Version]: 1
643
644 ${pel_section_output}= Get From Dictionary ${pel_output} ${pel_section}
645 ${pel_field_output}= Get From Dictionary ${pel_section_output} ${pel_field}
646
647 [Return] ${pel_field_output}