George Keishing | 8cca7fb | 2019-05-30 04:23:50 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Inventory of hardware resources under systems. |
| 3 | |
| 4 | Resource ../../../lib/bmc_redfish_resource.robot |
| 5 | Resource ../../../lib/bmc_redfish_utils.robot |
| 6 | Resource ../../../lib/logging_utils.robot |
| 7 | Resource ../../../lib/openbmc_ffdc.robot |
| 8 | |
George Keishing | b0a491f | 2019-05-31 02:49:22 -0500 | [diff] [blame] | 9 | Test Setup Test Setup Execution |
George Keishing | 8cca7fb | 2019-05-30 04:23:50 -0500 | [diff] [blame] | 10 | Test Teardown Test Teardown Execution |
George Keishing | b0a491f | 2019-05-31 02:49:22 -0500 | [diff] [blame] | 11 | Suite Teardown Suite Teardown Execution |
George Keishing | 8cca7fb | 2019-05-30 04:23:50 -0500 | [diff] [blame] | 12 | |
| 13 | *** Test Cases *** |
| 14 | |
| 15 | Event 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 Keishing | b0a491f | 2019-05-31 02:49:22 -0500 | [diff] [blame] | 30 | Event 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 | |
| 43 | Create 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 | |
| 51 | Test 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 | |
| 65 | Test 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 | |
| 108 | Test 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 Keishing | 148d08c | 2019-05-31 12:39:04 -0500 | [diff] [blame] | 124 | Create 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 Keishing | 0b76e42 | 2019-06-03 01:58:52 -0500 | [diff] [blame^] | 166 | Delete Non Existing SEL Event Entry |
| 167 | [Documentation] Delete non existing SEL event entry. |
| 168 | [Tags] Delete_Non_Existing_SEL_Event_Entry |
| 169 | |
| 170 | ${sel_delete}= Run Keyword And Expect Error * |
| 171 | ... Run IPMI Standard Command sel delete 100 |
| 172 | Should Contain ${sel_delete} Unable to delete entry |
| 173 | ... case_insensitive=True |
| 174 | |
| 175 | |
| 176 | Delete Invalid SEL Event Entry |
| 177 | [Documentation] Delete invalid SEL event entry. |
| 178 | [Tags] Delete_Invalid_SEL_Event_Entry |
| 179 | |
| 180 | ${sel_delete}= Run Keyword And Expect Error * |
| 181 | ... Run IPMI Standard Command sel delete abc |
| 182 | Should Contain ${sel_delete} Given SEL ID 'abc' is invalid |
| 183 | ... case_insensitive=True |
| 184 | |
| 185 | |
| 186 | Verify IPMI SEL Event Entries |
| 187 | [Documentation] Verify IPMI SEL's entries info. |
| 188 | [Tags] Verify_IPMI_SEL_Event_Entries |
| 189 | |
| 190 | # Generate error logs of random count. |
| 191 | ${count}= Evaluate random.randint(1, 5) modules=random |
| 192 | Repeat Keyword ${count} Create Test Error Log |
| 193 | |
| 194 | ${sel_entries_count}= Get IPMI SEL Setting Entries |
| 195 | Should Be Equal As Strings ${sel_entries_count} ${count} |
| 196 | |
| 197 | |
| 198 | Verify IPMI SEL Event Last Add Time |
| 199 | [Documentation] Verify IPMI SEL's last added timestamp. |
| 200 | [Tags] Verify_IPMI_SEL_Event_Last_Add_Time |
| 201 | |
| 202 | Create Test Error Log |
| 203 | ${sel_time}= Run IPMI Standard Command sel time get |
| 204 | ${sel_time}= Convert Date ${sel_time} |
| 205 | ... date_format=%m/%d/%Y %H:%M:%S exclude_millis=True |
| 206 | |
| 207 | ${sel_last_add_time}= Get IPMI SEL Setting Last Add Time |
| 208 | ${sel_last_add_time}= Convert Date ${sel_last_add_time} |
| 209 | ... date_format=%m/%d/%Y %H:%M:%S exclude_millis=True |
| 210 | |
| 211 | ${time_diff}= |
| 212 | ... Subtract Date From Date ${sel_last_add_time} ${sel_time} |
| 213 | |
| 214 | # Verify if the delay in current time check and last add SEL time |
| 215 | # is less or equals to 2 seconds. |
| 216 | Should Be True ${time_diff} <= 2 |
| 217 | |
| 218 | |
George Keishing | 8cca7fb | 2019-05-30 04:23:50 -0500 | [diff] [blame] | 219 | *** Keywords *** |
| 220 | |
| 221 | Suite Teardown Execution |
| 222 | [Documentation] Do the post suite teardown. |
| 223 | |
| 224 | Redfish.Logout |
| 225 | |
| 226 | |
George Keishing | b0a491f | 2019-05-31 02:49:22 -0500 | [diff] [blame] | 227 | Test Setup Execution |
| 228 | [Documentation] Do test case setup tasks. |
George Keishing | 8cca7fb | 2019-05-30 04:23:50 -0500 | [diff] [blame] | 229 | |
| 230 | Redfish.Login |
| 231 | |
George Keishing | 0b76e42 | 2019-06-03 01:58:52 -0500 | [diff] [blame^] | 232 | Redfish Purge Event Log |
| 233 | |
George Keishing | 8cca7fb | 2019-05-30 04:23:50 -0500 | [diff] [blame] | 234 | ${status}= Run Keyword And Return Status Logging Test Binary Exist |
| 235 | Run Keyword If ${status} == ${False} Install Tarball |
| 236 | |
| 237 | |
| 238 | Test Teardown Execution |
| 239 | [Documentation] Do the post test teardown. |
| 240 | |
| 241 | FFDC On Test Case Fail |
George Keishing | b0a491f | 2019-05-31 02:49:22 -0500 | [diff] [blame] | 242 | Redfish Purge Event Log |
George Keishing | 8cca7fb | 2019-05-30 04:23:50 -0500 | [diff] [blame] | 243 | |
| 244 | |
| 245 | Event Log Should Not Exist |
| 246 | [Documentation] Event log entries should not exist. |
| 247 | |
| 248 | ${elogs}= Get Event Logs |
| 249 | Should Be Empty ${elogs} msg=System event log entry is not empty. |
George Keishing | b0a491f | 2019-05-31 02:49:22 -0500 | [diff] [blame] | 250 | |
| 251 | |
| 252 | Event Log Should Exist |
| 253 | [Documentation] Event log entries should exist. |
| 254 | |
| 255 | ${elogs}= Get Event Logs |
| 256 | Should Not Be Empty ${elogs} msg=System event log entry is not empty. |