blob: 7cb9df1a64885df1fb18a02646eb633a4a821365 [file] [log] [blame]
Steven Sombara3f04392018-10-01 15:38:21 -05001*** Settings ***
2Documentation Utilities for eSEL testing.
3
4Resource ../lib/ipmi_client.robot
5Resource ../lib/utils.robot
George Keishing6716d6a2019-06-03 10:18:20 -05006Resource ../lib/logging_utils.robot
Steven Sombara3f04392018-10-01 15:38:21 -05007Variables ../data/variables.py
8
9
10*** Variables ***
11
12${RAW_PREFIX} raw 0x3a 0xf0 0x
13
14${RESERVE_ID} raw 0x0a 0x42
15
16${RAW_SUFFIX} 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x00
Steven Sombar31b6bd02019-03-06 10:58:07 -060017... 0xdf 0x00 0x00 0x00 0x00 0x20 0x00 0x04 0x12 0x65 0x6f 0xaa 0x00 0x00
Steven Sombara3f04392018-10-01 15:38:21 -050018
19${RAW_SEL_COMMIT} raw 0x0a 0x44 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x20
20... 0x00 0x04 0x12 0xA6 0x6f 0x02 0x00 0x01
21
22
23*** Keywords ***
24
25Create eSEL
26 [Documentation] Create an eSEL.
27 Open Connection And Log In
28 ${Resv_id}= Run Inband IPMI Standard Command ${RESERVE_ID}
29 ${cmd}= Catenate
30 ... ${RAW_PREFIX}${Resv_id.strip().rsplit(' ', 1)[0]} ${RAW_SUFFIX}
31 Run Inband IPMI Standard Command ${cmd}
32 Run Inband IPMI Standard Command ${RAW_SEL_COMMIT}
33
34
35Count eSEL Entries
36 [Documentation] Count eSEL entries logged.
37 ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}
38 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
39 ${jsondata}= To JSON ${resp.content}
40 ${count}= Get Length ${jsondata["data"]}
41 [Return] ${count}
42
43
44Verify eSEL Entries
45 [Documentation] Verify eSEL entries logged.
Steven Sombara3f04392018-10-01 15:38:21 -050046
George Keishing6716d6a2019-06-03 10:18:20 -050047 # {
48 # "@odata.context": "/redfish/v1/$metadata#LogEntry.LogEntry",
49 # "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries/2",
50 # "@odata.type": "#LogEntry.v1_4_0.LogEntry",
51 # "Created": "2019-06-03T14:47:31+00:00",
52 # "EntryType": "Event",
53 # "Id": "2",
54 # "Message": "org.open_power.Host.Error.Event",
55 # "Name": "System DBus Event Log Entry",
56 # "Severity": "Critical"
57 # }
58
59 ${elog_entry}= Get Event Logs
60 Should Be Equal ${elog_entry[0]["Message"]} org.open_power.Host.Error.Event
61 Should Be Equal ${elog_entry[0]["Severity"]} Critical
Steven Sombar3839c8c2019-09-09 14:39:45 -050062
63
64Check For Error Logs
65 [Documentation] Fail if there are error logs. Ignore logs with
George Keishing178d9bf2020-07-09 08:29:29 -050066 ... severity in the ignorelist.
Steven Sombar3839c8c2019-09-09 14:39:45 -050067
George Keishing178d9bf2020-07-09 08:29:29 -050068 [Arguments] ${ignorelist
Steven Sombar3839c8c2019-09-09 14:39:45 -050069
70 # Description of Argument(s):
George Keishing178d9bf2020-07-09 08:29:29 -050071 # ignorelist A list to be used to filter out esels which are
Steven Sombar3839c8c2019-09-09 14:39:45 -050072 # of no interest to the caller.
73 # Error Logs with Severity field matching an
74 # entry in this list will be ignored. (e.g.
75 # xyz.openbmc_project.Logging.Entry.Level.Error)
76
77 Print Timen Checking Error Logs.
78 ${error_logs}= Get Error Logs
79
80 ${num_error_logs}= Get Length ${error_logs}
81 Return From Keyword If ${num_error_logs} == ${0}
82
83 # Get a list of the severities of the error logs.
84 ${error_log_severities}= Nested Get Severity ${error_logs}
George Keishing178d9bf2020-07-09 08:29:29 -050085 # Subtract the IGNORETLIST from the error_log_severities.
Steven Sombar3839c8c2019-09-09 14:39:45 -050086 ${problem_error_logs}= Evaluate
George Keishing178d9bf2020-07-09 08:29:29 -050087 ... list(set($error_log_severities) - set($ignorelist)
Steven Sombar3839c8c2019-09-09 14:39:45 -050088
89 Valid Length problem_error_logs max_length=0