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 | |
George Keishing | 95c371a | 2017-09-14 15:42:33 -0500 | [diff] [blame] | 11 | Test Setup Test Setup Execution |
George Keishing | fa2fc16 | 2018-01-08 07:41:13 -0600 | [diff] [blame] | 12 | Test Teardown Test Teardown Execution |
George Keishing | 184a89a | 2017-06-27 07:12:16 -0500 | [diff] [blame] | 13 | Suite Teardown Delete Error Logs And Verify |
Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 14 | |
George Keishing | 1d82dd1 | 2017-07-24 01:16:23 -0500 | [diff] [blame] | 15 | *** Variables *** |
| 16 | |
| 17 | ${stack_mode} skip |
| 18 | |
Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 19 | *** Test Cases *** |
| 20 | |
George Keishing | 1d82dd1 | 2017-07-24 01:16:23 -0500 | [diff] [blame] | 21 | Error Log Check After BMC Reboot |
| 22 | [Documentation] Check error log after BMC rebooted. |
| 23 | [Tags] Error_Log_Check_At_BMC_Ready |
| 24 | # 1. Power off. |
| 25 | # 2. Delete error logs. |
| 26 | # 3. Reboot BMC. |
| 27 | # 4. Check if eror log exists. |
| 28 | |
George Keishing | 3f4a3eb | 2017-09-26 10:33:16 -0500 | [diff] [blame] | 29 | Smart Power Off |
George Keishing | 1d82dd1 | 2017-07-24 01:16:23 -0500 | [diff] [blame] | 30 | Delete Error Logs And Verify |
George Keishing | 3f4a3eb | 2017-09-26 10:33:16 -0500 | [diff] [blame] | 31 | OBMC Reboot (off) stack_mode=normal |
George Keishing | 1d82dd1 | 2017-07-24 01:16:23 -0500 | [diff] [blame] | 32 | Error Logs Should Not Exist |
| 33 | |
| 34 | |
| 35 | Error Log Check After Host Poweron |
| 36 | [Documentation] Check error log after host has booted. |
| 37 | [Tags] Error_Log_Check_At_Host_Booted |
| 38 | # 1. Delete error logs |
| 39 | # 1. Power on. |
| 40 | # 3. Check if eror log exists. |
| 41 | |
| 42 | Delete Error Logs And Verify |
| 43 | REST Power On |
| 44 | Error Logs Should Not Exist |
| 45 | |
| 46 | |
Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 47 | Create Test Error And Verify |
| 48 | [Documentation] Create error logs and verify via REST. |
| 49 | [Tags] Create_Test_Error_And_Verify |
| 50 | |
| 51 | Create Test Error Log |
| 52 | Verify Test Error Log |
| 53 | |
| 54 | |
| 55 | Test Error Persistency On Restart |
George Keishing | 184a89a | 2017-06-27 07:12:16 -0500 | [diff] [blame] | 56 | [Documentation] Restart logging service and verify error logs. |
Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 57 | [Tags] Test_Error_Persistency_On_Restart |
| 58 | |
| 59 | Create Test Error Log |
| 60 | Verify Test Error Log |
| 61 | Execute Command On BMC |
| 62 | ... systemctl restart xyz.openbmc_project.Logging.service |
| 63 | Sleep 10s reason=Wait for logging service to restart properly. |
George Keishing | 184a89a | 2017-06-27 07:12:16 -0500 | [diff] [blame] | 64 | Verify Test Error Log |
Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 65 | |
| 66 | |
George Keishing | 742b060 | 2017-07-28 14:20:53 -0500 | [diff] [blame] | 67 | Test Error Entry Numbering Reset On Restart |
| 68 | [Documentation] Restarts logging service and verify error logs entry start |
| 69 | ... from entry "Id" 1. |
| 70 | # 1. Create error log. |
| 71 | # 2. Verify error log. |
| 72 | # 3. Delete error log. |
| 73 | # 4. Restart logging service. |
| 74 | # 5. Create error log. |
| 75 | # 6. Verify new error log entry starts with Id entry 1. |
| 76 | |
| 77 | [Tags] Test_Error_Entry_Numbering_Reset_On_Restart |
| 78 | # Example Error logs: |
| 79 | # "/xyz/openbmc_project/logging/entry/1": { |
| 80 | # "AdditionalData": [ |
| 81 | # "STRING=FOO" |
| 82 | # ], |
| 83 | # "Id": 1, <--- Entry value should be 1. |
| 84 | # "Message": "example.xyz.openbmc_project.Example.Elog.AutoTestSimple", |
| 85 | # "Resolved": 0, |
| 86 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error", |
| 87 | # "Timestamp": 1490818990051, |
| 88 | # "associations": [] |
| 89 | # }, |
| 90 | |
| 91 | Create Test Error Log |
| 92 | Verify Test Error Log |
George Keishing | cc71c3c | 2017-09-20 09:38:03 -0500 | [diff] [blame] | 93 | Delete All Error Logs |
George Keishing | 742b060 | 2017-07-28 14:20:53 -0500 | [diff] [blame] | 94 | Execute Command On BMC |
| 95 | ... systemctl restart xyz.openbmc_project.Logging.service |
| 96 | Sleep 10s reason=Wait for logging service to restart properly. |
| 97 | Create Test Error Log |
| 98 | ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY} |
| 99 | ${entry_id}= Read Attribute ${elog_entry[0]} Id |
| 100 | Should Be Equal ${entry_id} ${1} |
| 101 | |
| 102 | |
Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 103 | Test Error Persistency On Reboot |
George Keishing | 184a89a | 2017-06-27 07:12:16 -0500 | [diff] [blame] | 104 | [Documentation] Reboot BMC and verify error logs. |
Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 105 | [Tags] Test_Error_Persistency_On_Reboot |
| 106 | |
| 107 | Create Test Error Log |
| 108 | Verify Test Error Log |
| 109 | Initiate BMC Reboot |
| 110 | Wait Until Keyword Succeeds 10 min 10 sec |
| 111 | ... Is BMC Ready |
George Keishing | 184a89a | 2017-06-27 07:12:16 -0500 | [diff] [blame] | 112 | Verify Test Error Log |
Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 113 | |
| 114 | |
George Keishing | 04bc481 | 2017-03-30 03:33:31 -0500 | [diff] [blame] | 115 | Create Test Error And Verify Resolved Field |
| 116 | [Documentation] Create error log and verify "Resolved" |
| 117 | ... field is 0. |
| 118 | [Tags] Create_Test_Error_And_Verify_Resolved_Field |
| 119 | |
| 120 | # Example Error log: |
| 121 | # "/xyz/openbmc_project/logging/entry/1": { |
| 122 | # "AdditionalData": [ |
| 123 | # "STRING=FOO" |
| 124 | # ], |
| 125 | # "Id": 1, |
| 126 | # "Message": "example.xyz.openbmc_project.Example.Elog.AutoTestSimple", |
| 127 | # "Resolved": 0, |
| 128 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error", |
| 129 | # "Timestamp": 1490817164983, |
| 130 | # "associations": [] |
| 131 | # }, |
| 132 | |
| 133 | # It's work in progress, but it's mnfg need. To mark an error as |
| 134 | # resolved, without deleting the error, mfg will set this bool |
| 135 | # property. |
| 136 | # In this test context we are making sure "Resolved" field is "0" |
| 137 | # by default. |
| 138 | |
George Keishing | cc71c3c | 2017-09-20 09:38:03 -0500 | [diff] [blame] | 139 | Delete All Error Logs |
George Keishing | 04bc481 | 2017-03-30 03:33:31 -0500 | [diff] [blame] | 140 | Create Test Error Log |
George Keishing | 184a89a | 2017-06-27 07:12:16 -0500 | [diff] [blame] | 141 | ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY} |
| 142 | ${resolved}= Read Attribute ${elog_entry[0]} Resolved |
George Keishing | 04bc481 | 2017-03-30 03:33:31 -0500 | [diff] [blame] | 143 | Should Be True ${resolved} == 0 |
| 144 | |
| 145 | |
| 146 | Create Test Errors And Verify Time Stamp |
| 147 | [Documentation] Create error logs and verify time stamp. |
| 148 | [Tags] Create_Test_Error_And_Verify_Time_Stamp |
| 149 | |
| 150 | # Example Error logs: |
| 151 | # "/xyz/openbmc_project/logging/entry/1": { |
| 152 | # "AdditionalData": [ |
| 153 | # "STRING=FOO" |
| 154 | # ], |
| 155 | # "Id": 1, |
| 156 | # "Message": "example.xyz.openbmc_project.Example.Elog.AutoTestSimple", |
| 157 | # "Resolved": 0, |
| 158 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error", |
| 159 | # "Timestamp": 1490818990051, <--- Time stamp |
| 160 | # "associations": [] |
| 161 | # }, |
| 162 | # "/xyz/openbmc_project/logging/entry/2": { |
| 163 | # "AdditionalData": [ |
| 164 | # "STRING=FOO" |
| 165 | # ], |
| 166 | # "Id": 2, |
| 167 | # "Message": "example.xyz.openbmc_project.Example.Elog.AutoTestSimple", |
| 168 | # "Resolved": 0, |
| 169 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error", |
| 170 | # "Timestamp": 1490818992116, <---- Time stamp |
| 171 | # "associations": [] |
| 172 | # }, |
| 173 | |
George Keishing | cc71c3c | 2017-09-20 09:38:03 -0500 | [diff] [blame] | 174 | Delete All Error Logs |
George Keishing | 04bc481 | 2017-03-30 03:33:31 -0500 | [diff] [blame] | 175 | Create Test Error Log |
| 176 | Create Test Error Log |
| 177 | # The error log generated is associated with the epoc time and unique |
| 178 | # for every error and in increasing time stamp. |
George Keishing | 184a89a | 2017-06-27 07:12:16 -0500 | [diff] [blame] | 179 | ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY} |
| 180 | ${time_stamp1}= Read Attribute ${elog_entry[0]} Timestamp |
| 181 | ${time_stamp2}= Read Attribute ${elog_entry[1]} Timestamp |
George Keishing | 6eb10b8 | 2017-06-06 10:02:09 -0500 | [diff] [blame] | 182 | Should Be True ${time_stamp2} > ${time_stamp1} |
George Keishing | 04bc481 | 2017-03-30 03:33:31 -0500 | [diff] [blame] | 183 | |
Sweta Potthuri | 9ce8eeb | 2017-05-08 04:20:11 -0500 | [diff] [blame] | 184 | Create Test Error Log And Delete |
| 185 | [Documentation] Create an error log and delete it. |
| 186 | [Tags] Create_Test_Error_Log_And_Delete |
| 187 | |
| 188 | Delete Error Logs And Verify |
| 189 | Create Test Error Log |
| 190 | Delete Error Logs And Verify |
| 191 | |
| 192 | Create Multiple Test Error Logs And Delete All |
| 193 | [Documentation] Create multiple error logs and delete all. |
| 194 | [Tags] Create_Multiple_Test_Error_Logs_And_Delete_All |
| 195 | |
| 196 | Delete Error Logs And Verify |
| 197 | Create Test Error Log |
| 198 | Create Test Error Log |
| 199 | Create Test Error Log |
| 200 | Delete Error Logs And Verify |
| 201 | |
| 202 | Create Two Test Error Logs And Delete One |
| 203 | [Documentation] Create two error logs and delete the first entry. |
| 204 | [Tags] Create_Two_Test_Error_Logs_And_Delete_One |
| 205 | |
| 206 | Delete Error Logs And Verify |
| 207 | Create Test Error Log |
George Keishing | 184a89a | 2017-06-27 07:12:16 -0500 | [diff] [blame] | 208 | ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY} |
Sweta Potthuri | 9ce8eeb | 2017-05-08 04:20:11 -0500 | [diff] [blame] | 209 | Create Test Error Log |
George Keishing | 184a89a | 2017-06-27 07:12:16 -0500 | [diff] [blame] | 210 | Delete Error log Entry ${elog_entry[0]} |
| 211 | ${resp}= OpenBMC Get Request ${elog_entry[0]} |
Sweta Potthuri | 9ce8eeb | 2017-05-08 04:20:11 -0500 | [diff] [blame] | 212 | Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND} |
George Keishing | 04bc481 | 2017-03-30 03:33:31 -0500 | [diff] [blame] | 213 | |
Rahul Maheshwari | 92972e7 | 2017-06-22 00:59:59 -0500 | [diff] [blame] | 214 | |
| 215 | Verify IPMI SEL Version |
| 216 | [Documentation] Verify IPMI SEL's version info. |
| 217 | [Tags] Verify_IPMI_SEL_Version |
| 218 | |
| 219 | ${version_info}= Get IPMI SEL Setting Version |
| 220 | ${setting_status}= Fetch From Left ${version_info} ( |
| 221 | ${setting_status}= Evaluate $setting_status.replace(' ','') |
| 222 | |
| 223 | Should Be True ${setting_status} >= 1.5 |
Rahul Maheshwari | b44b6ec | 2017-07-05 00:23:03 -0500 | [diff] [blame] | 224 | Should Contain ${version_info} v2 compliant case_insensitive=True |
Rahul Maheshwari | 92972e7 | 2017-06-22 00:59:59 -0500 | [diff] [blame] | 225 | |
| 226 | |
George Keishing | 845d9dc | 2017-06-16 14:49:29 -0500 | [diff] [blame] | 227 | Verify Watchdog Timedout Error |
| 228 | [Documentation] Trigger watchdog timed out and verify errorlog generated. |
| 229 | [Tags] Verify_Watchdog_Timedout_Error |
| 230 | |
George Keishing | d397e6a | 2017-08-11 11:19:24 -0500 | [diff] [blame] | 231 | REST Power Off |
| 232 | REST Power On |
| 233 | |
George Keishing | 845d9dc | 2017-06-16 14:49:29 -0500 | [diff] [blame] | 234 | # Clear errors if there are any. |
George Keishing | cc71c3c | 2017-09-20 09:38:03 -0500 | [diff] [blame] | 235 | Delete All Error Logs |
George Keishing | 845d9dc | 2017-06-16 14:49:29 -0500 | [diff] [blame] | 236 | |
George Keishing | 845d9dc | 2017-06-16 14:49:29 -0500 | [diff] [blame] | 237 | Trigger Host Watchdog Error |
| 238 | |
George Keishing | 45921ea | 2017-11-23 04:32:56 -0600 | [diff] [blame] | 239 | # Logging took time to generate the timedout error. |
| 240 | Wait Until Keyword Succeeds 2 min 30 sec |
| 241 | ... Verify Watchdog Errorlog Content |
George Keishing | 845d9dc | 2017-06-16 14:49:29 -0500 | [diff] [blame] | 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 |
George Keishing | fa2fc16 | 2018-01-08 07:41:13 -0600 | [diff] [blame] | 338 | ${cmd}= Catenate for i in {1..201}; do /tmp/tarball/bin/logging-test -c |
| 339 | ... AutoTestSimple; done |
Sweta Potthuri | 96d8249 | 2017-08-23 09:03:38 -0500 | [diff] [blame] | 340 | Execute Command On BMC ${cmd} |
| 341 | ${count}= Count Error Entries |
George Keishing | fa2fc16 | 2018-01-08 07:41:13 -0600 | [diff] [blame] | 342 | Run Keyword If ${count} > 200 |
| 343 | ... Fail Error logs created exceeded max capacity 200. |
Rahul Maheshwari | b44b6ec | 2017-07-05 00:23:03 -0500 | [diff] [blame] | 344 | |
Sweta Potthuri | d9e746e | 2018-01-08 09:38:42 -0600 | [diff] [blame] | 345 | Test Error Log Rotation |
| 346 | [Documentation] Verify creation of 201 error log is replaced by entry id 1. |
| 347 | [Tags] Test_Error_Log_Rotation |
| 348 | |
| 349 | Delete Error Logs And Verify |
| 350 | |
| 351 | # Restart service. |
| 352 | BMC Execute Command |
| 353 | ... systemctl restart xyz.openbmc_project.Logging.service |
| 354 | Sleep 10s reason=Wait for logging service to restart properly. |
| 355 | |
| 356 | # Create 200 error logs. |
| 357 | ${cmd}= Catenate for i in {1..200}; do /tmp/tarball/bin/logging-test -c |
| 358 | ... AutoTestSimple;done |
| 359 | BMC Execute Command ${cmd} |
| 360 | |
| 361 | # Check the response for 200th error log. |
| 362 | ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}${200} |
| 363 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 364 | |
| 365 | # Check if error log with id 1 exists. |
| 366 | ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}${1} |
| 367 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 368 | |
| 369 | # Create error log and verify the entry ID is 201 and not 1. |
| 370 | Create Test Error Log |
| 371 | ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}${201} |
| 372 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 373 | |
| 374 | # Error log 1 is not present. |
| 375 | ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}${1} |
| 376 | Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 377 | |
Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 378 | *** Keywords *** |
| 379 | |
Rahul Maheshwari | 92972e7 | 2017-06-22 00:59:59 -0500 | [diff] [blame] | 380 | Get IPMI SEL Setting |
| 381 | [Documentation] Returns status for given IPMI SEL setting. |
| 382 | [Arguments] ${setting} |
| 383 | # Description of argument(s): |
| 384 | # setting SEL setting which needs to be read(e.g. "Last Add Time"). |
| 385 | |
| 386 | ${resp}= Run IPMI Standard Command sel info |
| 387 | |
| 388 | ${setting_line}= Get Lines Containing String ${resp} ${setting} |
| 389 | ... case-insensitive |
Rahul Maheshwari | b44b6ec | 2017-07-05 00:23:03 -0500 | [diff] [blame] | 390 | ${setting_status}= Fetch From Right ${setting_line} :${SPACE} |
Rahul Maheshwari | 92972e7 | 2017-06-22 00:59:59 -0500 | [diff] [blame] | 391 | |
| 392 | [Return] ${setting_status} |
| 393 | |
| 394 | |
George Keishing | 845d9dc | 2017-06-16 14:49:29 -0500 | [diff] [blame] | 395 | Verify Watchdog Errorlog Content |
| 396 | [Documentation] Verify watchdog errorlog content. |
| 397 | # Example: |
| 398 | # "/xyz/openbmc_project/logging/entry/1": |
| 399 | # { |
| 400 | # "AdditionalData": [], |
| 401 | # "Id": 1, |
George Keishing | 27405ee | 2017-11-18 04:45:04 -0600 | [diff] [blame] | 402 | # "Message": "org.open_power.Host.Boot.Error.WatchdogTimedOut", |
George Keishing | 845d9dc | 2017-06-16 14:49:29 -0500 | [diff] [blame] | 403 | # "Resolved": 0, |
George Keishing | 27405ee | 2017-11-18 04:45:04 -0600 | [diff] [blame] | 404 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error", |
George Keishing | 845d9dc | 2017-06-16 14:49:29 -0500 | [diff] [blame] | 405 | # "Timestamp": 1492715244828, |
| 406 | # "associations": [] |
| 407 | # }, |
| 408 | |
George Keishing | 184a89a | 2017-06-27 07:12:16 -0500 | [diff] [blame] | 409 | ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY} |
| 410 | ${elog}= Read Properties ${elog_entry[0]} |
George Keishing | 845d9dc | 2017-06-16 14:49:29 -0500 | [diff] [blame] | 411 | Should Be Equal As Strings |
George Keishing | 27405ee | 2017-11-18 04:45:04 -0600 | [diff] [blame] | 412 | ... ${elog["Message"]} org.open_power.Host.Boot.Error.WatchdogTimedOut |
| 413 | Should Be Equal As Strings |
| 414 | ... ${elog["Severity"]} xyz.openbmc_project.Logging.Entry.Level.Error |
George Keishing | 845d9dc | 2017-06-16 14:49:29 -0500 | [diff] [blame] | 415 | |
| 416 | |
George Keishing | 95c371a | 2017-09-14 15:42:33 -0500 | [diff] [blame] | 417 | Logging Test Binary Exist |
Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 418 | [Documentation] Verify existence of prerequisite logging-test. |
| 419 | |
| 420 | Open Connection And Log In |
George Keishing | 95c371a | 2017-09-14 15:42:33 -0500 | [diff] [blame] | 421 | ${out} ${stderr}= Execute Command |
| 422 | ... which /tmp/tarball/bin/logging-test return_stderr=True |
Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 423 | Should Be Empty ${stderr} |
| 424 | Should Contain ${out} logging-test |
| 425 | |
| 426 | Clear Existing Error Logs |
| 427 | [Documentation] If error log isn't empty, reboot the BMC to clear the log. |
| 428 | |
| 429 | ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}${1} |
| 430 | Return From Keyword If ${resp.status_code} == ${HTTP_NOT_FOUND} |
| 431 | Initiate BMC Reboot |
| 432 | Wait Until Keyword Succeeds 10 min 10 sec |
| 433 | ... Is BMC Ready |
| 434 | ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}${1} |
| 435 | Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 436 | |
| 437 | Create Test Error Log |
| 438 | [Documentation] Generate test error log. |
| 439 | |
| 440 | # Test error log entry example: |
| 441 | # "/xyz/openbmc_project/logging/entry/1": { |
| 442 | # "AdditionalData": [ |
| 443 | # "STRING=FOO" |
| 444 | # ], |
| 445 | # "Id": 1, |
| 446 | # "Message": "example.xyz.openbmc_project.Example.Elog.AutoTestSimple", |
| 447 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error", |
| 448 | # "Timestamp": 1487743963328, |
| 449 | # "associations": [] |
| 450 | # } |
| 451 | |
George Keishing | 95c371a | 2017-09-14 15:42:33 -0500 | [diff] [blame] | 452 | Execute Command On BMC /tmp/tarball/bin/logging-test -c AutoTestSimple |
Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 453 | |
Sweta Potthuri | 96d8249 | 2017-08-23 09:03:38 -0500 | [diff] [blame] | 454 | Count Error Entries |
| 455 | [Documentation] Count Error entries. |
| 456 | |
| 457 | ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY} |
| 458 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 459 | ${jsondata}= To JSON ${resp.content} |
| 460 | ${count}= Get Length ${jsondata["data"]} |
| 461 | [Return] ${count} |
| 462 | |
Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 463 | Verify Test Error Log |
| 464 | [Documentation] Verify test error log entries. |
George Keishing | 184a89a | 2017-06-27 07:12:16 -0500 | [diff] [blame] | 465 | ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY} |
| 466 | ${entry_id}= Read Attribute ${elog_entry[0]} Message |
Sweta Potthuri | 9ce8eeb | 2017-05-08 04:20:11 -0500 | [diff] [blame] | 467 | Should Be Equal ${entry_id} |
Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 468 | ... example.xyz.openbmc_project.Example.Elog.AutoTestSimple |
George Keishing | 184a89a | 2017-06-27 07:12:16 -0500 | [diff] [blame] | 469 | ${entry_id}= Read Attribute ${elog_entry[0]} Severity |
Sweta Potthuri | 9ce8eeb | 2017-05-08 04:20:11 -0500 | [diff] [blame] | 470 | Should Be Equal ${entry_id} |
Michael Tritz | 935c18e | 2017-03-08 11:45:41 -0600 | [diff] [blame] | 471 | ... xyz.openbmc_project.Logging.Entry.Level.Error |
George Keishing | 04bc481 | 2017-03-30 03:33:31 -0500 | [diff] [blame] | 472 | |
Sweta Potthuri | 9ce8eeb | 2017-05-08 04:20:11 -0500 | [diff] [blame] | 473 | Delete Error Logs And Verify |
| 474 | [Documentation] Delete all error logs and verify. |
| 475 | |
George Keishing | cc71c3c | 2017-09-20 09:38:03 -0500 | [diff] [blame] | 476 | Delete All Error Logs |
George Keishing | d397e6a | 2017-08-11 11:19:24 -0500 | [diff] [blame] | 477 | ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}/list quiet=${1} |
Sweta Potthuri | 9ce8eeb | 2017-05-08 04:20:11 -0500 | [diff] [blame] | 478 | Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND} |
George Keishing | 845d9dc | 2017-06-16 14:49:29 -0500 | [diff] [blame] | 479 | |
George Keishing | 95c371a | 2017-09-14 15:42:33 -0500 | [diff] [blame] | 480 | |
| 481 | Test Setup Execution |
| 482 | [Documentation] Do test case setup tasks. |
| 483 | |
| 484 | ${status}= Run Keyword And Return Status Logging Test Binary Exist |
| 485 | Run Keyword If ${status} == ${False} Install Tarball |
| 486 | Delete Error Logs And Verify |
| 487 | |
| 488 | |
| 489 | Install Tarball |
| 490 | [Documentation] Install tarball on BMC. |
| 491 | |
| 492 | Run Keyword If '${DEBUG_TARBALL_PATH}' == '${EMPTY}' Return From Keyword |
| 493 | BMC Execute Command rm -rf /tmp/tarball |
| 494 | Install Debug Tarball On BMC ${DEBUG_TARBALL_PATH} |
| 495 | |
| 496 | |
George Keishing | fa2fc16 | 2018-01-08 07:41:13 -0600 | [diff] [blame] | 497 | Test Teardown Execution |
George Keishing | 845d9dc | 2017-06-16 14:49:29 -0500 | [diff] [blame] | 498 | [Documentation] Do the post test teardown. |
| 499 | # 1. Capture FFDC on test failure. |
| 500 | # 2. Delete error logs. |
| 501 | # 3. Close all open SSH connections. |
| 502 | # 4. Clear all REST sessions. |
| 503 | |
| 504 | FFDC On Test Case Fail |
George Keishing | cc71c3c | 2017-09-20 09:38:03 -0500 | [diff] [blame] | 505 | Delete All Error Logs |
George Keishing | 845d9dc | 2017-06-16 14:49:29 -0500 | [diff] [blame] | 506 | Close All Connections |