xref: /openbmc/openbmc-test-automation/redfish/service_root/test_sessions_connection.robot (revision feb79d60e26d78a6e91521ee41b1af5b8ba71f4c)
1*** Settings ***
2
3Documentation    Test Redfish session and its connection stability.
4
5Resource         ../../lib/bmc_redfish_utils.robot
6Resource         ../../lib/openbmc_ffdc.robot
7
8Suite Setup      Set Redfish Delete Session Flag  ${0}
9Suite Teardown   Run Keywords  Set Redfish Delete Session Flag  ${1}  AND  Redfish.Logout
10Test Setup       Printn
11Test Teardown    FFDC On Test Case Fail
12
13Test Tags        Sessions_Connection
14
15*** Variables ***
16
17${duration}                 6h
18${interval}                 30s
19${reboot_interval}          30m
20
21
22*** Test Cases ***
23
24Create Session And Check Connection Stability
25    [Documentation]  Send heartbeat on session continuously and verify connection stability.
26    [Tags]  Create_Session_And_Check_Connection_Stability
27    [Setup]  Redfish.logout
28
29    # Clear old session and start new session.
30    Redfish.Login
31
32    Repeat Keyword  ${duration}  Send Heartbeat
33
34
35Create Session And Check Connection Stability On Reboot
36    [Documentation]  Create Session And Check Connection Stability On Reboot
37    [Tags]  Create_Session_And_Check_Connection_Stability_On_Reboot
38    [Setup]  Redfish.logout
39
40    # Clear old session and start new session.
41    Redfish.Login
42
43    Repeat Keyword  ${duration}  Check Connection On Reboot
44
45
46*** Keywords ***
47
48Send Heartbeat
49    [Documentation]  Send heartbeat to BMC.
50
51    ${hostname}=  Redfish.Get Attribute  ${REDFISH_NW_PROTOCOL_URI}  HostName
52    Sleep  ${interval}
53
54
55Check Connection On Reboot
56    [Documentation]  Send heartbeat on BMC reboot.
57
58    # Reboot BMC
59    Redfish OBMC Reboot (Off)
60
61    # Verify session is still active and no issues on connection after reboot.
62    Repeat Keyword  ${reboot_interval}  Send Heartbeat
63