1*** Settings ***
2Documentation   This suite tests Platform Event Log (PEL) functionality of OpenBMC.
3
4Library         ../../lib/pel_utils.py
5Variables       ../../data/pel_variables.py
6Resource        ../../lib/list_utils.robot
7Resource        ../../lib/logging_utils.robot
8Resource        ../../lib/openbmc_ffdc.robot
9
10Test Setup      Redfish.Login
11Test Teardown   Run Keywords  Redfish.Logout  AND  FFDC On Test Case Fail
12
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
19
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
29${CMD_INVENTORY_PREFIX}  busctl get-property xyz.openbmc_project.Inventory.Manager
30...  /xyz/openbmc_project/inventory/system/chassis/motherboard
31
32@{mandatory_pel_fileds}   Private Header  User Header  Primary SRC  Extended User Header  Failing MTMS
33
34
35*** Test Cases ***
36
37Create Test PEL Log And Verify
38    [Documentation]  Create PEL log using busctl command and verify via peltool.
39    [Tags]  Create_Test_PEL_Log_And_Verify
40
41    Redfish Purge Event Log
42    Create Test PEL Log
43    ${pel_id}=  Get PEL Log Via BMC CLI
44    Should Not Be Empty  ${pel_id}  msg=System PEL log entry is empty.
45
46
47Verify PEL Log Details
48    [Documentation]  Verify PEL log details via peltool.
49    [Tags]  Verify_PEL_Log_Details
50
51    Redfish Purge Event Log
52
53    ${bmc_time1}=  CLI Get BMC DateTime
54    Create Test PEL Log
55    ${bmc_time2}=  CLI Get BMC DateTime
56
57    ${pel_records}=  Peltool  -l
58
59    # Example output from 'Peltool  -l':
60    # pel_records:
61    # [0x50000012]:
62    #   [CreatorID]:                  BMC
63    #   [CompID]:                     0x1000
64    #   [PLID]:                       0x50000012
65    #   [Subsystem]:                  BMC Firmware
66    #   [Message]:                    An application had an internal failure
67    #   [SRC]:                        BD8D1002
68    #   [Commit Time]:                03/02/2020  09:35:15
69    #   [Sev]:                        Unrecoverable Error
70
71    ${ids}=  Get Dictionary Keys  ${pel_records}
72    ${id}=  Get From List  ${ids}  0
73
74    @{pel_fields}=  Create List  CreatorID  Subsystem  Message  Sev
75    FOR  ${field}  IN  @{pel_fields}
76      Valid Value  pel_records['${id}']['${field}']  ['${PEL_DETAILS['${field}']}']
77    END
78
79    Valid Value  pel_records['${id}']['PLID']  ['${id}']
80
81    # Verify if "CompID" and "SRC" fields of PEL has alphanumeric value.
82    Should Match Regexp  ${pel_records['${id}']['CompID']}  [a-zA-Z0-9]
83    Should Match Regexp  ${pel_records['${id}']['SRC']}  [a-zA-Z0-9]
84
85    ${pel_date_time}=  Convert Date  ${pel_records['${id}']['Commit Time']}
86    ...  date_format=%m/%d/%Y %H:%M:%S  exclude_millis=yes
87
88    # Convert BMC and PEL time to epoch time before comparing.
89    ${bmc_time1_epoch}=  Convert Date  ${bmc_time1}  epoch
90    ${pel_time_epoch}=  Convert Date  ${pel_date_time}  epoch
91    ${bmc_time2_epoch}=  Convert Date  ${bmc_time2}  epoch
92
93    Should Be True  ${bmc_time1_epoch} <= ${pel_time_epoch} <= ${bmc_time2_epoch}
94
95
96Verify Mandatory Sections Of Error Log PEL
97    [Documentation]  Verify mandatory sections of error log PEL.
98    [Tags]  Verify_Mandatory_Sections_Of_Error_Log_PEL
99
100    Create Test PEL Log
101
102    ${pel_ids}=  Get PEL Log Via BMC CLI
103    ${pel_id}=  Get From List  ${pel_ids}  -1
104    ${pel_output}=  Peltool  -i ${pel_id}
105    ${pel_sections}=  Get Dictionary Keys  ${pel_output}
106
107    List Should Contain Sub List  ${pel_sections}  ${mandatory_pel_fileds}
108
109
110Verify PEL Log Persistence After BMC Reboot
111    [Documentation]  Verify PEL log persistence after BMC reboot.
112    [Tags]  Verify_PEL_Log_Persistence_After_BMC_Reboot
113
114    Create Test PEL Log
115    ${pel_before_reboot}=  Get PEL Log Via BMC CLI
116
117    Redfish OBMC Reboot (off)
118    ${pel_after_reboot}=  Get PEL Log Via BMC CLI
119
120    List Should Contain Sub List  ${pel_after_reboot}  ${pel_before_reboot}
121
122
123Verify PEL ID Numbering
124    [Documentation]  Verify PEL ID numbering.
125    [Tags]  Verify_PEL_ID_Numbering
126
127    Redfish Purge Event Log
128    Create Test PEL Log
129    Create Test PEL Log
130
131    ${pel_ids}=  Get PEL Log Via BMC CLI
132
133    # Example of PEL IDs from PEL logs.
134    #  [0x50000012]:             <--- First PEL ID
135    #    [CreatorID]:                  BMC
136    #    [CompID]:                     0x1000
137    #    [PLID]:                       0x50000012
138    #    [Subsystem]:                  BMC Firmware
139    #    [Message]:                    An application had an internal failure
140    #    [SRC]:                        BD8D1002
141    #    [Commit Time]:                03/02/2020  09:35:15
142    #    [Sev]:                        Unrecoverable Error
143    #
144    #  [0x50000013]:             <--- Second PEL ID
145    #    [CreatorID]:                  BMC
146    #    [CompID]:                     0x1000
147    #    [PLID]:                       0x50000013
148    #    [Subsystem]:                  BMC Firmware
149    #    [Message]:                    An application had an internal failure
150    #    [SRC]:                        BD8D1002
151    #    [Commit Time]:                03/02/2020  09:35:15
152    #    [Sev]:                        Unrecoverable Error
153
154    Should Be True  ${pel_ids[1]} == ${pel_ids[0]}+1
155
156Verify Machine Type Model And Serial Number
157    [Documentation]  Verify machine type model and serial number from PEL.
158    [Tags]  Verify_Machine_Type_Model_And_Serial_Number
159
160    Create Test PEL Log
161
162    ${pel_ids}=  Get PEL Log Via BMC CLI
163    ${id}=  Get From List  ${pel_ids}  -1
164
165    ${pel_serial_number}=  Get PEL Field Value  ${id}  Failing MTMS  Serial Number
166    ${pel_serial_number}=  Replace String Using Regexp  ${pel_serial_number}  ^0+  ${EMPTY}
167    ${pel_machine_type_model}=  Get PEL Field Value  ${id}  Failing MTMS  Machine Type Model
168    ${pel_machine_type_model}=  Replace String Using Regexp  ${pel_machine_type_model}  ^0+  ${EMPTY}
169
170    # Example of "Machine Type Model" and "Serial Number" fields value from "Failing MTMS" section of PEL.
171    #  [Failing MTMS]:
172    #    [Created by]:                                 0x2000
173    #    [Machine Type Model]:                         1234-ABC   <---- Machine type
174    #    [Section Version]:                            1
175    #    [Serial Number]:                              ABCDEFG    <---- Serial number
176    #    [Sub-section type]:                           0
177
178    ${redfish_machine_model}=  Redfish.Get Attribute  /redfish/v1/Systems/system/  Model
179    ${redfish_machine_model}=  Replace String Using Regexp  ${redfish_machine_model}  ^0+  ${EMPTY}
180    ${redfish_serial_number}=  Redfish.Get Attribute  /redfish/v1/Systems/system/  SerialNumber
181    ${redfish_serial_number}=  Replace String Using Regexp  ${redfish_serial_number}  ^0+  ${EMPTY}
182
183    Valid Value  pel_machine_type_model  ['${redfish_machine_model}']
184    Valid Value  pel_serial_number  ['${redfish_serial_number}']
185
186    # Check "Machine Type Model" and "Serial Number" fields value from "Extended User Header" section of PEL.
187    ${pel_machine_type_model}=  Get PEL Field Value  ${id}  Extended User Header  Reporting Machine Type
188    ${pel_machine_type_model}=  Replace String Using Regexp  ${pel_machine_type_model}  ^0+  ${EMPTY}
189    ${pel_serial_number}=  Get PEL Field Value  ${id}  Extended User Header  Reporting Serial Number
190    ${pel_serial_number}=  Replace String Using Regexp  ${pel_serial_number}  ^0+  ${EMPTY}
191
192    Valid Value  pel_machine_type_model  ['${redfish_machine_model}']
193    Valid Value  pel_serial_number  ['${redfish_serial_number}']
194
195
196Verify Host Off State From PEL
197    [Documentation]  Verify Host off state from PEL.
198    [Tags]  Verify_Host_Off_State_From_PEL
199
200    Redfish Power Off  stack_mode=skip
201    Create Test PEL Log
202
203    ${pel_ids}=  Get PEL Log Via BMC CLI
204    ${id}=  Get From List  ${pel_ids}  -1
205    ${pel_host_state}=  Get PEL Field Value  ${id}  User Data  HostState
206
207    Valid Value  pel_host_state  ['Off']
208
209
210Verify BMC Version From PEL
211    [Documentation]  Verify BMC Version from PEL.
212    [Tags]  Verify_BMC_Version_From_PEL
213
214    Create Test PEL Log
215
216    ${pel_ids}=  Get PEL Log Via BMC CLI
217    ${id}=  Get From List  ${pel_ids}  -1
218    ${pel_bmc_version}=  Get PEL Field Value  ${id}  User Data  BMC Version ID
219
220    ${bmc_version}=  Get BMC Version
221    Valid Value  bmc_version  ['${bmc_version}']
222
223
224Verify PEL Log After Host Poweron
225    [Documentation]  Verify PEL log generation while booting host.
226    [Tags]  Verify_PEL_Log_After_Host_Poweron
227
228    Redfish Power Off  stack_mode=skip
229    Redfish Purge Event Log
230    Redfish Power On  stack_mode=skip
231
232    ${pel_informational_error}=  Get PEL Log IDs  User Header  Event Severity  Informational Event
233    ${pel_bmc_created_error}=  Get PEL Log IDs  Private Header  Creator Subsystem  BMC
234
235    # Get BMC created non-infomational error.
236    ${pel_bmc_error}=  Subtract Lists  ${pel_bmc_created_error}  ${pel_informational_error}
237
238    Should Be Empty  ${pel_bmc_error}  msg=Unexpected error log generated during Host poweron.
239
240
241Verify BMC Event Log ID
242    [Documentation]  Verify BMC Event Log ID from PEL.
243    [Tags]  Verify_BMC_Event_Log_ID
244
245    Redfish Purge Event Log
246    Create Test PEL Log
247
248    ${pel_ids}=  Get PEL Log Via BMC CLI
249    ${pel_bmc_event_log_id}=  Get PEL Field Value  ${pel_ids[0]}  Private Header  BMC Event Log Id
250
251    # Example "BMC Event Log Id" field value from "Private Header" section of PEL.
252    #  [Private Header]:
253    #    [Created at]:                 08/24/1928 12:04:06
254    #    [Created by]:                 0x584D
255    #    [Sub-section type]:           0
256    #    [Entry Id]:                   0x50000BB7
257    #    [Platform Log Id]:            0x8200061D
258    #    [CSSVER]:
259    #    [Section Version]:            1
260    #    [Creator Subsystem]:          PHYP
261    #    [BMC Event Log Id]:           341      <---- BMC event log id value
262    #    [Committed at]:               03/25/1920 12:06:22
263
264    ${redfish_event_logs}=  Redfish.Get Properties  /redfish/v1/Systems/system/LogServices/EventLog/Entries
265
266    # Example of redfish_event_logs output:
267    # redfish_event_logs:
268    #  [@odata.id]:                    /redfish/v1/Systems/system/LogServices/EventLog/Entries
269    #  [Name]:                         System Event Log Entries
270    #  [Members@odata.count]:          1
271    #  [@odata.type]:                  #LogEntryCollection.LogEntryCollection
272    #  [Description]:                  Collection of System Event Log Entries
273    #  [Members]:
274    #    [0]:
275    #      [@odata.id]:                /redfish/v1/Systems/system/LogServices/EventLog/Entries/235
276    #      [Name]:                     System Event Log Entry
277    #      [Severity]:                 Critical
278    #      [EntryType]:                Event
279    #      [Created]:                  2020-04-02T07:25:13+00:00
280    #      [@odata.type]:              #LogEntry.v1_5_1.LogEntry
281    #      [Id]:                       235          <----- Event log ID
282    #      [Message]:                  xyz.openbmc_project.Common.Error.InternalFailure
283
284    Valid Value  pel_bmc_event_log_id  ['${redfish_event_logs['Members'][0]['Id']}']
285
286
287Verify FRU Callout
288    [Documentation]  Verify FRU callout entries from PEL log.
289    [Tags]  Verify_FRU_Callout
290
291    Create Test PEL Log  FRU Callout
292
293    ${pel_ids}=  Get PEL Log Via BMC CLI
294    ${id}=  Get From List  ${pel_ids}  -1
295    ${pel_callout_section}=  Get PEL Field Value  ${id}  Primary SRC  Callout Section
296
297    # Example of PEL Callout Section from "peltool -i <id>" command.
298    #  [Callouts]:
299    #    [0]:
300    #      [FRU Type]:                 Normal Hardware FRU
301    #      [Priority]:                 Mandatory, replace all with this type as a unit
302    #      [Location Code]:            U78DA.ND1.1234567-P0
303    #      [Part Number]:              F191014
304    #      [CCIN]:                     2E2D
305    #      [Serial Number]:            YL2E2D010000
306    #  [Callout Count]:                1
307
308    Valid Value  pel_callout_section['Callout Count']  ['1']
309    Valid Value  pel_callout_section['Callouts'][0]['FRU Type']  ['Normal Hardware FRU']
310    Should Contain  ${pel_callout_section['Callouts'][0]['Priority']}  Mandatory
311
312    # Verify Location Code field of PEL callout with motherboard's Location Code.
313    ${busctl_output}=  BMC Execute Command  ${CMD_INVENTORY_PREFIX} com.ibm.ipzvpd.Location LocationCode
314    Should Be Equal  ${pel_callout_section['Callouts'][0]['Location Code']}
315    ...  ${busctl_output[0].split('"')[1].strip('"')}
316
317    # TODO: Compare CCIN and part number fields of PEL callout with Redfish or busctl output.
318    Should Match Regexp  ${pel_callout_section['Callouts'][0]['CCIN']}  [a-zA-Z0-9]
319    Should Match Regexp  ${pel_callout_section['Callouts'][0]['Part Number']}  [a-zA-Z0-9]
320
321    # Verify Serial Number field of PEL callout with motherboard's Serial Number.
322    ${busctl_output}=  BMC Execute Command
323    ...  ${CMD_INVENTORY_PREFIX} xyz.openbmc_project.Inventory.Decorator.Asset SerialNumber
324    Should Be Equal  ${pel_callout_section['Callouts'][0]['Serial Number']}
325    ...  ${busctl_output[0].split('"')[1].strip('"')}
326
327
328Verify Procedure And Symbolic FRU Callout
329    [Documentation]  Verify procedure and symbolic FRU callout from PEL log.
330    [Tags]  Verify_Procedure_And_Symbolic_FRU_Callout
331
332    Create Test PEL Log   Procedure And Symbolic FRU Callout
333
334    ${pel_ids}=  Get PEL Log Via BMC CLI
335    ${id}=  Get From List  ${pel_ids}  -1
336    ${pel_callout_section}=  Get PEL Field Value  ${id}  Primary SRC  Callout Section
337
338    # Example of PEL Callout Section from "peltool -i <id>" command.
339    #  [Callouts]:
340    #    [0]:
341    #      [Priority]:                                 Mandatory, replace all with this type as a unit
342    #      [Procedure Number]:                         BMCSP02
343    #      [FRU Type]:                                 Maintenance Procedure Required
344    #    [1]:
345    #      [Priority]:                                 Medium Priority
346    #      [Part Number]:                              SVCDOCS
347    #      [FRU Type]:                                 Symbolic FRU
348    #  [Callout Count]:                                2
349
350    Valid Value  pel_callout_section['Callout Count']  ['2']
351
352    # Verify procedural callout info.
353
354    Valid Value  pel_callout_section['Callouts'][0]['FRU Type']  ['Maintenance Procedure Required']
355    Should Contain  ${pel_callout_section['Callouts'][0]['Priority']}  Mandatory
356    # Verify if "Procedure Number" field of PEL has an alphanumeric value.
357    Should Match Regexp  ${pel_callout_section['Callouts'][0]['Procedure Number']}  [a-zA-Z0-9]
358
359    # Verify procedural callout info.
360
361    Valid Value  pel_callout_section['Callouts'][1]['FRU Type']  ['Symbolic FRU']
362    Should Contain  ${pel_callout_section['Callouts'][1]['Priority']}  Medium Priority
363    # Verify if "Part Number" field of Symbolic FRU has an alphanumeric value.
364    Should Match Regexp  ${pel_callout_section['Callouts'][1]['Part Number']}  [a-zA-Z0-9]
365
366
367Verify PEL Log Entry For Event Log
368    [Documentation]  Create an event log and verify PEL log entry in BMC for the same.
369    [Tags]  Verify_PEL_Log_Entry_For_Event_Log
370
371    Redfish Purge Event Log
372    # Create an internal failure error log.
373    BMC Execute Command  ${CMD_INTERNAL_FAILURE}
374
375    ${elog_entry}=  Get Event Logs
376    # Example of Redfish event logs:
377    # elog_entry:
378    #  [0]:
379    #    [Message]:                                    xyz.openbmc_project.Common.Error.InternalFailure
380    #    [Created]:                                    2020-04-20T01:55:22+00:00
381    #    [Id]:                                         1
382    #    [@odata.id]:                                  /redfish/v1/Systems/system/LogServices/EventLog/Entries/1
383    #    [@odata.type]:                                #LogEntry.v1_4_0.LogEntry
384    #    [EntryType]:                                  Event
385    #    [Severity]:                                   Critical
386    #    [Name]:                                       System Event Log Entry
387
388    ${redfish_log_time}=  Convert Date  ${elog_entry[0]["Created"]}  epoch
389
390    ${pel_records}=  Peltool  -l
391    # Example output from 'Peltool  -l':
392    # pel_records:
393    # [0x50000023]:
394    #   [SRC]:                                        BD8D1002
395    #   [CreatorID]:                                  BMC
396    #   [Message]:                                    An application had an internal failure
397    #   [CompID]:                                     0x1000
398    #   [PLID]:                                       0x50000023
399    #   [Commit Time]:                                04/20/2020 01:55:22
400    #   [Subsystem]:                                  BMC Firmware
401    #   [Sev]:                                        Unrecoverable Error
402
403    ${ids}=  Get Dictionary Keys  ${pel_records}
404    ${id}=  Get From List  ${ids}  0
405    ${pel_log_time}=  Convert Date  ${pel_records['${id}']['Commit Time']}  epoch
406    ...  date_format=%m/%d/%Y %H:%M:%S
407
408    # Verify that both Redfish event and PEL has log entry for internal error with same time stamp.
409    Should Contain Any  ${pel_records['${id}']['Message']}  internal failure  ignore_case=True
410    Should Contain Any  ${elog_entry[0]['Message']}  InternalFailure  ignore_case=True
411
412    Should Be Equal  ${redfish_log_time}  ${pel_log_time}
413
414
415Verify Delete All PEL
416    [Documentation]  Verify deleting all PEL logs.
417    [Tags]  Verify_Delete_All_PEL
418
419    Create Test PEL Log
420    Create Test PEL Log
421    Peltool  --delete-all  False
422
423    ${pel_ids}=  Get PEL Log Via BMC CLI
424    Should Be Empty  ${pel_ids}
425
426
427*** Keywords ***
428
429Create Test PEL Log
430    [Documentation]  Generate test PEL log.
431    [Arguments]  ${pel_type}=Internal Failure
432
433    # Description of argument(s):
434    # pel_type      The PEL type (e.g. Internal Failure, FRU Callout, Procedural Callout).
435
436    # Test PEL log entry example:
437    # {
438    #    "0x5000002D": {
439    #            "SRC": "BD8D1002",
440    #            "Message": "An application had an internal failure",
441    #            "PLID": "0x5000002D",
442    #            "CreatorID": "BMC",
443    #            "Subsystem": "BMC Firmware",
444    #            "Commit Time": "02/25/2020  04:47:09",
445    #            "Sev": "Unrecoverable Error",
446    #            "CompID": "0x1000"
447    #    }
448    # }
449
450    Run Keyword If  '${pel_type}' == 'Internal Failure'
451    ...   BMC Execute Command  ${CMD_INTERNAL_FAILURE}
452    ...  ELSE IF  '${pel_type}' == 'FRU Callout'
453    ...   BMC Execute Command  ${CMD_FRU_CALLOUT}
454    ...  ELSE IF  '${pel_type}' == 'Procedure And Symbolic FRU Callout'
455    ...   BMC Execute Command  ${CMD_PROCEDURAL_SYMBOLIC_FRU_CALLOUT}
456
457
458Get PEL Log IDs
459    [Documentation]  Returns the list of PEL log IDs which contains given field's value.
460    [Arguments]  ${pel_section}  ${pel_field}  @{pel_field_value}
461
462    # Description of argument(s):
463    # pel_section      The section of PEL (e.g. Private Header, User Header).
464    # pel_field        The PEL field (e.g. Event Severity, Event Type).
465    # pel_field_value  The list of PEL's field value (e.g. Unrecoverable Error).
466
467    ${pel_ids}=  Get PEL Log Via BMC CLI
468    @{pel_id_list}=  Create List
469
470    FOR  ${id}  IN  @{pel_ids}
471      ${pel_output}=  Peltool  -i ${id}
472      # Example of PEL output from "peltool -i <id>" command.
473      #  [Private Header]:
474      #    [Created at]:                                 08/24/1928 12:04:06
475      #    [Created by]:                                 0x584D
476      #    [Sub-section type]:                           0
477      #    [Entry Id]:                                   0x50000BB7
478      #    [Platform Log Id]:                            0x8200061D
479      #    [CSSVER]:
480      #    [Section Version]:                            1
481      #    [Creator Subsystem]:                          PHYP
482      #    [BMC Event Log Id]:                           341
483      #    [Committed at]:                               03/25/1920 12:06:22
484      #  [User Header]:
485      #    [Log Committed by]:                           0x4552
486      #    [Action Flags]:
487      #      [0]:                                        Report Externally
488      #    [Subsystem]:                                  I/O Subsystem
489      #    [Event Type]:                                 Miscellaneous, Informational Only
490      #    [Sub-section type]:                           0
491      #    [Event Scope]:                                Entire Platform
492      #    [Event Severity]:                             Informational Event
493      #    [Host Transmission]:                          Not Sent
494      #    [Section Version]:                            1
495
496      ${pel_section_output}=  Get From Dictionary  ${pel_output}  ${pel_section}
497      ${pel_field_output}=  Get From Dictionary  ${pel_section_output}  ${pel_field}
498      Run Keyword If  '${pel_field_output}' in @{pel_field_value}  Append To List  ${pel_id_list}  ${id}
499    END
500    Sort List  ${pel_id_list}
501
502    [Return]  ${pel_id_list}
503
504
505Get PEL Log Via BMC CLI
506    [Documentation]  Returns the list of PEL IDs using BMC CLI.
507
508    ${pel_records}=  Peltool  -l
509    ${ids}=  Get Dictionary Keys  ${pel_records}
510    Sort List  ${ids}
511
512    [Return]  ${ids}
513
514
515Get PEL Field Value
516    [Documentation]  Returns the value of given PEL's field.
517    [Arguments]  ${pel_id}  ${pel_section}  ${pel_field}
518
519    # Description of argument(s):
520    # pel_id           The ID of PEL (e.g. 0x5000002D, 0x5000002E).
521    # pel_section      The section of PEL (e.g. Private Header, User Header)
522    # pel_field        The PEL field (e.g. Event Severity, Event Type).
523
524    ${pel_output}=  Peltool  -i ${pel_id}
525
526    # Example of PEL output from "peltool -i <id>" command.
527    #  [Private Header]:
528    #    [Created at]:                                 08/24/1928 12:04:06
529    #    [Created by]:                                 0x584D
530    #    [Sub-section type]:                           0
531    #    [Entry Id]:                                   0x50000BB7
532    #    [Platform Log Id]:                            0x8200061D
533    #    [CSSVER]:
534    #    [Section Version]:                            1
535    #    [Creator Subsystem]:                          PHYP
536    #    [BMC Event Log Id]:                           341
537    #    [Committed at]:                               03/25/1920 12:06:22
538    #  [User Header]:
539    #    [Log Committed by]:                           0x4552
540    #    [Action Flags]:
541    #      [0]:                                        Report Externally
542    #    [Subsystem]:                                  I/O Subsystem
543    #    [Event Type]:                                 Miscellaneous, Informational Only
544    #    [Sub-section type]:                           0
545    #    [Event Scope]:                                Entire Platform
546    #    [Event Severity]:                             Informational Event
547    #    [Host Transmission]:                          Not Sent
548    #    [Section Version]:                            1
549
550    ${pel_section_output}=  Get From Dictionary  ${pel_output}  ${pel_section}
551    ${pel_field_output}=  Get From Dictionary  ${pel_section_output}  ${pel_field}
552
553    [Return]  ${pel_field_output}
554