xref: /openbmc/openbmc-test-automation/extended/test_bmc_reset_loop.robot (revision 9571a93c44b128a9552369e6c62a38cdca303f5b)
1*** Settings ***
2Documentation   Power cycle loop. This is to test where network service
3...             becomes unavailable during AC-Cycle stress test.
4
5Resource        ../lib/rest_client.robot
6Resource        ../lib/pdu/pdu.robot
7Resource        ../lib/utils.robot
8Resource        ../lib/openbmc_ffdc.robot
9Resource        ../lib/state_manager.robot
10Resource        ../lib/boot_utils.robot
11
12Test Teardown   Test Exit Logs
13
14*** Variables ***
15${LOOP_COUNT}    ${50}
16
17*** Test Cases ***
18
19Run Multiple Power Cycle
20    [Documentation]  Execute multiple power cycles.
21    [Setup]  Validate Parameters
22    [Tags]  Run_Multiple_Power_Cycle
23
24    # By default run test for 50 loops, else user input iteration.
25    # Fails immediately if any of the execution rounds fail and
26    # check if BMC is still pinging and FFDC is collected.
27    Repeat Keyword  ${LOOP_COUNT} times  Power Cycle System Via PDU
28
29
30Run Multiple BMC Reset Via REST
31    [Documentation]  Execute multiple reboots via REST.
32    [Tags]  Run_Multiple_BMC_Reset_Via_REST
33
34    # By default run test for 50 loops, else user input iteration.
35    # Fails immediately if any of the execution rounds fail and
36    # check if BMC is still pinging and FFDC is collected.
37    Repeat Keyword  ${LOOP_COUNT} times  BMC REST Reset Cycle
38
39
40Run Multiple BMC Reset Via Reboot
41    [Documentation]  Execute multiple reboots via "reboot" command.
42    [Tags]  Run_Multiple_BMC_Reset_Via_Reboot
43
44    # By default run test for 50 loops, else user input iteration.
45    # Fails immediately if any of the execution rounds fail and
46    # check if BMC is still pinging and FFDC is collected.
47    Repeat Keyword  ${LOOP_COUNT} times  BMC Reboot Cycle
48
49
50*** Keywords ***
51
52Power Cycle System Via PDU
53    [Documentation]  Power cycle system and wait for BMC to reach Ready state.
54    Log  "Doing power cycle"
55    PDU Power Cycle
56    Check If BMC Is Up  5 min  10 sec
57
58    Wait Until Keyword Succeeds  10 min  10 sec  Is BMC Ready
59
60
61BMC REST Reset Cycle
62    [Documentation]  Reset BMC via REST and wait for ready state.
63    Log  "Doing Reboot cycle"
64    ${bmc_version_before}=  Get BMC Version
65    Initiate BMC Reboot
66    Wait Until Keyword Succeeds  10 min  10 sec  Is BMC Ready
67    ${bmc_version_after}=  Get BMC Version
68    Should Be Equal  ${bmc_version_before}  ${bmc_version_after}
69
70
71BMC Reboot Cycle
72    [Documentation]  Reboot BMC and wait for ready state.
73    Log  "Doing Reboot cycle"
74    ${bmc_version_before}=  Get BMC Version
75    OBMC Reboot (off)  stack_mode=normal
76    ${bmc_version_after}=  Get BMC Version
77    Should Be Equal  ${bmc_version_before}  ${bmc_version_after}
78
79
80Test Exit Logs
81    Ping Host  ${OPENBMC_HOST}
82    FFDC On Test Case Fail
83
84
85Validate Parameters
86    Should Not Be Empty   ${PDU_IP}
87    Should Not Be Empty   ${PDU_TYPE}
88    Should Not Be Empty   ${PDU_SLOT_NO}
89    Should Not Be Empty   ${PDU_USERNAME}
90    Should Not Be Empty   ${PDU_PASSWORD}
91
92