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
8
9Suite Setup      Suite Setup Execution
10Test Teardown    Post Test Case Execution
11
12*** Variables ***
13
14# Default duration and interval of test to run.
15${POLL_DURATION}  48 hours
16${POLL_INTERVAL}  10 second
17
18*** Test Cases ***
19
20Poll BMC For Errors
21    [Documentation]  Poll BMC for errors.
22    ...  exist.
23    [Tags]  Poll_BMC_For_Errors
24
25    Repeat Keyword  ${POLL_DURATION}
26    ...  Run Keywords  Enumerate Sensors And Check For Errors
27    ...  AND  Sleep  ${POLL_INTERVAL}
28
29*** Keywords ***
30
31Enumerate Sensors And Check For Errors
32    [Documentation]  Enumerate and check if there is any error reported.
33
34    ${resp}=  OpenBMC Get Request  /xyz/openbmc_project/sensors/
35    Should Be Equal As Strings  ${resp.status_code}  ${HTTP_OK}
36
37    Error Logs Should Not Exist
38
39
40Suite Setup Execution
41    [Documentation]  Do test setup initialization.
42
43    Should Not Be Empty
44    ...  ${OS_HOST}  msg=You must provide hostname or IP of the OS host.
45    Should Not Be Empty
46    ...  ${OS_USERNAME}  msg=You must provide OS host user name.
47    Should Not Be Empty
48    ...  ${OS_PASSWORD}  msg=You must provide OS host user password.
49
50    # Boot to OS.
51    REST Power On
52
53    Delete Error Logs
54    Error Logs Should Not Exist
55
56Post Test Case Execution
57    [Documentation]  Do the post test teardown.
58    ...  1. Capture FFDC on test failure.
59
60    FFDC On Test Case Fail
61