Steven Sombar | a3f0439 | 2018-10-01 15:38:21 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Utilities for eSEL testing. |
| 3 | |
| 4 | Resource ../lib/ipmi_client.robot |
| 5 | Resource ../lib/utils.robot |
George Keishing | 6716d6a | 2019-06-03 10:18:20 -0500 | [diff] [blame] | 6 | Resource ../lib/logging_utils.robot |
Steven Sombar | a3f0439 | 2018-10-01 15:38:21 -0500 | [diff] [blame] | 7 | Variables ../data/variables.py |
| 8 | |
| 9 | |
| 10 | *** Variables *** |
| 11 | |
Steven Sombar | a3f0439 | 2018-10-01 15:38:21 -0500 | [diff] [blame] | 12 | ${RESERVE_ID} raw 0x0a 0x42 |
| 13 | |
| 14 | ${RAW_SUFFIX} 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x00 |
Steven Sombar | 31b6bd0 | 2019-03-06 10:58:07 -0600 | [diff] [blame] | 15 | ... 0xdf 0x00 0x00 0x00 0x00 0x20 0x00 0x04 0x12 0x65 0x6f 0xaa 0x00 0x00 |
Steven Sombar | a3f0439 | 2018-10-01 15:38:21 -0500 | [diff] [blame] | 16 | |
| 17 | ${RAW_SEL_COMMIT} raw 0x0a 0x44 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x20 |
| 18 | ... 0x00 0x04 0x12 0xA6 0x6f 0x02 0x00 0x01 |
| 19 | |
| 20 | |
| 21 | *** Keywords *** |
| 22 | |
| 23 | Create eSEL |
| 24 | [Documentation] Create an eSEL. |
Sridevi Ramesh | 2a2dbbd | 2025-03-18 00:57:14 -0500 | [diff] [blame] | 25 | [Arguments] ${IPMI_RAW_PREFIX} |
| 26 | |
| 27 | # Description of Argument(s): |
| 28 | # IPMI_RAW_PREFIX Provide the IPMI raw prefix format |
| 29 | # Default is '0x3a 0xf0 0x'. |
| 30 | |
Steven Sombar | a3f0439 | 2018-10-01 15:38:21 -0500 | [diff] [blame] | 31 | Open Connection And Log In |
| 32 | ${Resv_id}= Run Inband IPMI Standard Command ${RESERVE_ID} |
| 33 | ${cmd}= Catenate |
Sridevi Ramesh | 2a2dbbd | 2025-03-18 00:57:14 -0500 | [diff] [blame] | 34 | ... raw ${IPMI_RAW_PREFIX}${Resv_id.strip().rsplit(' ', 1)[0]} ${RAW_SUFFIX} |
| 35 | |
Steven Sombar | a3f0439 | 2018-10-01 15:38:21 -0500 | [diff] [blame] | 36 | Run Inband IPMI Standard Command ${cmd} |
| 37 | Run Inband IPMI Standard Command ${RAW_SEL_COMMIT} |
| 38 | |
| 39 | |
| 40 | Count eSEL Entries |
| 41 | [Documentation] Count eSEL entries logged. |
Sridevi Ramesh | 2a2dbbd | 2025-03-18 00:57:14 -0500 | [diff] [blame] | 42 | |
Steven Sombar | a3f0439 | 2018-10-01 15:38:21 -0500 | [diff] [blame] | 43 | ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY} |
| 44 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
George Keishing | fbd6700 | 2022-08-01 11:24:03 -0500 | [diff] [blame] | 45 | ${count}= Get Length ${resp.json()["data"]} |
George Keishing | 409df05 | 2024-01-17 22:36:14 +0530 | [diff] [blame] | 46 | RETURN ${count} |
Steven Sombar | a3f0439 | 2018-10-01 15:38:21 -0500 | [diff] [blame] | 47 | |
| 48 | |
| 49 | Verify eSEL Entries |
| 50 | [Documentation] Verify eSEL entries logged. |
Steven Sombar | a3f0439 | 2018-10-01 15:38:21 -0500 | [diff] [blame] | 51 | |
George Keishing | 6716d6a | 2019-06-03 10:18:20 -0500 | [diff] [blame] | 52 | # { |
| 53 | # "@odata.context": "/redfish/v1/$metadata#LogEntry.LogEntry", |
| 54 | # "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries/2", |
| 55 | # "@odata.type": "#LogEntry.v1_4_0.LogEntry", |
| 56 | # "Created": "2019-06-03T14:47:31+00:00", |
| 57 | # "EntryType": "Event", |
| 58 | # "Id": "2", |
| 59 | # "Message": "org.open_power.Host.Error.Event", |
| 60 | # "Name": "System DBus Event Log Entry", |
| 61 | # "Severity": "Critical" |
| 62 | # } |
| 63 | |
| 64 | ${elog_entry}= Get Event Logs |
| 65 | Should Be Equal ${elog_entry[0]["Message"]} org.open_power.Host.Error.Event |
| 66 | Should Be Equal ${elog_entry[0]["Severity"]} Critical |
Steven Sombar | 3839c8c | 2019-09-09 14:39:45 -0500 | [diff] [blame] | 67 | |
| 68 | |
| 69 | Check For Error Logs |
| 70 | [Documentation] Fail if there are error logs. Ignore logs with |
George Keishing | 178d9bf | 2020-07-09 08:29:29 -0500 | [diff] [blame] | 71 | ... severity in the ignorelist. |
Steven Sombar | 3839c8c | 2019-09-09 14:39:45 -0500 | [diff] [blame] | 72 | |
Konstantin Aladyshev | 10ac7fe | 2021-03-23 01:11:22 +0300 | [diff] [blame] | 73 | [Arguments] ${ignorelist} |
Steven Sombar | 3839c8c | 2019-09-09 14:39:45 -0500 | [diff] [blame] | 74 | |
| 75 | # Description of Argument(s): |
George Keishing | 178d9bf | 2020-07-09 08:29:29 -0500 | [diff] [blame] | 76 | # ignorelist A list to be used to filter out esels which are |
Steven Sombar | 3839c8c | 2019-09-09 14:39:45 -0500 | [diff] [blame] | 77 | # of no interest to the caller. |
| 78 | # Error Logs with Severity field matching an |
| 79 | # entry in this list will be ignored. (e.g. |
| 80 | # xyz.openbmc_project.Logging.Entry.Level.Error) |
| 81 | |
| 82 | Print Timen Checking Error Logs. |
| 83 | ${error_logs}= Get Error Logs |
| 84 | |
| 85 | ${num_error_logs}= Get Length ${error_logs} |
| 86 | Return From Keyword If ${num_error_logs} == ${0} |
| 87 | |
| 88 | # Get a list of the severities of the error logs. |
| 89 | ${error_log_severities}= Nested Get Severity ${error_logs} |
George Keishing | 178d9bf | 2020-07-09 08:29:29 -0500 | [diff] [blame] | 90 | # Subtract the IGNORETLIST from the error_log_severities. |
Steven Sombar | 3839c8c | 2019-09-09 14:39:45 -0500 | [diff] [blame] | 91 | ${problem_error_logs}= Evaluate |
Konstantin Aladyshev | 10ac7fe | 2021-03-23 01:11:22 +0300 | [diff] [blame] | 92 | ... list(set($error_log_severities) - set($ignorelist)) |
Steven Sombar | 3839c8c | 2019-09-09 14:39:45 -0500 | [diff] [blame] | 93 | |
| 94 | Valid Length problem_error_logs max_length=0 |