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 Teardown   Redfish.Logout
9Test Setup       Printn
10Test Teardown    FFDC On Test Case Fail
11
12
13*** Variables ***
14
15${duration}                 6h
16${interval}                 30s
17${reboot_interval}          30m
18${REDFISH_DELETE_SESSIONS}  ${0}
19
20
21*** Test Cases ***
22
23Create Session And Check Connection Stability
24    [Documentation]  Send heartbeat on session continuously and verify connection stability.
25    [Tags]  Create_Session_And_Check_Connection_Stability
26    [Setup]  Redfish.logout
27
28    # Clear old session and start new session.
29    Redfish.Login
30
31    Repeat Keyword  ${duration}  Send Heartbeat
32
33
34Create Session And Check Connection Stability On Reboot
35    [Documentation]  Create Session And Check Connection Stability On Reboot
36    [Tags]  Create_Session_And_Check_Connection_Stability_On_Reboot
37    [Setup]  Redfish.logout
38
39    # Clear old session and start new session.
40    Redfish.Login
41
42    Repeat Keyword  ${duration}  Check Connection On Reboot
43
44
45*** Keywords ***
46
47Send Heartbeat
48    [Documentation]  Send heartbeat to BMC.
49
50    ${hostname}=  Redfish.Get Attribute  ${REDFISH_NW_PROTOCOL_URI}  HostName
51    Sleep  ${interval}
52
53
54Check Connection On Reboot
55    [Documentation]  Send heartbeat on BMC reboot.
56
57    # Reboot BMC
58    Redfish OBMC Reboot (Off)
59
60    # Verify session is still active and no issues on connection after reboot.
61    Repeat Keyword  ${reboot_interval}  Send Heartbeat
62
63