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