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