*** Settings ***
Documentation    Test suite to verify if the Robot setup is ready for use.

Resource         ../lib/resource.robot
Resource         ../lib/rest_client.robot
Resource         ../lib/connection_client.robot
Resource         ../lib/ipmi_client.robot
Resource        ../lib/bmc_redfish_resource.robot

*** Test Cases ***

Test Redfish Setup
    [Documentation]  Verify Redfish works.

    Pass Execution If  ${REDFISH_SUPPORT_TRANS_STATE} == ${0}
    ...  Skipping Redfish check, user explicitly requested for REST.

    Redfish.Login
    Redfish.Get  /redfish/v1/
    Redfish.Logout


Test REST Setup
    [Documentation]  Verify REST works.

    Pass Execution If  ${REDFISH_SUPPORT_TRANS_STATE} == ${1}
    ...  Skipping REST check, user explicitly requested for Redfish.

    # REST Connection and request.
    Initialize OpenBMC
    # Raw GET REST operation to verify session is established.
    ${resp}=  Get Request  openbmc  /xyz/openbmc_project/
    Should Be Equal As Strings  ${resp.status_code}  ${HTTP_OK}
    ${content}=  To JSON  ${resp.content}  pretty_print=True
    Log To Console  \n ${content}


Test SSH Setup
    [Documentation]  Verify SSH works.

    BMC Execute Command  uname -a


Test IPMI Setup
    [Documentation]  Verify Out-of-band works.

    ${chassis_status}=  Run IPMI Standard Command  chassis status
    Log To Console  \n ${chassis_status}

*** Settings ***
Documentation    Test suite to verify if the Robot setup is ready for use.

Resource         ../lib/resource.robot
Resource         ../lib/rest_client.robot
Resource         ../lib/connection_client.robot
Resource         ../lib/ipmi_client.robot
Resource        ../lib/bmc_redfish_resource.robot

*** Test Cases ***

Test Redfish Setup
    [Documentation]  Verify Redfish works.

    Skip If  ${REDFISH_SUPPORT_TRANS_STATE} == ${0}
    ...  Skipping Redfish check, user explicitly requested for REST.

    Redfish.Login
    Redfish.Get  /redfish/v1/
    Redfish.Logout


Test REST Setup
    [Documentation]  Verify REST works.

    Skip If  ${REDFISH_SUPPORT_TRANS_STATE} == ${1}
    ...  Skipping REST check, user explicitly requested for Redfish.

    # REST Connection and request.
    Initialize OpenBMC
    # Raw GET REST operation to verify session is established.
    ${resp}=  Get Request  openbmc  /xyz/openbmc_project/
    Should Be Equal As Strings  ${resp.status_code}  ${HTTP_OK}
    ${content}=  To JSON  ${resp.content}  pretty_print=True
    Log To Console  \n ${content}


Test SSH Setup
    [Documentation]  Verify SSH works.

    BMC Execute Command  uname -a


Test IPMI Setup
    [Documentation]  Verify Out-of-band works.

    ${chassis_status}=  Run IPMI Standard Command  chassis status
    Log To Console  \n ${chassis_status}

Test setup template to skip REST vs redfish
Test setup template to skip REST vs redfish

The 'Skip If' keyword is in higher level
robotframework 4.1.3

Resolves  openbmc/openbmc-test-automation#2175

Change-Id: Ib1edb2ed8bb76973abde41fecd17db6b2697e752
Signed-off-by: George Keishing <bef0a9ecac45fb57611777c8270153994e13fd2e@in.ibm.com>

openbmc/openbmc-test-automation,openbmc/openbmc-test-automation