xref: /openbmc/openbmc-test-automation/redfish/systems/eventlog/test_event_logging.robot (revision 759c6f97aad7dd584b26eb18a32848878bfa4300)
18cca7fb8SGeorge Keishing*** Settings ***
28cca7fb8SGeorge KeishingDocumentation       Inventory of hardware resources under systems.
38cca7fb8SGeorge Keishing
48cca7fb8SGeorge KeishingResource            ../../../lib/bmc_redfish_resource.robot
58cca7fb8SGeorge KeishingResource            ../../../lib/bmc_redfish_utils.robot
68cca7fb8SGeorge KeishingResource            ../../../lib/logging_utils.robot
78cca7fb8SGeorge KeishingResource            ../../../lib/openbmc_ffdc.robot
88fe6024eSGeorge KeishingResource            ../../../lib/ipmi_client.robot
9*759c6f97SGeorge KeishingLibrary             ../../../lib/logging_utils.py
108cca7fb8SGeorge Keishing
11b0a491f2SGeorge KeishingTest Setup          Test Setup Execution
128cca7fb8SGeorge KeishingTest Teardown       Test Teardown Execution
13b0a491f2SGeorge KeishingSuite Teardown      Suite Teardown Execution
148cca7fb8SGeorge Keishing
15*759c6f97SGeorge Keishing** Variables ***
16*759c6f97SGeorge Keishing
17*759c6f97SGeorge Keishing${max_num_event_logs}  ${200}
18*759c6f97SGeorge Keishing
198cca7fb8SGeorge Keishing*** Test Cases ***
208cca7fb8SGeorge Keishing
218cca7fb8SGeorge KeishingEvent Log Check After BMC Reboot
228cca7fb8SGeorge Keishing    [Documentation]  Check event log after BMC rebooted.
238cca7fb8SGeorge Keishing    [Tags]  Event_Log_Check_After_BMC_Reboot
248cca7fb8SGeorge Keishing
258cca7fb8SGeorge Keishing    Redfish Purge Event Log
268cca7fb8SGeorge Keishing    Event Log Should Not Exist
278cca7fb8SGeorge Keishing
288cca7fb8SGeorge Keishing    Redfish OBMC Reboot (off)
298cca7fb8SGeorge Keishing
308cca7fb8SGeorge Keishing    Redfish.Login
318cca7fb8SGeorge Keishing    Wait Until Keyword Succeeds  1 mins  15 secs   Redfish.Get  ${EVENT_LOG_URI}Entries
328cca7fb8SGeorge Keishing
338cca7fb8SGeorge Keishing    Event Log Should Not Exist
348cca7fb8SGeorge Keishing
358cca7fb8SGeorge Keishing
36b0a491f2SGeorge KeishingEvent Log Check After Host Poweron
37b0a491f2SGeorge Keishing    [Documentation]  Check event log after host has booted.
38b0a491f2SGeorge Keishing    [Tags]  Event_Log_Check_After_Host_Poweron
39b0a491f2SGeorge Keishing
40b0a491f2SGeorge Keishing    Redfish Purge Event Log
41b0a491f2SGeorge Keishing    Event Log Should Not Exist
42b0a491f2SGeorge Keishing
43b0a491f2SGeorge Keishing    Redfish Power On
44b0a491f2SGeorge Keishing
45b0a491f2SGeorge Keishing    Redfish.Login
46b0a491f2SGeorge Keishing    Event Log Should Not Exist
47b0a491f2SGeorge Keishing
48b0a491f2SGeorge Keishing
49b0a491f2SGeorge KeishingCreate Test Event Log And Verify
50b0a491f2SGeorge Keishing    [Documentation]  Create event logs and verify via redfish.
51b0a491f2SGeorge Keishing    [Tags]  Create_Test_Event_Log_And_Verify
52b0a491f2SGeorge Keishing
53b0a491f2SGeorge Keishing    Create Test Error Log
54b0a491f2SGeorge Keishing    Event Log Should Exist
55b0a491f2SGeorge Keishing
56b0a491f2SGeorge Keishing
57b0a491f2SGeorge KeishingTest Event Log Persistency On Restart
58b0a491f2SGeorge Keishing    [Documentation]  Restart logging service and verify event logs.
59b0a491f2SGeorge Keishing    [Tags]  Test_Event_Log_Persistency_On_Restart
60b0a491f2SGeorge Keishing
61b0a491f2SGeorge Keishing    Create Test Error Log
62b0a491f2SGeorge Keishing    Event Log Should Exist
63b0a491f2SGeorge Keishing
64b0a491f2SGeorge Keishing    BMC Execute Command
65b0a491f2SGeorge Keishing    ...  systemctl restart xyz.openbmc_project.Logging.service
66b0a491f2SGeorge Keishing    Sleep  10s  reason=Wait for logging service to restart properly.
67b0a491f2SGeorge Keishing
68b0a491f2SGeorge Keishing    Event Log Should Exist
69b0a491f2SGeorge Keishing
70b0a491f2SGeorge Keishing
71b0a491f2SGeorge KeishingTest Event Entry Numbering Reset On Restart
72b0a491f2SGeorge Keishing    [Documentation]  Restart logging service and verify event logs entry starts
73b0a491f2SGeorge Keishing    ...  from entry "Id" 1.
74b0a491f2SGeorge Keishing    [Tags]  Test_Event_Entry_Numbering_Reset_On_Restart
75b0a491f2SGeorge Keishing
76b0a491f2SGeorge Keishing    #{
77b0a491f2SGeorge Keishing    #  "@odata.context": "/redfish/v1/$metadata#LogEntryCollection.LogEntryCollection",
78b0a491f2SGeorge Keishing    #  "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries",
79b0a491f2SGeorge Keishing    #  "@odata.type": "#LogEntryCollection.LogEntryCollection",
80b0a491f2SGeorge Keishing    #  "Description": "Collection of System Event Log Entries",
81b0a491f2SGeorge Keishing    #  "Members": [
82b0a491f2SGeorge Keishing    #  {
83b0a491f2SGeorge Keishing    #    "@odata.context": "/redfish/v1/$metadata#LogEntry.LogEntry",
84b0a491f2SGeorge Keishing    #    "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries/1",
85b0a491f2SGeorge Keishing    #    "@odata.type": "#LogEntry.v1_4_0.LogEntry",
86b0a491f2SGeorge Keishing    #    "Created": "2019-05-29T13:19:27+00:00",
87b0a491f2SGeorge Keishing    #    "EntryType": "Event",
88b0a491f2SGeorge Keishing    #    "Id": "1",               <----- Event log ID
89b0a491f2SGeorge Keishing    #    "Message": "org.open_power.Host.Error.Event",
90b0a491f2SGeorge Keishing    #    "Name": "System DBus Event Log Entry",
91b0a491f2SGeorge Keishing    #    "Severity": "Critical"
92b0a491f2SGeorge Keishing    #  }
93b0a491f2SGeorge Keishing    #  ],
94b0a491f2SGeorge Keishing    #  "Members@odata.count": 1,
95b0a491f2SGeorge Keishing    #  "Name": "System Event Log Entries"
96b0a491f2SGeorge Keishing    #}
97b0a491f2SGeorge Keishing
98b0a491f2SGeorge Keishing    Create Test Error Log
99b0a491f2SGeorge Keishing    Create Test Error Log
100b0a491f2SGeorge Keishing    Event Log Should Exist
101b0a491f2SGeorge Keishing
102b0a491f2SGeorge Keishing    Redfish Purge Event Log
103b0a491f2SGeorge Keishing    Event Log Should Not Exist
104b0a491f2SGeorge Keishing
105b0a491f2SGeorge Keishing    BMC Execute Command
106b0a491f2SGeorge Keishing    ...  systemctl restart xyz.openbmc_project.Logging.service
107b0a491f2SGeorge Keishing    Sleep  10s  reason=Wait for logging service to restart properly.
108b0a491f2SGeorge Keishing
109b0a491f2SGeorge Keishing    Create Test Error Log
110b0a491f2SGeorge Keishing    ${elogs}=  Get Event Logs
111b0a491f2SGeorge Keishing    Should Be Equal  ${elogs[0]["Id"]}  1  msg=Event log entry is not 1.
112b0a491f2SGeorge Keishing
113b0a491f2SGeorge Keishing
114b0a491f2SGeorge KeishingTest Event Log Persistency On Reboot
115b0a491f2SGeorge Keishing    [Documentation]  Reboot BMC and verify event log.
116b0a491f2SGeorge Keishing    [Tags]  Test_Event_Log_Persistency_On_Reboot
117b0a491f2SGeorge Keishing
118b0a491f2SGeorge Keishing    Redfish Purge Event Log
119b0a491f2SGeorge Keishing    Create Test Error Log
120b0a491f2SGeorge Keishing    Event Log Should Exist
121b0a491f2SGeorge Keishing
122b0a491f2SGeorge Keishing    Redfish OBMC Reboot (off)
123b0a491f2SGeorge Keishing
124b0a491f2SGeorge Keishing    Redfish.Login
125b0a491f2SGeorge Keishing    Wait Until Keyword Succeeds  1 mins  15 secs   Redfish.Get  ${EVENT_LOG_URI}Entries
126b0a491f2SGeorge Keishing
127b0a491f2SGeorge Keishing    Event Log Should Exist
128b0a491f2SGeorge Keishing
129b0a491f2SGeorge Keishing
130148d08c2SGeorge KeishingCreate Test Event Log And Verify Time Stamp
131148d08c2SGeorge Keishing    [Documentation]  Create event logs and verify time stamp.
132148d08c2SGeorge Keishing    [Tags]  Create_Test_Event_Log_And_Verify_Time_Stamp
133148d08c2SGeorge Keishing
134148d08c2SGeorge Keishing    #{
135148d08c2SGeorge Keishing    #  "@odata.context": "/redfish/v1/$metadata#LogEntryCollection.LogEntryCollection",
136148d08c2SGeorge Keishing    #  "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries",
137148d08c2SGeorge Keishing    #  "@odata.type": "#LogEntryCollection.LogEntryCollection",
138148d08c2SGeorge Keishing    #  "Description": "Collection of System Event Log Entries",
139148d08c2SGeorge Keishing    #  "Members": [
140148d08c2SGeorge Keishing    #  {
141148d08c2SGeorge Keishing    #    "@odata.context": "/redfish/v1/$metadata#LogEntry.LogEntry",
142148d08c2SGeorge Keishing    #    "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries/1",
143148d08c2SGeorge Keishing    #    "@odata.type": "#LogEntry.v1_4_0.LogEntry",
144148d08c2SGeorge Keishing    #    "Created": "2019-05-29T13:19:27+00:00", <--- Time stamp
145148d08c2SGeorge Keishing    #    "EntryType": "Event",
146148d08c2SGeorge Keishing    #    "Id": "1",
147148d08c2SGeorge Keishing    #    "Message": "org.open_power.Host.Error.Event",
148148d08c2SGeorge Keishing    #    "Name": "System DBus Event Log Entry",
149148d08c2SGeorge Keishing    #    "Severity": "Critical"
150148d08c2SGeorge Keishing    #  }
151148d08c2SGeorge Keishing    #  ],
152148d08c2SGeorge Keishing    #  "Members@odata.count": 1,
153148d08c2SGeorge Keishing    #  "Name": "System Event Log Entries"
154148d08c2SGeorge Keishing    #}
155148d08c2SGeorge Keishing
156148d08c2SGeorge Keishing    Redfish Purge Event Log
157148d08c2SGeorge Keishing
158148d08c2SGeorge Keishing    Create Test Error Log
159148d08c2SGeorge Keishing    Sleep  2s
160148d08c2SGeorge Keishing    Create Test Error Log
161148d08c2SGeorge Keishing
162148d08c2SGeorge Keishing    ${elog_entry}=  Get Event Logs
163148d08c2SGeorge Keishing
164148d08c2SGeorge Keishing    # The event log generated is associated with the epoc time and unique
165148d08c2SGeorge Keishing    # for every error and in increasing time stamp.
166148d08c2SGeorge Keishing    ${time_stamp1}=  Convert Date  ${elog_entry[0]["Created"]}  epoch
167148d08c2SGeorge Keishing    ${time_stamp2}=  Convert Date  ${elog_entry[1]["Created"]}  epoch
168148d08c2SGeorge Keishing
169148d08c2SGeorge Keishing    Should Be True  ${time_stamp2} > ${time_stamp1}
170148d08c2SGeorge Keishing
171148d08c2SGeorge Keishing
1720b76e421SGeorge KeishingDelete Non Existing SEL Event Entry
1730b76e421SGeorge Keishing    [Documentation]  Delete non existing SEL event entry.
1740b76e421SGeorge Keishing    [Tags]  Delete_Non_Existing_SEL_Event_Entry
1750b76e421SGeorge Keishing
1760b76e421SGeorge Keishing    ${sel_delete}=  Run Keyword And Expect Error  *
1770b76e421SGeorge Keishing    ...  Run IPMI Standard Command  sel delete 100
1780b76e421SGeorge Keishing    Should Contain  ${sel_delete}  Unable to delete entry
1790b76e421SGeorge Keishing    ...  case_insensitive=True
1800b76e421SGeorge Keishing
1810b76e421SGeorge Keishing
1820b76e421SGeorge KeishingDelete Invalid SEL Event Entry
1830b76e421SGeorge Keishing    [Documentation]  Delete invalid SEL event entry.
1840b76e421SGeorge Keishing    [Tags]  Delete_Invalid_SEL_Event_Entry
1850b76e421SGeorge Keishing
1860b76e421SGeorge Keishing    ${sel_delete}=  Run Keyword And Expect Error  *
1870b76e421SGeorge Keishing    ...  Run IPMI Standard Command  sel delete abc
1880b76e421SGeorge Keishing    Should Contain  ${sel_delete}  Given SEL ID 'abc' is invalid
1890b76e421SGeorge Keishing    ...  case_insensitive=True
1900b76e421SGeorge Keishing
1910b76e421SGeorge Keishing
1920b76e421SGeorge KeishingVerify IPMI SEL Event Entries
1930b76e421SGeorge Keishing    [Documentation]  Verify IPMI SEL's entries info.
1940b76e421SGeorge Keishing    [Tags]  Verify_IPMI_SEL_Event_Entries
1950b76e421SGeorge Keishing
1960b76e421SGeorge Keishing    # Generate error logs of random count.
1970b76e421SGeorge Keishing    ${count}=  Evaluate  random.randint(1, 5)  modules=random
1980b76e421SGeorge Keishing    Repeat Keyword  ${count}  Create Test Error Log
1990b76e421SGeorge Keishing
2000b76e421SGeorge Keishing    ${sel_entries_count}=  Get IPMI SEL Setting  Entries
2010b76e421SGeorge Keishing    Should Be Equal As Strings  ${sel_entries_count}  ${count}
2020b76e421SGeorge Keishing
2030b76e421SGeorge Keishing
2040b76e421SGeorge KeishingVerify IPMI SEL Event Last Add Time
2050b76e421SGeorge Keishing    [Documentation]  Verify IPMI SEL's last added timestamp.
2060b76e421SGeorge Keishing    [Tags]  Verify_IPMI_SEL_Event_Last_Add_Time
2070b76e421SGeorge Keishing
2080b76e421SGeorge Keishing    Create Test Error Log
2090b76e421SGeorge Keishing    ${sel_time}=  Run IPMI Standard Command  sel time get
2100b76e421SGeorge Keishing    ${sel_time}=  Convert Date  ${sel_time}
2110b76e421SGeorge Keishing    ...  date_format=%m/%d/%Y %H:%M:%S  exclude_millis=True
2120b76e421SGeorge Keishing
2130b76e421SGeorge Keishing    ${sel_last_add_time}=  Get IPMI SEL Setting  Last Add Time
2140b76e421SGeorge Keishing    ${sel_last_add_time}=  Convert Date  ${sel_last_add_time}
2150b76e421SGeorge Keishing    ...  date_format=%m/%d/%Y %H:%M:%S  exclude_millis=True
2160b76e421SGeorge Keishing
2170b76e421SGeorge Keishing    ${time_diff}=
2180b76e421SGeorge Keishing    ...  Subtract Date From Date  ${sel_last_add_time}  ${sel_time}
2190b76e421SGeorge Keishing
2200b76e421SGeorge Keishing    # Verify if the delay in current time check and last add SEL time
2210b76e421SGeorge Keishing    # is less or equals to 2 seconds.
2220b76e421SGeorge Keishing    Should Be True  ${time_diff} <= 2
2230b76e421SGeorge Keishing
2240b76e421SGeorge Keishing
225d35b5319SGeorge KeishingCreate Test Event Log And Delete
226d35b5319SGeorge Keishing    [Documentation]  Create an event log and delete it.
227d35b5319SGeorge Keishing    [Tags]  Create_Test_Event_Log_And_Delete
228d35b5319SGeorge Keishing
229d35b5319SGeorge Keishing    Create Test Error Log
230d35b5319SGeorge Keishing    Redfish Purge Event Log
231d35b5319SGeorge Keishing    Event Log Should Not Exist
232d35b5319SGeorge Keishing
233d35b5319SGeorge Keishing
234d35b5319SGeorge KeishingCreate Multiple Test Event Logs And Delete All
235d35b5319SGeorge Keishing    [Documentation]  Create multiple event logs and delete all.
236d35b5319SGeorge Keishing    [Tags]  Create_Multiple_Test_Event_Logs_And_Delete_All
237d35b5319SGeorge Keishing
238d35b5319SGeorge Keishing    Create Test Error Log
239d35b5319SGeorge Keishing    Create Test Error Log
240d35b5319SGeorge Keishing    Create Test Error Log
241d35b5319SGeorge Keishing    Redfish Purge Event Log
242d35b5319SGeorge Keishing    Event Log Should Not Exist
243d35b5319SGeorge Keishing
244d35b5319SGeorge Keishing
245d35b5319SGeorge KeishingVerify Watchdog Timedout Event
246d35b5319SGeorge Keishing    [Documentation]  Trigger watchdog timed out and verify event log generated.
247d35b5319SGeorge Keishing    [Tags]  Verify_Watchdog_Timedout_Event
248d35b5319SGeorge Keishing
249d35b5319SGeorge Keishing    Redfish Power On
250d35b5319SGeorge Keishing
251d35b5319SGeorge Keishing    # Clear errors if there are any.
252d35b5319SGeorge Keishing    Redfish.Login
253d35b5319SGeorge Keishing    Redfish Purge Event Log
254d35b5319SGeorge Keishing
255d35b5319SGeorge Keishing    Trigger Host Watchdog Error
256d35b5319SGeorge Keishing
257d35b5319SGeorge Keishing    # Logging takes time to generate the timeout error.
258d35b5319SGeorge Keishing    Wait Until Keyword Succeeds  2 min  30 sec
259d35b5319SGeorge Keishing    ...  Verify Watchdog EventLog Content
260d35b5319SGeorge Keishing
261d35b5319SGeorge Keishing    Redfish Power Off
262d35b5319SGeorge Keishing
263d35b5319SGeorge Keishing
264d35b5319SGeorge KeishingVerify Event Logs Capping
265d35b5319SGeorge Keishing    [Documentation]  Verify event logs capping.
266d35b5319SGeorge Keishing    [Tags]  Verify_Event_Logs_Capping
267d35b5319SGeorge Keishing
268d35b5319SGeorge Keishing    Redfish Purge Event Log
269d35b5319SGeorge Keishing
270d35b5319SGeorge Keishing    ${cmd}=  Catenate  for i in {1..201}; do /tmp/tarball/bin/logging-test -c
271d35b5319SGeorge Keishing    ...  AutoTestSimple; done
272d35b5319SGeorge Keishing    BMC Execute Command  ${cmd}
273d35b5319SGeorge Keishing
274d35b5319SGeorge Keishing    ${elogs}=  Get Event Logs
275d35b5319SGeorge Keishing    ${count}=  Get Length  ${elogs}
276d35b5319SGeorge Keishing    Run Keyword If  ${count} > 200
277d35b5319SGeorge Keishing    ...  Fail  Error logs created exceeded max capacity 200.
278d35b5319SGeorge Keishing
279d35b5319SGeorge Keishing
280*759c6f97SGeorge KeishingTest Event Log Wrapping
281*759c6f97SGeorge Keishing    [Documentation]  Verify event log entries wraps when 200 max cap is reached.
282*759c6f97SGeorge Keishing    [Tags]  Test_Event_Log_Wrapping
283*759c6f97SGeorge Keishing
284*759c6f97SGeorge Keishing    # Restarting logging service in order to clear logs and get the next log
285*759c6f97SGeorge Keishing    # ID set to 1.
286*759c6f97SGeorge Keishing    BMC Execute Command
287*759c6f97SGeorge Keishing    ...  systemctl restart xyz.openbmc_project.Logging.service
288*759c6f97SGeorge Keishing    Sleep  10s  reason=Wait for logging service to restart properly.
289*759c6f97SGeorge Keishing
290*759c6f97SGeorge Keishing    # Create ${max_num_event_logs} event logs.
291*759c6f97SGeorge Keishing    ${cmd}=  Catenate  for i in {1..${max_num_event_logs}}; do /tmp/tarball/bin/logging-test -c
292*759c6f97SGeorge Keishing    ...  AutoTestSimple;done
293*759c6f97SGeorge Keishing    BMC Execute Command  ${cmd}
294*759c6f97SGeorge Keishing
295*759c6f97SGeorge Keishing    # Verify that event logs with IDs 1 and ${max_num_event_logs} exist.
296*759c6f97SGeorge Keishing    ${event_log}=  Get Event Logs
297*759c6f97SGeorge Keishing
298*759c6f97SGeorge Keishing    ${log_entries}=  Filter Struct  ${event_log}  [('Id', '1')]
299*759c6f97SGeorge Keishing    Rprint Vars  log_entries  fmt=terse
300*759c6f97SGeorge Keishing    Should Be Equal As Strings  ${log_entries[0]["Id"]}  1
301*759c6f97SGeorge Keishing
302*759c6f97SGeorge Keishing    ${log_entries}=  Filter Struct  ${event_log}  [('Id', '${max_num_event_logs}')]
303*759c6f97SGeorge Keishing    Rprint Vars  log_entries  fmt=terse
304*759c6f97SGeorge Keishing    Should Be Equal As Strings  ${log_entries[0]["Id"]}  ${max_num_event_logs}
305*759c6f97SGeorge Keishing
306*759c6f97SGeorge Keishing    # Create event log and verify the entry ID, ${max_num_event_logs + 1}.
307*759c6f97SGeorge Keishing    ${next_event_log_id}=  Set Variable  ${max_num_event_logs + 1}
308*759c6f97SGeorge Keishing
309*759c6f97SGeorge Keishing    Create Test Error Log
310*759c6f97SGeorge Keishing
311*759c6f97SGeorge Keishing    ${event_log}=  Get Event Logs
312*759c6f97SGeorge Keishing
313*759c6f97SGeorge Keishing    ${log_entries}=  Filter Struct  ${event_log}  [('Id', '${next_event_log_id}')]
314*759c6f97SGeorge Keishing    Rprint Vars  log_entries  fmt=terse
315*759c6f97SGeorge Keishing    Should Be Equal As Strings  ${log_entries[0]["Id"]}  ${next_event_log_id}
316*759c6f97SGeorge Keishing
317*759c6f97SGeorge Keishing    # Event log 1 should be wrapped.
318*759c6f97SGeorge Keishing    ${log_entries}=  Filter Struct  ${event_log}  [('Id', '1')]
319*759c6f97SGeorge Keishing    Rprint Vars  log_entries  fmt=terse
320*759c6f97SGeorge Keishing
321*759c6f97SGeorge Keishing    ${length_log_entries}  Get Length  ${log_entries}
322*759c6f97SGeorge Keishing    Should Be Equal As Integers  ${length_log_entries}  0
323*759c6f97SGeorge Keishing    ...  msg=The event log should have wrapped such that entry ID 1 is now purged.
324*759c6f97SGeorge Keishing
325*759c6f97SGeorge Keishing
3268cca7fb8SGeorge Keishing*** Keywords ***
3278cca7fb8SGeorge Keishing
3288cca7fb8SGeorge KeishingSuite Teardown Execution
3298cca7fb8SGeorge Keishing    [Documentation]  Do the post suite teardown.
3308cca7fb8SGeorge Keishing
3318cca7fb8SGeorge Keishing    Redfish.Logout
3328cca7fb8SGeorge Keishing
3338cca7fb8SGeorge Keishing
334b0a491f2SGeorge KeishingTest Setup Execution
3358cca7fb8SGeorge Keishing   [Documentation]  Do test case setup tasks.
3368cca7fb8SGeorge Keishing
3378cca7fb8SGeorge Keishing    Redfish.Login
3388cca7fb8SGeorge Keishing
3390b76e421SGeorge Keishing    Redfish Purge Event Log
3400b76e421SGeorge Keishing
3418cca7fb8SGeorge Keishing    ${status}=  Run Keyword And Return Status  Logging Test Binary Exist
3428cca7fb8SGeorge Keishing    Run Keyword If  ${status} == ${False}  Install Tarball
3438cca7fb8SGeorge Keishing
3448cca7fb8SGeorge Keishing
3458cca7fb8SGeorge KeishingTest Teardown Execution
3468cca7fb8SGeorge Keishing    [Documentation]  Do the post test teardown.
3478cca7fb8SGeorge Keishing
3488cca7fb8SGeorge Keishing    FFDC On Test Case Fail
349e5c5ebdfSGeorge Keishing    Redfish.Login
350b0a491f2SGeorge Keishing    Redfish Purge Event Log
3518cca7fb8SGeorge Keishing
3528cca7fb8SGeorge Keishing
3538cca7fb8SGeorge KeishingEvent Log Should Not Exist
3548cca7fb8SGeorge Keishing    [Documentation]  Event log entries should not exist.
3558cca7fb8SGeorge Keishing
3568cca7fb8SGeorge Keishing    ${elogs}=  Get Event Logs
3578cca7fb8SGeorge Keishing    Should Be Empty  ${elogs}  msg=System event log entry is not empty.
358b0a491f2SGeorge Keishing
359b0a491f2SGeorge Keishing
360b0a491f2SGeorge KeishingEvent Log Should Exist
361b0a491f2SGeorge Keishing    [Documentation]  Event log entries should exist.
362b0a491f2SGeorge Keishing
363b0a491f2SGeorge Keishing    ${elogs}=  Get Event Logs
364b0a491f2SGeorge Keishing    Should Not Be Empty  ${elogs}  msg=System event log entry is not empty.
365d35b5319SGeorge Keishing
366d35b5319SGeorge Keishing
367d35b5319SGeorge KeishingVerify Watchdog EventLog Content
368d35b5319SGeorge Keishing    [Documentation]  Verify watchdog event log content.
369d35b5319SGeorge Keishing
370d35b5319SGeorge Keishing    # Example:
371d35b5319SGeorge Keishing    # {
372d35b5319SGeorge Keishing    #    "@odata.context": "/redfish/v1/$metadata#LogEntry.LogEntry",
373d35b5319SGeorge Keishing    #    "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries/31",
374d35b5319SGeorge Keishing    #    "@odata.type": "#LogEntry.v1_4_0.LogEntry",
375d35b5319SGeorge Keishing    #    "Created": "2019-05-31T18:41:33+00:00",
376d35b5319SGeorge Keishing    #    "EntryType": "Event",
377d35b5319SGeorge Keishing    #    "Id": "31",
378d35b5319SGeorge Keishing    #    "Message": "org.open_power.Host.Boot.Error.WatchdogTimedOut",
379d35b5319SGeorge Keishing    #    "Name": "System DBus Event Log Entry",
380d35b5319SGeorge Keishing    #    "Severity": "Critical"
381d35b5319SGeorge Keishing    # }
382d35b5319SGeorge Keishing
383d35b5319SGeorge Keishing    ${elog}=  Get Event Logs
384d35b5319SGeorge Keishing    Should Be Equal As Strings
385d35b5319SGeorge Keishing    ...  ${elog[0]["Message"]}  org.open_power.Host.Boot.Error.WatchdogTimedOut
386d35b5319SGeorge Keishing    ...  msg=Watchdog timeout event log was not found.
387d35b5319SGeorge Keishing    Should Be Equal As Strings
388d35b5319SGeorge Keishing    ...  ${elog[0]["Severity"]}  Critical
389d35b5319SGeorge Keishing    ...  msg=Watchdog timeout severity unexpected value.
390