Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Test Error logging. |
| 3 | |
| 4 | Resource ../lib/connection_client.robot |
| 5 | Resource ../lib/openbmc_ffdc.robot |
| 6 | Resource ../lib/utils.robot |
| 7 | Resource ../lib/state_manager.robot |
Rahul Maheshwari | 92972e7 | 2017-06-22 00:59:59 -0500 | [diff] [blame] | 8 | Resource ../lib/ipmi_client.robot |
George Keishing | 1d82dd1 | 2017-07-24 01:16:23 -0500 | [diff] [blame] | 9 | Resource ../lib/boot_utils.robot |
Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 10 | |
| 11 | Suite Setup Run Keywords Verify logging-test AND |
George Keishing | 184a89a | 2017-06-27 07:12:16 -0500 | [diff] [blame] | 12 | ... Delete Error Logs And Verify |
Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 13 | Test Setup Open Connection And Log In |
George Keishing | 845d9dc | 2017-06-16 14:49:29 -0500 | [diff] [blame] | 14 | Test Teardown Post Test Case Execution |
George Keishing | 184a89a | 2017-06-27 07:12:16 -0500 | [diff] [blame] | 15 | Suite Teardown Delete Error Logs And Verify |
Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 16 | |
George Keishing | 1d82dd1 | 2017-07-24 01:16:23 -0500 | [diff] [blame] | 17 | *** Variables *** |
| 18 | |
| 19 | ${stack_mode} skip |
| 20 | |
Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 21 | *** Test Cases *** |
| 22 | |
George Keishing | 1d82dd1 | 2017-07-24 01:16:23 -0500 | [diff] [blame] | 23 | Error Log Check After BMC Reboot |
| 24 | [Documentation] Check error log after BMC rebooted. |
| 25 | [Tags] Error_Log_Check_At_BMC_Ready |
| 26 | # 1. Power off. |
| 27 | # 2. Delete error logs. |
| 28 | # 3. Reboot BMC. |
| 29 | # 4. Check if eror log exists. |
| 30 | |
| 31 | REST Power Off |
| 32 | Delete Error Logs And Verify |
George Keishing | 3286eb3 | 2017-09-05 12:52:05 -0500 | [diff] [blame] | 33 | OBMC Reboot (off) |
George Keishing | 1d82dd1 | 2017-07-24 01:16:23 -0500 | [diff] [blame] | 34 | Error Logs Should Not Exist |
| 35 | |
| 36 | |
| 37 | Error Log Check After Host Poweron |
| 38 | [Documentation] Check error log after host has booted. |
| 39 | [Tags] Error_Log_Check_At_Host_Booted |
| 40 | # 1. Delete error logs |
| 41 | # 1. Power on. |
| 42 | # 3. Check if eror log exists. |
| 43 | |
| 44 | Delete Error Logs And Verify |
| 45 | REST Power On |
| 46 | Error Logs Should Not Exist |
| 47 | |
| 48 | |
Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 49 | Create Test Error And Verify |
| 50 | [Documentation] Create error logs and verify via REST. |
| 51 | [Tags] Create_Test_Error_And_Verify |
| 52 | |
| 53 | Create Test Error Log |
| 54 | Verify Test Error Log |
| 55 | |
| 56 | |
| 57 | Test Error Persistency On Restart |
George Keishing | 184a89a | 2017-06-27 07:12:16 -0500 | [diff] [blame] | 58 | [Documentation] Restart logging service and verify error logs. |
Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 59 | [Tags] Test_Error_Persistency_On_Restart |
| 60 | |
| 61 | Create Test Error Log |
| 62 | Verify Test Error Log |
| 63 | Execute Command On BMC |
| 64 | ... systemctl restart xyz.openbmc_project.Logging.service |
| 65 | Sleep 10s reason=Wait for logging service to restart properly. |
George Keishing | 184a89a | 2017-06-27 07:12:16 -0500 | [diff] [blame] | 66 | Verify Test Error Log |
Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 67 | |
| 68 | |
George Keishing | 742b060 | 2017-07-28 14:20:53 -0500 | [diff] [blame] | 69 | Test Error Entry Numbering Reset On Restart |
| 70 | [Documentation] Restarts logging service and verify error logs entry start |
| 71 | ... from entry "Id" 1. |
| 72 | # 1. Create error log. |
| 73 | # 2. Verify error log. |
| 74 | # 3. Delete error log. |
| 75 | # 4. Restart logging service. |
| 76 | # 5. Create error log. |
| 77 | # 6. Verify new error log entry starts with Id entry 1. |
| 78 | |
| 79 | [Tags] Test_Error_Entry_Numbering_Reset_On_Restart |
| 80 | # Example Error logs: |
| 81 | # "/xyz/openbmc_project/logging/entry/1": { |
| 82 | # "AdditionalData": [ |
| 83 | # "STRING=FOO" |
| 84 | # ], |
| 85 | # "Id": 1, <--- Entry value should be 1. |
| 86 | # "Message": "example.xyz.openbmc_project.Example.Elog.AutoTestSimple", |
| 87 | # "Resolved": 0, |
| 88 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error", |
| 89 | # "Timestamp": 1490818990051, |
| 90 | # "associations": [] |
| 91 | # }, |
| 92 | |
| 93 | Create Test Error Log |
| 94 | Verify Test Error Log |
| 95 | Delete Error Logs |
| 96 | Execute Command On BMC |
| 97 | ... systemctl restart xyz.openbmc_project.Logging.service |
| 98 | Sleep 10s reason=Wait for logging service to restart properly. |
| 99 | Create Test Error Log |
| 100 | ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY} |
| 101 | ${entry_id}= Read Attribute ${elog_entry[0]} Id |
| 102 | Should Be Equal ${entry_id} ${1} |
| 103 | |
| 104 | |
Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 105 | Test Error Persistency On Reboot |
George Keishing | 184a89a | 2017-06-27 07:12:16 -0500 | [diff] [blame] | 106 | [Documentation] Reboot BMC and verify error logs. |
Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 107 | [Tags] Test_Error_Persistency_On_Reboot |
| 108 | |
| 109 | Create Test Error Log |
| 110 | Verify Test Error Log |
| 111 | Initiate BMC Reboot |
| 112 | Wait Until Keyword Succeeds 10 min 10 sec |
| 113 | ... Is BMC Ready |
George Keishing | 184a89a | 2017-06-27 07:12:16 -0500 | [diff] [blame] | 114 | Verify Test Error Log |
Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 115 | |
| 116 | |
George Keishing | 04bc481 | 2017-03-30 03:33:31 -0500 | [diff] [blame] | 117 | Create Test Error And Verify Resolved Field |
| 118 | [Documentation] Create error log and verify "Resolved" |
| 119 | ... field is 0. |
| 120 | [Tags] Create_Test_Error_And_Verify_Resolved_Field |
| 121 | |
| 122 | # Example Error log: |
| 123 | # "/xyz/openbmc_project/logging/entry/1": { |
| 124 | # "AdditionalData": [ |
| 125 | # "STRING=FOO" |
| 126 | # ], |
| 127 | # "Id": 1, |
| 128 | # "Message": "example.xyz.openbmc_project.Example.Elog.AutoTestSimple", |
| 129 | # "Resolved": 0, |
| 130 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error", |
| 131 | # "Timestamp": 1490817164983, |
| 132 | # "associations": [] |
| 133 | # }, |
| 134 | |
| 135 | # It's work in progress, but it's mnfg need. To mark an error as |
| 136 | # resolved, without deleting the error, mfg will set this bool |
| 137 | # property. |
| 138 | # In this test context we are making sure "Resolved" field is "0" |
| 139 | # by default. |
| 140 | |
George Keishing | 6eb10b8 | 2017-06-06 10:02:09 -0500 | [diff] [blame] | 141 | Delete Error Logs |
George Keishing | 04bc481 | 2017-03-30 03:33:31 -0500 | [diff] [blame] | 142 | Create Test Error Log |
George Keishing | 184a89a | 2017-06-27 07:12:16 -0500 | [diff] [blame] | 143 | ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY} |
| 144 | ${resolved}= Read Attribute ${elog_entry[0]} Resolved |
George Keishing | 04bc481 | 2017-03-30 03:33:31 -0500 | [diff] [blame] | 145 | Should Be True ${resolved} == 0 |
| 146 | |
| 147 | |
| 148 | Create Test Errors And Verify Time Stamp |
| 149 | [Documentation] Create error logs and verify time stamp. |
| 150 | [Tags] Create_Test_Error_And_Verify_Time_Stamp |
| 151 | |
| 152 | # Example Error logs: |
| 153 | # "/xyz/openbmc_project/logging/entry/1": { |
| 154 | # "AdditionalData": [ |
| 155 | # "STRING=FOO" |
| 156 | # ], |
| 157 | # "Id": 1, |
| 158 | # "Message": "example.xyz.openbmc_project.Example.Elog.AutoTestSimple", |
| 159 | # "Resolved": 0, |
| 160 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error", |
| 161 | # "Timestamp": 1490818990051, <--- Time stamp |
| 162 | # "associations": [] |
| 163 | # }, |
| 164 | # "/xyz/openbmc_project/logging/entry/2": { |
| 165 | # "AdditionalData": [ |
| 166 | # "STRING=FOO" |
| 167 | # ], |
| 168 | # "Id": 2, |
| 169 | # "Message": "example.xyz.openbmc_project.Example.Elog.AutoTestSimple", |
| 170 | # "Resolved": 0, |
| 171 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error", |
| 172 | # "Timestamp": 1490818992116, <---- Time stamp |
| 173 | # "associations": [] |
| 174 | # }, |
| 175 | |
George Keishing | 6eb10b8 | 2017-06-06 10:02:09 -0500 | [diff] [blame] | 176 | Delete Error Logs |
George Keishing | 04bc481 | 2017-03-30 03:33:31 -0500 | [diff] [blame] | 177 | Create Test Error Log |
| 178 | Create Test Error Log |
| 179 | # The error log generated is associated with the epoc time and unique |
| 180 | # for every error and in increasing time stamp. |
George Keishing | 184a89a | 2017-06-27 07:12:16 -0500 | [diff] [blame] | 181 | ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY} |
| 182 | ${time_stamp1}= Read Attribute ${elog_entry[0]} Timestamp |
| 183 | ${time_stamp2}= Read Attribute ${elog_entry[1]} Timestamp |
George Keishing | 6eb10b8 | 2017-06-06 10:02:09 -0500 | [diff] [blame] | 184 | Should Be True ${time_stamp2} > ${time_stamp1} |
George Keishing | 04bc481 | 2017-03-30 03:33:31 -0500 | [diff] [blame] | 185 | |
Sweta Potthuri | 9ce8eeb | 2017-05-08 04:20:11 -0500 | [diff] [blame] | 186 | Create Test Error Log And Delete |
| 187 | [Documentation] Create an error log and delete it. |
| 188 | [Tags] Create_Test_Error_Log_And_Delete |
| 189 | |
| 190 | Delete Error Logs And Verify |
| 191 | Create Test Error Log |
| 192 | Delete Error Logs And Verify |
| 193 | |
| 194 | Create Multiple Test Error Logs And Delete All |
| 195 | [Documentation] Create multiple error logs and delete all. |
| 196 | [Tags] Create_Multiple_Test_Error_Logs_And_Delete_All |
| 197 | |
| 198 | Delete Error Logs And Verify |
| 199 | Create Test Error Log |
| 200 | Create Test Error Log |
| 201 | Create Test Error Log |
| 202 | Delete Error Logs And Verify |
| 203 | |
| 204 | Create Two Test Error Logs And Delete One |
| 205 | [Documentation] Create two error logs and delete the first entry. |
| 206 | [Tags] Create_Two_Test_Error_Logs_And_Delete_One |
| 207 | |
| 208 | Delete Error Logs And Verify |
| 209 | Create Test Error Log |
George Keishing | 184a89a | 2017-06-27 07:12:16 -0500 | [diff] [blame] | 210 | ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY} |
Sweta Potthuri | 9ce8eeb | 2017-05-08 04:20:11 -0500 | [diff] [blame] | 211 | Create Test Error Log |
George Keishing | 184a89a | 2017-06-27 07:12:16 -0500 | [diff] [blame] | 212 | Delete Error log Entry ${elog_entry[0]} |
| 213 | ${resp}= OpenBMC Get Request ${elog_entry[0]} |
Sweta Potthuri | 9ce8eeb | 2017-05-08 04:20:11 -0500 | [diff] [blame] | 214 | Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND} |
George Keishing | 04bc481 | 2017-03-30 03:33:31 -0500 | [diff] [blame] | 215 | |
Rahul Maheshwari | 92972e7 | 2017-06-22 00:59:59 -0500 | [diff] [blame] | 216 | |
| 217 | Verify IPMI SEL Version |
| 218 | [Documentation] Verify IPMI SEL's version info. |
| 219 | [Tags] Verify_IPMI_SEL_Version |
| 220 | |
| 221 | ${version_info}= Get IPMI SEL Setting Version |
| 222 | ${setting_status}= Fetch From Left ${version_info} ( |
| 223 | ${setting_status}= Evaluate $setting_status.replace(' ','') |
| 224 | |
| 225 | Should Be True ${setting_status} >= 1.5 |
Rahul Maheshwari | b44b6ec | 2017-07-05 00:23:03 -0500 | [diff] [blame] | 226 | Should Contain ${version_info} v2 compliant case_insensitive=True |
Rahul Maheshwari | 92972e7 | 2017-06-22 00:59:59 -0500 | [diff] [blame] | 227 | |
| 228 | |
George Keishing | 845d9dc | 2017-06-16 14:49:29 -0500 | [diff] [blame] | 229 | Verify Watchdog Timedout Error |
| 230 | [Documentation] Trigger watchdog timed out and verify errorlog generated. |
| 231 | [Tags] Verify_Watchdog_Timedout_Error |
| 232 | |
George Keishing | d397e6a | 2017-08-11 11:19:24 -0500 | [diff] [blame] | 233 | REST Power Off |
| 234 | REST Power On |
| 235 | |
George Keishing | 845d9dc | 2017-06-16 14:49:29 -0500 | [diff] [blame] | 236 | # Clear errors if there are any. |
| 237 | Delete Error Logs |
| 238 | |
George Keishing | 845d9dc | 2017-06-16 14:49:29 -0500 | [diff] [blame] | 239 | Trigger Host Watchdog Error |
| 240 | |
| 241 | Verify Watchdog Errorlog Content |
| 242 | |
| 243 | |
Rahul Maheshwari | b44b6ec | 2017-07-05 00:23:03 -0500 | [diff] [blame] | 244 | Verify IPMI SEL Delete |
| 245 | [Documentation] Verify IPMI SEL delete operation. |
| 246 | [Tags] Verify_IPMI_SEL_Delete |
| 247 | |
| 248 | Delete Error Logs And Verify |
| 249 | Create Test Error Log |
| 250 | |
| 251 | ${sel_list}= Run IPMI Standard Command sel list |
| 252 | # Example of SEL List: |
| 253 | # 4 | 04/21/2017 | 10:51:16 | System Event #0x01 | Undetermined system hardware failure | Asserted |
| 254 | |
| 255 | ${sel_entry}= Fetch from Left ${sel_list} | |
| 256 | ${sel_entry}= Evaluate $sel_entry.replace(' ','') |
| 257 | ${sel_entry}= Convert To Integer 0x${sel_entry} |
| 258 | |
| 259 | ${sel_delete}= Run IPMI Standard Command sel delete ${sel_entry} |
| 260 | Should Be Equal As Strings ${sel_delete} Deleted entry ${sel_entry} |
| 261 | ... case_insensitive=True |
| 262 | |
| 263 | ${sel_list}= Run IPMI Standard Command sel list |
| 264 | Should Be Equal As Strings ${sel_list} SEL has no entries |
| 265 | ... case_insensitive=True |
| 266 | |
| 267 | |
| 268 | Verify Empty SEL |
| 269 | [Documentation] Verify empty SEL list. |
| 270 | [Tags] Verify_Empty_SEL |
| 271 | |
| 272 | Delete Error Logs And Verify |
| 273 | |
| 274 | ${resp}= Run IPMI Standard Command sel list |
| 275 | Should Contain ${resp} SEL has no entries case_insensitive=True |
| 276 | |
| 277 | |
| 278 | Delete Non Existing SEL Entry |
| 279 | [Documentation] Delete non existing SEL entry. |
| 280 | [Tags] Delete_Non_Existing_SEL_Entry |
| 281 | |
| 282 | Delete Error Logs And Verify |
| 283 | ${sel_delete}= Run Keyword And Expect Error * |
| 284 | ... Run IPMI Standard Command sel delete 100 |
| 285 | Should Contain ${sel_delete} Unable to delete entry |
| 286 | ... case_insensitive=True |
| 287 | |
| 288 | |
| 289 | Delete Invalid SEL Entry |
| 290 | [Documentation] Delete invalid SEL entry. |
| 291 | [Tags] Delete_Invalid_SEL_Entry |
| 292 | |
| 293 | ${sel_delete}= Run Keyword And Expect Error * |
| 294 | ... Run IPMI Standard Command sel delete abc |
| 295 | Should Contain ${sel_delete} Given SEL ID 'abc' is invalid |
| 296 | ... case_insensitive=True |
| 297 | |
| 298 | |
Rahul Maheshwari | e89b509 | 2017-06-23 00:24:15 -0500 | [diff] [blame] | 299 | Verify IPMI SEL Entries |
| 300 | [Documentation] Verify IPMI SEL's entries info. |
| 301 | [Tags] Verify_IPMI_SEL_Entries |
| 302 | |
| 303 | Delete Error Logs And Verify |
| 304 | |
| 305 | # Generate error logs of random count. |
| 306 | ${count}= Evaluate random.randint(1, 5) modules=random |
| 307 | Repeat Keyword ${count} Create Test Error Log |
| 308 | |
| 309 | ${sel_entries_count}= Get IPMI SEL Setting Entries |
| 310 | Should Be Equal As Strings ${sel_entries_count} ${count} |
| 311 | |
| 312 | |
| 313 | Verify IPMI SEL Last Add Time |
| 314 | [Documentation] Verify IPMI SEL's last added timestamp. |
| 315 | [Tags] Verify_IPMI_SEL_Last_Add_Time |
| 316 | |
| 317 | Create Test Error Log |
| 318 | ${sel_time}= Run IPMI Standard Command sel time get |
| 319 | ${sel_time}= Convert Date ${sel_time} |
| 320 | ... date_format=%m/%d/%Y %H:%M:%S exclude_millis=True |
| 321 | |
| 322 | ${sel_last_add_time}= Get IPMI SEL Setting Last Add Time |
| 323 | ${sel_last_add_time}= Convert Date ${sel_last_add_time} |
| 324 | ... date_format=%m/%d/%Y %H:%M:%S exclude_millis=True |
| 325 | |
| 326 | ${time-diff}= |
| 327 | ... Subtract Date From Date ${sel_last_add_time} ${sel_time} |
| 328 | |
| 329 | # Verify if the delay in current time check and last add SEL time |
| 330 | # is less or equals to 2 seconds. |
| 331 | Should Be True ${time-diff} <= 2 |
| 332 | |
Sweta Potthuri | 96d8249 | 2017-08-23 09:03:38 -0500 | [diff] [blame] | 333 | Verify Error Logs Capping |
| 334 | [Documentation] Verify error logs capping. |
| 335 | [Tags] Verify_Error_Logs_Capping |
| 336 | |
| 337 | Delete Error Logs And Verify |
| 338 | ${cmd}= Set Variable |
| 339 | ... for i in {1..101}; do logging-test -c AutoTestSimple;done |
| 340 | Execute Command On BMC ${cmd} |
| 341 | ${count}= Count Error Entries |
| 342 | Run Keyword If ${count} > 100 |
| 343 | ... Fail Error logs created exceeded max capacity 100. |
Rahul Maheshwari | b44b6ec | 2017-07-05 00:23:03 -0500 | [diff] [blame] | 344 | |
Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 345 | *** Keywords *** |
| 346 | |
Rahul Maheshwari | 92972e7 | 2017-06-22 00:59:59 -0500 | [diff] [blame] | 347 | Get IPMI SEL Setting |
| 348 | [Documentation] Returns status for given IPMI SEL setting. |
| 349 | [Arguments] ${setting} |
| 350 | # Description of argument(s): |
| 351 | # setting SEL setting which needs to be read(e.g. "Last Add Time"). |
| 352 | |
| 353 | ${resp}= Run IPMI Standard Command sel info |
| 354 | |
| 355 | ${setting_line}= Get Lines Containing String ${resp} ${setting} |
| 356 | ... case-insensitive |
Rahul Maheshwari | b44b6ec | 2017-07-05 00:23:03 -0500 | [diff] [blame] | 357 | ${setting_status}= Fetch From Right ${setting_line} :${SPACE} |
Rahul Maheshwari | 92972e7 | 2017-06-22 00:59:59 -0500 | [diff] [blame] | 358 | |
| 359 | [Return] ${setting_status} |
| 360 | |
| 361 | |
George Keishing | 845d9dc | 2017-06-16 14:49:29 -0500 | [diff] [blame] | 362 | Verify Watchdog Errorlog Content |
| 363 | [Documentation] Verify watchdog errorlog content. |
| 364 | # Example: |
| 365 | # "/xyz/openbmc_project/logging/entry/1": |
| 366 | # { |
| 367 | # "AdditionalData": [], |
| 368 | # "Id": 1, |
| 369 | # "Message": "org.open_power.Host.Error.WatchdogTimedOut", |
| 370 | # "Resolved": 0, |
| 371 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Informational", |
| 372 | # "Timestamp": 1492715244828, |
| 373 | # "associations": [] |
| 374 | # }, |
| 375 | |
George Keishing | 184a89a | 2017-06-27 07:12:16 -0500 | [diff] [blame] | 376 | ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY} |
| 377 | ${elog}= Read Properties ${elog_entry[0]} |
George Keishing | 845d9dc | 2017-06-16 14:49:29 -0500 | [diff] [blame] | 378 | Should Be Equal As Strings |
| 379 | ... ${elog["Message"]} org.open_power.Host.Error.WatchdogTimedOut |
| 380 | Should Not Be Equal As Strings |
| 381 | ... ${elog["Severity"]} xyz.openbmc_project.Logging.Entry.Level.Informational |
| 382 | |
| 383 | |
Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 384 | Verify logging-test |
| 385 | [Documentation] Verify existence of prerequisite logging-test. |
| 386 | |
| 387 | Open Connection And Log In |
| 388 | ${out} ${stderr}= Execute Command which logging-test return_stderr=True |
| 389 | Should Be Empty ${stderr} |
| 390 | Should Contain ${out} logging-test |
| 391 | |
| 392 | Clear Existing Error Logs |
| 393 | [Documentation] If error log isn't empty, reboot the BMC to clear the log. |
| 394 | |
| 395 | ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}${1} |
| 396 | Return From Keyword If ${resp.status_code} == ${HTTP_NOT_FOUND} |
| 397 | Initiate BMC Reboot |
| 398 | Wait Until Keyword Succeeds 10 min 10 sec |
| 399 | ... Is BMC Ready |
| 400 | ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}${1} |
| 401 | Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 402 | |
| 403 | Create Test Error Log |
| 404 | [Documentation] Generate test error log. |
| 405 | |
| 406 | # Test error log entry example: |
| 407 | # "/xyz/openbmc_project/logging/entry/1": { |
| 408 | # "AdditionalData": [ |
| 409 | # "STRING=FOO" |
| 410 | # ], |
| 411 | # "Id": 1, |
| 412 | # "Message": "example.xyz.openbmc_project.Example.Elog.AutoTestSimple", |
| 413 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error", |
| 414 | # "Timestamp": 1487743963328, |
| 415 | # "associations": [] |
| 416 | # } |
| 417 | |
| 418 | Execute Command On BMC logging-test -c AutoTestSimple |
| 419 | |
Sweta Potthuri | 96d8249 | 2017-08-23 09:03:38 -0500 | [diff] [blame] | 420 | Count Error Entries |
| 421 | [Documentation] Count Error entries. |
| 422 | |
| 423 | ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY} |
| 424 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 425 | ${jsondata}= To JSON ${resp.content} |
| 426 | ${count}= Get Length ${jsondata["data"]} |
| 427 | [Return] ${count} |
| 428 | |
Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 429 | Verify Test Error Log |
| 430 | [Documentation] Verify test error log entries. |
George Keishing | 184a89a | 2017-06-27 07:12:16 -0500 | [diff] [blame] | 431 | ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY} |
| 432 | ${entry_id}= Read Attribute ${elog_entry[0]} Message |
Sweta Potthuri | 9ce8eeb | 2017-05-08 04:20:11 -0500 | [diff] [blame] | 433 | Should Be Equal ${entry_id} |
Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 434 | ... example.xyz.openbmc_project.Example.Elog.AutoTestSimple |
George Keishing | 184a89a | 2017-06-27 07:12:16 -0500 | [diff] [blame] | 435 | ${entry_id}= Read Attribute ${elog_entry[0]} Severity |
Sweta Potthuri | 9ce8eeb | 2017-05-08 04:20:11 -0500 | [diff] [blame] | 436 | Should Be Equal ${entry_id} |
Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 437 | ... xyz.openbmc_project.Logging.Entry.Level.Error |
George Keishing | 04bc481 | 2017-03-30 03:33:31 -0500 | [diff] [blame] | 438 | |
Sweta Potthuri | 9ce8eeb | 2017-05-08 04:20:11 -0500 | [diff] [blame] | 439 | Delete Error Logs And Verify |
| 440 | [Documentation] Delete all error logs and verify. |
| 441 | |
George Keishing | 6eb10b8 | 2017-06-06 10:02:09 -0500 | [diff] [blame] | 442 | Delete Error Logs |
George Keishing | d397e6a | 2017-08-11 11:19:24 -0500 | [diff] [blame] | 443 | ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}/list quiet=${1} |
Sweta Potthuri | 9ce8eeb | 2017-05-08 04:20:11 -0500 | [diff] [blame] | 444 | Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND} |
George Keishing | 845d9dc | 2017-06-16 14:49:29 -0500 | [diff] [blame] | 445 | |
| 446 | Post Test Case Execution |
| 447 | [Documentation] Do the post test teardown. |
| 448 | # 1. Capture FFDC on test failure. |
| 449 | # 2. Delete error logs. |
| 450 | # 3. Close all open SSH connections. |
| 451 | # 4. Clear all REST sessions. |
| 452 | |
| 453 | FFDC On Test Case Fail |
| 454 | Delete Error Logs |
| 455 | Close All Connections |