xref: /openbmc/openbmc-test-automation/redfish/service_root/test_sessions_connection.robot (revision 02d32765119c4d5ce3af989fa3474754b7bbc2f3)
126f9175aSPrashanth Katti*** Settings ***
226f9175aSPrashanth Katti
326f9175aSPrashanth KattiDocumentation    Test Redfish session and its connection stability.
426f9175aSPrashanth Katti
526f9175aSPrashanth KattiResource         ../../lib/bmc_redfish_utils.robot
626f9175aSPrashanth KattiResource         ../../lib/openbmc_ffdc.robot
726f9175aSPrashanth Katti
8*02d32765SYi HuSuite Setup      Set Redfish Delete Session Flag  ${0}
9*02d32765SYi HuSuite Teardown   Run Keywords  Set Redfish Delete Session Flag  ${1}  AND  Redfish.Logout
1026f9175aSPrashanth KattiTest Setup       Printn
1126f9175aSPrashanth KattiTest Teardown    FFDC On Test Case Fail
1226f9175aSPrashanth Katti
1326f9175aSPrashanth Katti
1426f9175aSPrashanth Katti*** Variables ***
1526f9175aSPrashanth Katti
1626f9175aSPrashanth Katti${duration}                 6h
1726f9175aSPrashanth Katti${interval}                 30s
1826f9175aSPrashanth Katti${reboot_interval}          30m
1926f9175aSPrashanth Katti
2026f9175aSPrashanth Katti
2126f9175aSPrashanth Katti*** Test Cases ***
2226f9175aSPrashanth Katti
2326f9175aSPrashanth KattiCreate Session And Check Connection Stability
2489f499d5SGeorge Keishing    [Documentation]  Send heartbeat on session continuously and verify connection stability.
2526f9175aSPrashanth Katti    [Tags]  Create_Session_And_Check_Connection_Stability
2626f9175aSPrashanth Katti    [Setup]  Redfish.logout
2726f9175aSPrashanth Katti
2826f9175aSPrashanth Katti    # Clear old session and start new session.
2926f9175aSPrashanth Katti    Redfish.Login
3026f9175aSPrashanth Katti
3126f9175aSPrashanth Katti    Repeat Keyword  ${duration}  Send Heartbeat
3226f9175aSPrashanth Katti
3326f9175aSPrashanth Katti
3426f9175aSPrashanth KattiCreate Session And Check Connection Stability On Reboot
3526f9175aSPrashanth Katti    [Documentation]  Create Session And Check Connection Stability On Reboot
3626f9175aSPrashanth Katti    [Tags]  Create_Session_And_Check_Connection_Stability_On_Reboot
3726f9175aSPrashanth Katti    [Setup]  Redfish.logout
3826f9175aSPrashanth Katti
3926f9175aSPrashanth Katti    # Clear old session and start new session.
4026f9175aSPrashanth Katti    Redfish.Login
4126f9175aSPrashanth Katti
4226f9175aSPrashanth Katti    Repeat Keyword  ${duration}  Check Connection On Reboot
4326f9175aSPrashanth Katti
4426f9175aSPrashanth Katti
4526f9175aSPrashanth Katti*** Keywords ***
4626f9175aSPrashanth Katti
4726f9175aSPrashanth KattiSend Heartbeat
4826f9175aSPrashanth Katti    [Documentation]  Send heartbeat to BMC.
4926f9175aSPrashanth Katti
5026f9175aSPrashanth Katti    ${hostname}=  Redfish.Get Attribute  ${REDFISH_NW_PROTOCOL_URI}  HostName
5126f9175aSPrashanth Katti    Sleep  ${interval}
5226f9175aSPrashanth Katti
5326f9175aSPrashanth Katti
5426f9175aSPrashanth KattiCheck Connection On Reboot
5526f9175aSPrashanth Katti    [Documentation]  Send heartbeat on BMC reboot.
5626f9175aSPrashanth Katti
5726f9175aSPrashanth Katti    # Reboot BMC
5826f9175aSPrashanth Katti    Redfish OBMC Reboot (Off)
5926f9175aSPrashanth Katti
6026f9175aSPrashanth Katti    # Verify session is still active and no issues on connection after reboot.
6126f9175aSPrashanth Katti    Repeat Keyword  ${reboot_interval}  Send Heartbeat
62