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 88cca7fb8SGeorge Keishing 9b0a491f2SGeorge KeishingTest Setup Test Setup Execution 108cca7fb8SGeorge KeishingTest Teardown Test Teardown Execution 11b0a491f2SGeorge KeishingSuite Teardown Suite Teardown Execution 128cca7fb8SGeorge Keishing 138cca7fb8SGeorge Keishing*** Test Cases *** 148cca7fb8SGeorge Keishing 158cca7fb8SGeorge KeishingEvent Log Check After BMC Reboot 168cca7fb8SGeorge Keishing [Documentation] Check event log after BMC rebooted. 178cca7fb8SGeorge Keishing [Tags] Event_Log_Check_After_BMC_Reboot 188cca7fb8SGeorge Keishing 198cca7fb8SGeorge Keishing Redfish Purge Event Log 208cca7fb8SGeorge Keishing Event Log Should Not Exist 218cca7fb8SGeorge Keishing 228cca7fb8SGeorge Keishing Redfish OBMC Reboot (off) 238cca7fb8SGeorge Keishing 248cca7fb8SGeorge Keishing Redfish.Login 258cca7fb8SGeorge Keishing Wait Until Keyword Succeeds 1 mins 15 secs Redfish.Get ${EVENT_LOG_URI}Entries 268cca7fb8SGeorge Keishing 278cca7fb8SGeorge Keishing Event Log Should Not Exist 288cca7fb8SGeorge Keishing 298cca7fb8SGeorge Keishing 30b0a491f2SGeorge KeishingEvent Log Check After Host Poweron 31b0a491f2SGeorge Keishing [Documentation] Check event log after host has booted. 32b0a491f2SGeorge Keishing [Tags] Event_Log_Check_After_Host_Poweron 33b0a491f2SGeorge Keishing 34b0a491f2SGeorge Keishing Redfish Purge Event Log 35b0a491f2SGeorge Keishing Event Log Should Not Exist 36b0a491f2SGeorge Keishing 37b0a491f2SGeorge Keishing Redfish Power On 38b0a491f2SGeorge Keishing 39b0a491f2SGeorge Keishing Redfish.Login 40b0a491f2SGeorge Keishing Event Log Should Not Exist 41b0a491f2SGeorge Keishing 42b0a491f2SGeorge Keishing 43b0a491f2SGeorge KeishingCreate Test Event Log And Verify 44b0a491f2SGeorge Keishing [Documentation] Create event logs and verify via redfish. 45b0a491f2SGeorge Keishing [Tags] Create_Test_Event_Log_And_Verify 46b0a491f2SGeorge Keishing 47b0a491f2SGeorge Keishing Create Test Error Log 48b0a491f2SGeorge Keishing Event Log Should Exist 49b0a491f2SGeorge Keishing 50b0a491f2SGeorge Keishing 51b0a491f2SGeorge KeishingTest Event Log Persistency On Restart 52b0a491f2SGeorge Keishing [Documentation] Restart logging service and verify event logs. 53b0a491f2SGeorge Keishing [Tags] Test_Event_Log_Persistency_On_Restart 54b0a491f2SGeorge Keishing 55b0a491f2SGeorge Keishing Create Test Error Log 56b0a491f2SGeorge Keishing Event Log Should Exist 57b0a491f2SGeorge Keishing 58b0a491f2SGeorge Keishing BMC Execute Command 59b0a491f2SGeorge Keishing ... systemctl restart xyz.openbmc_project.Logging.service 60b0a491f2SGeorge Keishing Sleep 10s reason=Wait for logging service to restart properly. 61b0a491f2SGeorge Keishing 62b0a491f2SGeorge Keishing Event Log Should Exist 63b0a491f2SGeorge Keishing 64b0a491f2SGeorge Keishing 65b0a491f2SGeorge KeishingTest Event Entry Numbering Reset On Restart 66b0a491f2SGeorge Keishing [Documentation] Restart logging service and verify event logs entry starts 67b0a491f2SGeorge Keishing ... from entry "Id" 1. 68b0a491f2SGeorge Keishing [Tags] Test_Event_Entry_Numbering_Reset_On_Restart 69b0a491f2SGeorge Keishing 70b0a491f2SGeorge Keishing #{ 71b0a491f2SGeorge Keishing # "@odata.context": "/redfish/v1/$metadata#LogEntryCollection.LogEntryCollection", 72b0a491f2SGeorge Keishing # "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries", 73b0a491f2SGeorge Keishing # "@odata.type": "#LogEntryCollection.LogEntryCollection", 74b0a491f2SGeorge Keishing # "Description": "Collection of System Event Log Entries", 75b0a491f2SGeorge Keishing # "Members": [ 76b0a491f2SGeorge Keishing # { 77b0a491f2SGeorge Keishing # "@odata.context": "/redfish/v1/$metadata#LogEntry.LogEntry", 78b0a491f2SGeorge Keishing # "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries/1", 79b0a491f2SGeorge Keishing # "@odata.type": "#LogEntry.v1_4_0.LogEntry", 80b0a491f2SGeorge Keishing # "Created": "2019-05-29T13:19:27+00:00", 81b0a491f2SGeorge Keishing # "EntryType": "Event", 82b0a491f2SGeorge Keishing # "Id": "1", <----- Event log ID 83b0a491f2SGeorge Keishing # "Message": "org.open_power.Host.Error.Event", 84b0a491f2SGeorge Keishing # "Name": "System DBus Event Log Entry", 85b0a491f2SGeorge Keishing # "Severity": "Critical" 86b0a491f2SGeorge Keishing # } 87b0a491f2SGeorge Keishing # ], 88b0a491f2SGeorge Keishing # "Members@odata.count": 1, 89b0a491f2SGeorge Keishing # "Name": "System Event Log Entries" 90b0a491f2SGeorge Keishing #} 91b0a491f2SGeorge Keishing 92b0a491f2SGeorge Keishing Create Test Error Log 93b0a491f2SGeorge Keishing Create Test Error Log 94b0a491f2SGeorge Keishing Event Log Should Exist 95b0a491f2SGeorge Keishing 96b0a491f2SGeorge Keishing Redfish Purge Event Log 97b0a491f2SGeorge Keishing Event Log Should Not Exist 98b0a491f2SGeorge Keishing 99b0a491f2SGeorge Keishing BMC Execute Command 100b0a491f2SGeorge Keishing ... systemctl restart xyz.openbmc_project.Logging.service 101b0a491f2SGeorge Keishing Sleep 10s reason=Wait for logging service to restart properly. 102b0a491f2SGeorge Keishing 103b0a491f2SGeorge Keishing Create Test Error Log 104b0a491f2SGeorge Keishing ${elogs}= Get Event Logs 105b0a491f2SGeorge Keishing Should Be Equal ${elogs[0]["Id"]} 1 msg=Event log entry is not 1. 106b0a491f2SGeorge Keishing 107b0a491f2SGeorge Keishing 108b0a491f2SGeorge KeishingTest Event Log Persistency On Reboot 109b0a491f2SGeorge Keishing [Documentation] Reboot BMC and verify event log. 110b0a491f2SGeorge Keishing [Tags] Test_Event_Log_Persistency_On_Reboot 111b0a491f2SGeorge Keishing 112b0a491f2SGeorge Keishing Redfish Purge Event Log 113b0a491f2SGeorge Keishing Create Test Error Log 114b0a491f2SGeorge Keishing Event Log Should Exist 115b0a491f2SGeorge Keishing 116b0a491f2SGeorge Keishing Redfish OBMC Reboot (off) 117b0a491f2SGeorge Keishing 118b0a491f2SGeorge Keishing Redfish.Login 119b0a491f2SGeorge Keishing Wait Until Keyword Succeeds 1 mins 15 secs Redfish.Get ${EVENT_LOG_URI}Entries 120b0a491f2SGeorge Keishing 121b0a491f2SGeorge Keishing Event Log Should Exist 122b0a491f2SGeorge Keishing 123b0a491f2SGeorge Keishing 124148d08c2SGeorge KeishingCreate Test Event Log And Verify Time Stamp 125148d08c2SGeorge Keishing [Documentation] Create event logs and verify time stamp. 126148d08c2SGeorge Keishing [Tags] Create_Test_Event_Log_And_Verify_Time_Stamp 127148d08c2SGeorge Keishing 128148d08c2SGeorge Keishing #{ 129148d08c2SGeorge Keishing # "@odata.context": "/redfish/v1/$metadata#LogEntryCollection.LogEntryCollection", 130148d08c2SGeorge Keishing # "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries", 131148d08c2SGeorge Keishing # "@odata.type": "#LogEntryCollection.LogEntryCollection", 132148d08c2SGeorge Keishing # "Description": "Collection of System Event Log Entries", 133148d08c2SGeorge Keishing # "Members": [ 134148d08c2SGeorge Keishing # { 135148d08c2SGeorge Keishing # "@odata.context": "/redfish/v1/$metadata#LogEntry.LogEntry", 136148d08c2SGeorge Keishing # "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries/1", 137148d08c2SGeorge Keishing # "@odata.type": "#LogEntry.v1_4_0.LogEntry", 138148d08c2SGeorge Keishing # "Created": "2019-05-29T13:19:27+00:00", <--- Time stamp 139148d08c2SGeorge Keishing # "EntryType": "Event", 140148d08c2SGeorge Keishing # "Id": "1", 141148d08c2SGeorge Keishing # "Message": "org.open_power.Host.Error.Event", 142148d08c2SGeorge Keishing # "Name": "System DBus Event Log Entry", 143148d08c2SGeorge Keishing # "Severity": "Critical" 144148d08c2SGeorge Keishing # } 145148d08c2SGeorge Keishing # ], 146148d08c2SGeorge Keishing # "Members@odata.count": 1, 147148d08c2SGeorge Keishing # "Name": "System Event Log Entries" 148148d08c2SGeorge Keishing #} 149148d08c2SGeorge Keishing 150148d08c2SGeorge Keishing Redfish Purge Event Log 151148d08c2SGeorge Keishing 152148d08c2SGeorge Keishing Create Test Error Log 153148d08c2SGeorge Keishing Sleep 2s 154148d08c2SGeorge Keishing Create Test Error Log 155148d08c2SGeorge Keishing 156148d08c2SGeorge Keishing ${elog_entry}= Get Event Logs 157148d08c2SGeorge Keishing 158148d08c2SGeorge Keishing # The event log generated is associated with the epoc time and unique 159148d08c2SGeorge Keishing # for every error and in increasing time stamp. 160148d08c2SGeorge Keishing ${time_stamp1}= Convert Date ${elog_entry[0]["Created"]} epoch 161148d08c2SGeorge Keishing ${time_stamp2}= Convert Date ${elog_entry[1]["Created"]} epoch 162148d08c2SGeorge Keishing 163148d08c2SGeorge Keishing Should Be True ${time_stamp2} > ${time_stamp1} 164148d08c2SGeorge Keishing 165148d08c2SGeorge Keishing 1660b76e421SGeorge KeishingDelete Non Existing SEL Event Entry 1670b76e421SGeorge Keishing [Documentation] Delete non existing SEL event entry. 1680b76e421SGeorge Keishing [Tags] Delete_Non_Existing_SEL_Event_Entry 1690b76e421SGeorge Keishing 1700b76e421SGeorge Keishing ${sel_delete}= Run Keyword And Expect Error * 1710b76e421SGeorge Keishing ... Run IPMI Standard Command sel delete 100 1720b76e421SGeorge Keishing Should Contain ${sel_delete} Unable to delete entry 1730b76e421SGeorge Keishing ... case_insensitive=True 1740b76e421SGeorge Keishing 1750b76e421SGeorge Keishing 1760b76e421SGeorge KeishingDelete Invalid SEL Event Entry 1770b76e421SGeorge Keishing [Documentation] Delete invalid SEL event entry. 1780b76e421SGeorge Keishing [Tags] Delete_Invalid_SEL_Event_Entry 1790b76e421SGeorge Keishing 1800b76e421SGeorge Keishing ${sel_delete}= Run Keyword And Expect Error * 1810b76e421SGeorge Keishing ... Run IPMI Standard Command sel delete abc 1820b76e421SGeorge Keishing Should Contain ${sel_delete} Given SEL ID 'abc' is invalid 1830b76e421SGeorge Keishing ... case_insensitive=True 1840b76e421SGeorge Keishing 1850b76e421SGeorge Keishing 1860b76e421SGeorge KeishingVerify IPMI SEL Event Entries 1870b76e421SGeorge Keishing [Documentation] Verify IPMI SEL's entries info. 1880b76e421SGeorge Keishing [Tags] Verify_IPMI_SEL_Event_Entries 1890b76e421SGeorge Keishing 1900b76e421SGeorge Keishing # Generate error logs of random count. 1910b76e421SGeorge Keishing ${count}= Evaluate random.randint(1, 5) modules=random 1920b76e421SGeorge Keishing Repeat Keyword ${count} Create Test Error Log 1930b76e421SGeorge Keishing 1940b76e421SGeorge Keishing ${sel_entries_count}= Get IPMI SEL Setting Entries 1950b76e421SGeorge Keishing Should Be Equal As Strings ${sel_entries_count} ${count} 1960b76e421SGeorge Keishing 1970b76e421SGeorge Keishing 1980b76e421SGeorge KeishingVerify IPMI SEL Event Last Add Time 1990b76e421SGeorge Keishing [Documentation] Verify IPMI SEL's last added timestamp. 2000b76e421SGeorge Keishing [Tags] Verify_IPMI_SEL_Event_Last_Add_Time 2010b76e421SGeorge Keishing 2020b76e421SGeorge Keishing Create Test Error Log 2030b76e421SGeorge Keishing ${sel_time}= Run IPMI Standard Command sel time get 2040b76e421SGeorge Keishing ${sel_time}= Convert Date ${sel_time} 2050b76e421SGeorge Keishing ... date_format=%m/%d/%Y %H:%M:%S exclude_millis=True 2060b76e421SGeorge Keishing 2070b76e421SGeorge Keishing ${sel_last_add_time}= Get IPMI SEL Setting Last Add Time 2080b76e421SGeorge Keishing ${sel_last_add_time}= Convert Date ${sel_last_add_time} 2090b76e421SGeorge Keishing ... date_format=%m/%d/%Y %H:%M:%S exclude_millis=True 2100b76e421SGeorge Keishing 2110b76e421SGeorge Keishing ${time_diff}= 2120b76e421SGeorge Keishing ... Subtract Date From Date ${sel_last_add_time} ${sel_time} 2130b76e421SGeorge Keishing 2140b76e421SGeorge Keishing # Verify if the delay in current time check and last add SEL time 2150b76e421SGeorge Keishing # is less or equals to 2 seconds. 2160b76e421SGeorge Keishing Should Be True ${time_diff} <= 2 2170b76e421SGeorge Keishing 2180b76e421SGeorge Keishing 219*d35b5319SGeorge KeishingCreate Test Event Log And Delete 220*d35b5319SGeorge Keishing [Documentation] Create an event log and delete it. 221*d35b5319SGeorge Keishing [Tags] Create_Test_Event_Log_And_Delete 222*d35b5319SGeorge Keishing 223*d35b5319SGeorge Keishing Create Test Error Log 224*d35b5319SGeorge Keishing Redfish Purge Event Log 225*d35b5319SGeorge Keishing Event Log Should Not Exist 226*d35b5319SGeorge Keishing 227*d35b5319SGeorge Keishing 228*d35b5319SGeorge KeishingCreate Multiple Test Event Logs And Delete All 229*d35b5319SGeorge Keishing [Documentation] Create multiple event logs and delete all. 230*d35b5319SGeorge Keishing [Tags] Create_Multiple_Test_Event_Logs_And_Delete_All 231*d35b5319SGeorge Keishing 232*d35b5319SGeorge Keishing Create Test Error Log 233*d35b5319SGeorge Keishing Create Test Error Log 234*d35b5319SGeorge Keishing Create Test Error Log 235*d35b5319SGeorge Keishing Redfish Purge Event Log 236*d35b5319SGeorge Keishing Event Log Should Not Exist 237*d35b5319SGeorge Keishing 238*d35b5319SGeorge Keishing 239*d35b5319SGeorge KeishingVerify Watchdog Timedout Event 240*d35b5319SGeorge Keishing [Documentation] Trigger watchdog timed out and verify event log generated. 241*d35b5319SGeorge Keishing [Tags] Verify_Watchdog_Timedout_Event 242*d35b5319SGeorge Keishing 243*d35b5319SGeorge Keishing Redfish Power On 244*d35b5319SGeorge Keishing 245*d35b5319SGeorge Keishing # Clear errors if there are any. 246*d35b5319SGeorge Keishing Redfish.Login 247*d35b5319SGeorge Keishing Redfish Purge Event Log 248*d35b5319SGeorge Keishing 249*d35b5319SGeorge Keishing Trigger Host Watchdog Error 250*d35b5319SGeorge Keishing 251*d35b5319SGeorge Keishing # Logging takes time to generate the timeout error. 252*d35b5319SGeorge Keishing Wait Until Keyword Succeeds 2 min 30 sec 253*d35b5319SGeorge Keishing ... Verify Watchdog EventLog Content 254*d35b5319SGeorge Keishing 255*d35b5319SGeorge Keishing Redfish Power Off 256*d35b5319SGeorge Keishing 257*d35b5319SGeorge Keishing 258*d35b5319SGeorge KeishingVerify Event Logs Capping 259*d35b5319SGeorge Keishing [Documentation] Verify event logs capping. 260*d35b5319SGeorge Keishing [Tags] Verify_Event_Logs_Capping 261*d35b5319SGeorge Keishing 262*d35b5319SGeorge Keishing Redfish Purge Event Log 263*d35b5319SGeorge Keishing 264*d35b5319SGeorge Keishing ${cmd}= Catenate for i in {1..201}; do /tmp/tarball/bin/logging-test -c 265*d35b5319SGeorge Keishing ... AutoTestSimple; done 266*d35b5319SGeorge Keishing BMC Execute Command ${cmd} 267*d35b5319SGeorge Keishing 268*d35b5319SGeorge Keishing ${elogs}= Get Event Logs 269*d35b5319SGeorge Keishing ${count}= Get Length ${elogs} 270*d35b5319SGeorge Keishing Run Keyword If ${count} > 200 271*d35b5319SGeorge Keishing ... Fail Error logs created exceeded max capacity 200. 272*d35b5319SGeorge Keishing 273*d35b5319SGeorge Keishing 2748cca7fb8SGeorge Keishing*** Keywords *** 2758cca7fb8SGeorge Keishing 2768cca7fb8SGeorge KeishingSuite Teardown Execution 2778cca7fb8SGeorge Keishing [Documentation] Do the post suite teardown. 2788cca7fb8SGeorge Keishing 2798cca7fb8SGeorge Keishing Redfish.Logout 2808cca7fb8SGeorge Keishing 2818cca7fb8SGeorge Keishing 282b0a491f2SGeorge KeishingTest Setup Execution 2838cca7fb8SGeorge Keishing [Documentation] Do test case setup tasks. 2848cca7fb8SGeorge Keishing 2858cca7fb8SGeorge Keishing Redfish.Login 2868cca7fb8SGeorge Keishing 2870b76e421SGeorge Keishing Redfish Purge Event Log 2880b76e421SGeorge Keishing 2898cca7fb8SGeorge Keishing ${status}= Run Keyword And Return Status Logging Test Binary Exist 2908cca7fb8SGeorge Keishing Run Keyword If ${status} == ${False} Install Tarball 2918cca7fb8SGeorge Keishing 2928cca7fb8SGeorge Keishing 2938cca7fb8SGeorge KeishingTest Teardown Execution 2948cca7fb8SGeorge Keishing [Documentation] Do the post test teardown. 2958cca7fb8SGeorge Keishing 2968cca7fb8SGeorge Keishing FFDC On Test Case Fail 297b0a491f2SGeorge Keishing Redfish Purge Event Log 2988cca7fb8SGeorge Keishing 2998cca7fb8SGeorge Keishing 3008cca7fb8SGeorge KeishingEvent Log Should Not Exist 3018cca7fb8SGeorge Keishing [Documentation] Event log entries should not exist. 3028cca7fb8SGeorge Keishing 3038cca7fb8SGeorge Keishing ${elogs}= Get Event Logs 3048cca7fb8SGeorge Keishing Should Be Empty ${elogs} msg=System event log entry is not empty. 305b0a491f2SGeorge Keishing 306b0a491f2SGeorge Keishing 307b0a491f2SGeorge KeishingEvent Log Should Exist 308b0a491f2SGeorge Keishing [Documentation] Event log entries should exist. 309b0a491f2SGeorge Keishing 310b0a491f2SGeorge Keishing ${elogs}= Get Event Logs 311b0a491f2SGeorge Keishing Should Not Be Empty ${elogs} msg=System event log entry is not empty. 312*d35b5319SGeorge Keishing 313*d35b5319SGeorge Keishing 314*d35b5319SGeorge KeishingVerify Watchdog EventLog Content 315*d35b5319SGeorge Keishing [Documentation] Verify watchdog event log content. 316*d35b5319SGeorge Keishing 317*d35b5319SGeorge Keishing # Example: 318*d35b5319SGeorge Keishing # { 319*d35b5319SGeorge Keishing # "@odata.context": "/redfish/v1/$metadata#LogEntry.LogEntry", 320*d35b5319SGeorge Keishing # "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries/31", 321*d35b5319SGeorge Keishing # "@odata.type": "#LogEntry.v1_4_0.LogEntry", 322*d35b5319SGeorge Keishing # "Created": "2019-05-31T18:41:33+00:00", 323*d35b5319SGeorge Keishing # "EntryType": "Event", 324*d35b5319SGeorge Keishing # "Id": "31", 325*d35b5319SGeorge Keishing # "Message": "org.open_power.Host.Boot.Error.WatchdogTimedOut", 326*d35b5319SGeorge Keishing # "Name": "System DBus Event Log Entry", 327*d35b5319SGeorge Keishing # "Severity": "Critical" 328*d35b5319SGeorge Keishing # } 329*d35b5319SGeorge Keishing 330*d35b5319SGeorge Keishing ${elog}= Get Event Logs 331*d35b5319SGeorge Keishing Should Be Equal As Strings 332*d35b5319SGeorge Keishing ... ${elog[0]["Message"]} org.open_power.Host.Boot.Error.WatchdogTimedOut 333*d35b5319SGeorge Keishing ... msg=Watchdog timeout event log was not found. 334*d35b5319SGeorge Keishing Should Be Equal As Strings 335*d35b5319SGeorge Keishing ... ${elog[0]["Severity"]} Critical 336*d35b5319SGeorge Keishing ... msg=Watchdog timeout severity unexpected value. 337