blob: 88d3ce9934be68033a150644151cfc1257ee144d [file] [log] [blame]
George Keishing8cca7fb2019-05-30 04:23:50 -05001*** Settings ***
2Documentation Inventory of hardware resources under systems.
3
4Resource ../../../lib/bmc_redfish_resource.robot
5Resource ../../../lib/bmc_redfish_utils.robot
6Resource ../../../lib/logging_utils.robot
7Resource ../../../lib/openbmc_ffdc.robot
8
George Keishingb0a491f2019-05-31 02:49:22 -05009Test Setup Test Setup Execution
George Keishing8cca7fb2019-05-30 04:23:50 -050010Test Teardown Test Teardown Execution
George Keishingb0a491f2019-05-31 02:49:22 -050011Suite Teardown Suite Teardown Execution
George Keishing8cca7fb2019-05-30 04:23:50 -050012
13*** Test Cases ***
14
15Event Log Check After BMC Reboot
16 [Documentation] Check event log after BMC rebooted.
17 [Tags] Event_Log_Check_After_BMC_Reboot
18
19 Redfish Purge Event Log
20 Event Log Should Not Exist
21
22 Redfish OBMC Reboot (off)
23
24 Redfish.Login
25 Wait Until Keyword Succeeds 1 mins 15 secs Redfish.Get ${EVENT_LOG_URI}Entries
26
27 Event Log Should Not Exist
28
29
George Keishingb0a491f2019-05-31 02:49:22 -050030Event Log Check After Host Poweron
31 [Documentation] Check event log after host has booted.
32 [Tags] Event_Log_Check_After_Host_Poweron
33
34 Redfish Purge Event Log
35 Event Log Should Not Exist
36
37 Redfish Power On
38
39 Redfish.Login
40 Event Log Should Not Exist
41
42
43Create Test Event Log And Verify
44 [Documentation] Create event logs and verify via redfish.
45 [Tags] Create_Test_Event_Log_And_Verify
46
47 Create Test Error Log
48 Event Log Should Exist
49
50
51Test Event Log Persistency On Restart
52 [Documentation] Restart logging service and verify event logs.
53 [Tags] Test_Event_Log_Persistency_On_Restart
54
55 Create Test Error Log
56 Event Log Should Exist
57
58 BMC Execute Command
59 ... systemctl restart xyz.openbmc_project.Logging.service
60 Sleep 10s reason=Wait for logging service to restart properly.
61
62 Event Log Should Exist
63
64
65Test Event Entry Numbering Reset On Restart
66 [Documentation] Restart logging service and verify event logs entry starts
67 ... from entry "Id" 1.
68 [Tags] Test_Event_Entry_Numbering_Reset_On_Restart
69
70 #{
71 # "@odata.context": "/redfish/v1/$metadata#LogEntryCollection.LogEntryCollection",
72 # "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries",
73 # "@odata.type": "#LogEntryCollection.LogEntryCollection",
74 # "Description": "Collection of System Event Log Entries",
75 # "Members": [
76 # {
77 # "@odata.context": "/redfish/v1/$metadata#LogEntry.LogEntry",
78 # "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries/1",
79 # "@odata.type": "#LogEntry.v1_4_0.LogEntry",
80 # "Created": "2019-05-29T13:19:27+00:00",
81 # "EntryType": "Event",
82 # "Id": "1", <----- Event log ID
83 # "Message": "org.open_power.Host.Error.Event",
84 # "Name": "System DBus Event Log Entry",
85 # "Severity": "Critical"
86 # }
87 # ],
88 # "Members@odata.count": 1,
89 # "Name": "System Event Log Entries"
90 #}
91
92 Create Test Error Log
93 Create Test Error Log
94 Event Log Should Exist
95
96 Redfish Purge Event Log
97 Event Log Should Not Exist
98
99 BMC Execute Command
100 ... systemctl restart xyz.openbmc_project.Logging.service
101 Sleep 10s reason=Wait for logging service to restart properly.
102
103 Create Test Error Log
104 ${elogs}= Get Event Logs
105 Should Be Equal ${elogs[0]["Id"]} 1 msg=Event log entry is not 1.
106
107
108Test Event Log Persistency On Reboot
109 [Documentation] Reboot BMC and verify event log.
110 [Tags] Test_Event_Log_Persistency_On_Reboot
111
112 Redfish Purge Event Log
113 Create Test Error Log
114 Event Log Should Exist
115
116 Redfish OBMC Reboot (off)
117
118 Redfish.Login
119 Wait Until Keyword Succeeds 1 mins 15 secs Redfish.Get ${EVENT_LOG_URI}Entries
120
121 Event Log Should Exist
122
123
George Keishing148d08c2019-05-31 12:39:04 -0500124Create Test Event Log And Verify Time Stamp
125 [Documentation] Create event logs and verify time stamp.
126 [Tags] Create_Test_Event_Log_And_Verify_Time_Stamp
127
128 #{
129 # "@odata.context": "/redfish/v1/$metadata#LogEntryCollection.LogEntryCollection",
130 # "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries",
131 # "@odata.type": "#LogEntryCollection.LogEntryCollection",
132 # "Description": "Collection of System Event Log Entries",
133 # "Members": [
134 # {
135 # "@odata.context": "/redfish/v1/$metadata#LogEntry.LogEntry",
136 # "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries/1",
137 # "@odata.type": "#LogEntry.v1_4_0.LogEntry",
138 # "Created": "2019-05-29T13:19:27+00:00", <--- Time stamp
139 # "EntryType": "Event",
140 # "Id": "1",
141 # "Message": "org.open_power.Host.Error.Event",
142 # "Name": "System DBus Event Log Entry",
143 # "Severity": "Critical"
144 # }
145 # ],
146 # "Members@odata.count": 1,
147 # "Name": "System Event Log Entries"
148 #}
149
150 Redfish Purge Event Log
151
152 Create Test Error Log
153 Sleep 2s
154 Create Test Error Log
155
156 ${elog_entry}= Get Event Logs
157
158 # The event log generated is associated with the epoc time and unique
159 # for every error and in increasing time stamp.
160 ${time_stamp1}= Convert Date ${elog_entry[0]["Created"]} epoch
161 ${time_stamp2}= Convert Date ${elog_entry[1]["Created"]} epoch
162
163 Should Be True ${time_stamp2} > ${time_stamp1}
164
165
George Keishing8cca7fb2019-05-30 04:23:50 -0500166*** Keywords ***
167
168Suite Teardown Execution
169 [Documentation] Do the post suite teardown.
170
171 Redfish.Logout
172
173
George Keishingb0a491f2019-05-31 02:49:22 -0500174Test Setup Execution
175 [Documentation] Do test case setup tasks.
George Keishing8cca7fb2019-05-30 04:23:50 -0500176
177 Redfish.Login
178
179 ${status}= Run Keyword And Return Status Logging Test Binary Exist
180 Run Keyword If ${status} == ${False} Install Tarball
181
182
183Test Teardown Execution
184 [Documentation] Do the post test teardown.
185
186 FFDC On Test Case Fail
George Keishingb0a491f2019-05-31 02:49:22 -0500187 Redfish Purge Event Log
George Keishing8cca7fb2019-05-30 04:23:50 -0500188
189
190Event Log Should Not Exist
191 [Documentation] Event log entries should not exist.
192
193 ${elogs}= Get Event Logs
194 Should Be Empty ${elogs} msg=System event log entry is not empty.
George Keishingb0a491f2019-05-31 02:49:22 -0500195
196
197Event Log Should Exist
198 [Documentation] Event log entries should exist.
199
200 ${elogs}= Get Event Logs
201 Should Not Be Empty ${elogs} msg=System event log entry is not empty.