1*** Settings ***
2Documentation     BMC error polling test to check errors every 10 seconds.
3
4Resource          ../lib/rest_client.robot
5Resource          ../lib/openbmc_ffdc.robot
6Resource          ../lib/resource.robot
7Resource          ../lib/boot_utils.robot
8Resource          ../lib/boot_utils.robot
9Resource          ../lib/bmc_redfish_resource.robot
10
11Suite Setup      Suite Setup Execution
12Test Teardown    Post Test Case Execution
13
14*** Variables ***
15
16# Default duration and interval of test to run.
17${POLL_DURATION}  48 hours
18${POLL_INTERVAL}  10 second
19
20*** Test Cases ***
21
22Poll BMC For Errors
23    [Documentation]  Poll BMC for errors.
24    ...  exist.
25    [Tags]  Poll_BMC_For_Errors
26
27    Redfish.Login
28    Repeat Keyword  ${POLL_DURATION}
29    ...  Run Keywords  Enumerate Sensors And Check For Errors
30    ...  AND  Sleep  ${POLL_INTERVAL}
31
32*** Keywords ***
33
34Enumerate Sensors And Check For Errors
35    [Documentation]  Enumerate and check if there is any error reported.
36
37    Redfish.Get  /redfish/v1/Chassis/chassis/Sensors
38
39    Error Logs Should Not Exist
40
41
42Suite Setup Execution
43    [Documentation]  Do test setup initialization.
44
45    Should Not Be Empty
46    ...  ${OS_HOST}  msg=You must provide hostname or IP of the OS host.
47    Should Not Be Empty
48    ...  ${OS_USERNAME}  msg=You must provide OS host user name.
49    Should Not Be Empty
50    ...  ${OS_PASSWORD}  msg=You must provide OS host user password.
51
52    Redfish.Login
53    Redfish Power On
54
55    Delete Error Logs
56    Error Logs Should Not Exist
57
58
59Post Test Case Execution
60    [Documentation]  Do the post test teardown.
61    ...  1. Capture FFDC on test failure.
62
63    FFDC On Test Case Fail
64    Redfish.Logout
65