xref: /openbmc/openbmc-test-automation/redfish/test_xit.robot (revision b2a2d948d555cb6e5169b9f21d489a3b089b4387)
1*** Settings ***
2Documentation   This suite is to run some test at the end of execution.
3
4Resource        ../lib/resource.robot
5Resource        ../lib/bmc_redfish_resource.robot
6Resource        ../lib/openbmc_ffdc.robot
7
8Test Teardown   Test Teardown Execution
9
10Test Tags        Test_XIT
11
12*** Variables ***
13
14# Error strings to check from journald.
15${ERROR_REGEX}     SEGV|core-dump|FAILURE|Failed to start|Found ordering cycle
16${SKIP_ERROR}      ${EMPTY}
17
18
19*** Test Cases ***
20
21Verify No BMC Dump And Application Failures In BMC
22    [Documentation]  Verify no BMC dump and application failure exists in BMC.
23    [Tags]  Verify_No_BMC_Dump_And_Application_Failures_In_BMC
24
25    # Check dump entry based on Redfish API availability.
26    Redfish.Login
27    ${resp}=  Redfish.Get  /redfish/v1/Managers/${MANAGER_ID}/LogServices/Dump/Entries
28    ...  valid_status_codes=[${HTTP_OK}, ${HTTP_NOT_FOUND}]
29
30    Log To Console  ${resp}
31
32    IF  '${resp.status}' == '${HTTP_OK}'
33        Should Be Equal As Strings  ${resp.dict["Members@odata.count"]}  0
34        ...  msg=${resp.dict["Members@odata.count"]} dumps exist.
35    END
36
37    Check For Regex In Journald  ${ERROR_REGEX}  error_check=${0}  boot=-b  filter_string=${SKIP_ERROR}
38
39
40*** Keywords ***
41
42Test Teardown Execution
43    [Documentation]  Do test teardown operation.
44
45    FFDC On Test Case Fail
46    # Remove rm command  once the BMC dump APIs are working.
47    Run Keyword And Ignore Error  BMC Execute Command  rm -rf /var/lib/phosphor-debug-collector/dumps/
48    Run Keyword And Ignore Error  Redfish Delete All BMC Dumps
49    Run Keyword And Ignore Error  Redfish Delete All System Dumps
50