1*** Settings ***
2Documentation    Test suite to verify if the Robot setup is ready for use.
3
4Resource         ../lib/resource.robot
5Resource         ../lib/rest_client.robot
6Resource         ../lib/connection_client.robot
7Resource         ../lib/ipmi_client.robot
8Resource        ../lib/bmc_redfish_resource.robot
9
10*** Test Cases ***
11
12Test Redfish Setup
13    [Documentation]  Verify Redfish works.
14
15    Skip If  ${REDFISH_SUPPORT_TRANS_STATE} == ${0}
16    ...  Skipping Redfish check, user explicitly requested for REST.
17
18    Redfish.Login
19    Redfish.Get  /redfish/v1/
20    Redfish.Logout
21
22
23Test REST Setup
24    [Documentation]  Verify REST works.
25
26    Skip If  ${REDFISH_SUPPORT_TRANS_STATE} == ${1}
27    ...  Skipping REST check, user explicitly requested for Redfish.
28
29    # REST Connection and request.
30    Initialize OpenBMC
31    # Raw GET REST operation to verify session is established.
32    ${resp}=  GET On Session  openbmc  /xyz/openbmc_project/  expected_status=any
33    Should Be Equal As Strings  ${resp.status_code}  ${HTTP_OK}
34    Log To Console  \n ${resp.json()}
35
36
37Test SSH Setup
38    [Documentation]  Verify SSH works.
39
40    ${stdout}  ${stderr}  ${rc}=  BMC Execute Command  uname -a  print_out=1  print_err=1
41    IF  ${rc}
42        Fail    BMC SSH login failed.
43    END
44
45
46Test IPMI Setup
47    [Documentation]  Verify Out-of-band works.
48
49    ${chassis_status}=  Run IPMI Standard Command  chassis status
50    Log To Console  \n ${chassis_status}
51