xref: /openbmc/openbmc-test-automation/redfish/extended/test_os_reboot.robot (revision 7916eb3fd577eedd3ef934e45bf8b557197c9907)
1*** Settings ***
2Documentation   Module to test OS reboot functionality.
3
4Resource        ../../lib/bmc_redfish_resource.robot
5Resource        ../../lib/openbmc_ffdc.robot
6Resource        ../../lib/boot_utils.robot
7
8Suite Setup     Run Key  Start SOL Console Logging
9Test Setup      Redfish.Login
10Test Teardown   Test Teardown Execution
11
12Test Tags       OS_Reboot
13
14*** Variables ***
15
16# User defined boot test iteration.
17${BOOT_LOOP_COUNT}   ${1}
18
19*** Test Cases ***
20
21Host Reboot Loop
22    [Documentation]  Boot OS and trigger reboot and expect
23    ...              OS to boot back.
24    [Tags]  Host_Reboot_Loop
25
26    # 1. Boot OS
27    # 2. Verify OS is booted
28    # 3. Issue "reboot" from OS
29    # 4. Verify if OS is booted back
30
31    # By default run test for 1 loop, else user input iteration.
32    # Fails immediately if any of the execution rounds fail.
33
34    # Note: Host Reboot is implemented by the OBMC Boot Test tool.
35    # OBMC Boot Test will take the necessary steps to get the OBMC
36    # to a host powered on state before attempting the Host Reboot.
37    Repeat Keyword  ${BOOT_LOOP_COUNT} times  RF SYS GracefulRestart
38
39*** Keywords ***
40
41Test Teardown Execution
42    [Documentation]  Do the post test teardown.
43    # 1. Capture FFDC on test failure.
44    # 2. Stop SOL logging.
45    # 3. Close all open SSH connections.
46
47    FFDC On Test Case Fail
48
49    ${keyword_buf}=  Catenate  Stop SOL Console Logging
50    ...  \ targ_file_path=${EXECDIR}${/}logs${/}SOL.log
51    Run Key  ${keyword_buf}
52
53    Close All Connections
54