xref: /openbmc/openbmc-test-automation/extended/test_bmc_reset_loop.robot (revision c26e74dee20e39d6ca20f1952b1bdef6310ae229)
196bd1224SGeorge Keishing*** Settings ***
296bd1224SGeorge KeishingDocumentation   Power cycle loop. This is to test where network service
396bd1224SGeorge Keishing...             becomes unavailable during AC-Cycle stress test.
496bd1224SGeorge Keishing
596bd1224SGeorge KeishingResource        ../lib/rest_client.robot
696bd1224SGeorge KeishingResource        ../lib/pdu/pdu.robot
796bd1224SGeorge KeishingResource        ../lib/utils.robot
896bd1224SGeorge KeishingResource        ../lib/openbmc_ffdc.robot
996bd1224SGeorge KeishingResource        ../lib/state_manager.robot
1096bd1224SGeorge KeishingResource        ../lib/boot_utils.robot
11*c26e74deSGeorge KeishingResource        ../lib/code_update_utils.robot
1296bd1224SGeorge Keishing
1394659a2cSGeorge KeishingTest Teardown   Test Teardown Execution
14*c26e74deSGeorge KeishingSuite Setup     Suite Setup Execution
1596bd1224SGeorge Keishing
1696bd1224SGeorge Keishing*** Variables ***
1796bd1224SGeorge Keishing${LOOP_COUNT}    ${50}
1896bd1224SGeorge Keishing
1996bd1224SGeorge Keishing*** Test Cases ***
2096bd1224SGeorge Keishing
2196bd1224SGeorge KeishingRun Multiple Power Cycle
2296bd1224SGeorge Keishing    [Documentation]  Execute multiple power cycles.
2396bd1224SGeorge Keishing    [Setup]  Validate Parameters
2496bd1224SGeorge Keishing    [Tags]  Run_Multiple_Power_Cycle
2596bd1224SGeorge Keishing
2696bd1224SGeorge Keishing    # By default run test for 50 loops, else user input iteration.
2796bd1224SGeorge Keishing    # Fails immediately if any of the execution rounds fail and
2896bd1224SGeorge Keishing    # check if BMC is still pinging and FFDC is collected.
2996bd1224SGeorge Keishing    Repeat Keyword  ${LOOP_COUNT} times  Power Cycle System Via PDU
3096bd1224SGeorge Keishing
3196bd1224SGeorge Keishing
3296bd1224SGeorge KeishingRun Multiple BMC Reset Via REST
3396bd1224SGeorge Keishing    [Documentation]  Execute multiple reboots via REST.
3496bd1224SGeorge Keishing    [Tags]  Run_Multiple_BMC_Reset_Via_REST
3596bd1224SGeorge Keishing
3696bd1224SGeorge Keishing    # By default run test for 50 loops, else user input iteration.
3796bd1224SGeorge Keishing    # Fails immediately if any of the execution rounds fail and
3896bd1224SGeorge Keishing    # check if BMC is still pinging and FFDC is collected.
3996bd1224SGeorge Keishing    Repeat Keyword  ${LOOP_COUNT} times  BMC REST Reset Cycle
4096bd1224SGeorge Keishing
4196bd1224SGeorge Keishing
4296bd1224SGeorge KeishingRun Multiple BMC Reset Via Reboot
4396bd1224SGeorge Keishing    [Documentation]  Execute multiple reboots via "reboot" command.
4496bd1224SGeorge Keishing    [Tags]  Run_Multiple_BMC_Reset_Via_Reboot
4596bd1224SGeorge Keishing
4696bd1224SGeorge Keishing    # By default run test for 50 loops, else user input iteration.
4796bd1224SGeorge Keishing    # Fails immediately if any of the execution rounds fail and
4896bd1224SGeorge Keishing    # check if BMC is still pinging and FFDC is collected.
4996bd1224SGeorge Keishing    Repeat Keyword  ${LOOP_COUNT} times  BMC Reboot Cycle
5096bd1224SGeorge Keishing
5196bd1224SGeorge Keishing
5296bd1224SGeorge Keishing*** Keywords ***
5396bd1224SGeorge Keishing
5496bd1224SGeorge KeishingPower Cycle System Via PDU
5596bd1224SGeorge Keishing    [Documentation]  Power cycle system and wait for BMC to reach Ready state.
5696bd1224SGeorge Keishing    Log  "Doing power cycle"
5796bd1224SGeorge Keishing    PDU Power Cycle
5896bd1224SGeorge Keishing    Check If BMC Is Up  5 min  10 sec
5996bd1224SGeorge Keishing
6096bd1224SGeorge Keishing    Wait Until Keyword Succeeds  10 min  10 sec  Is BMC Ready
61b39a679dSGeorge Keishing    Verify BMC RTC And UTC Time Drift
62*c26e74deSGeorge Keishing    Field Mode Should Be Enabled
6396bd1224SGeorge Keishing
6496bd1224SGeorge Keishing
6596bd1224SGeorge KeishingBMC REST Reset Cycle
6696bd1224SGeorge Keishing    [Documentation]  Reset BMC via REST and wait for ready state.
6796bd1224SGeorge Keishing    Log  "Doing Reboot cycle"
6896bd1224SGeorge Keishing    ${bmc_version_before}=  Get BMC Version
6996bd1224SGeorge Keishing    Initiate BMC Reboot
7096bd1224SGeorge Keishing    Wait Until Keyword Succeeds  10 min  10 sec  Is BMC Ready
7196bd1224SGeorge Keishing    ${bmc_version_after}=  Get BMC Version
7296bd1224SGeorge Keishing    Should Be Equal  ${bmc_version_before}  ${bmc_version_after}
73b39a679dSGeorge Keishing    Verify BMC RTC And UTC Time Drift
74*c26e74deSGeorge Keishing    Field Mode Should Be Enabled
7596bd1224SGeorge Keishing
7696bd1224SGeorge Keishing
7796bd1224SGeorge KeishingBMC Reboot Cycle
7896bd1224SGeorge Keishing    [Documentation]  Reboot BMC and wait for ready state.
7996bd1224SGeorge Keishing    Log  "Doing Reboot cycle"
8096bd1224SGeorge Keishing    ${bmc_version_before}=  Get BMC Version
8196bd1224SGeorge Keishing    OBMC Reboot (off)  stack_mode=normal
8296bd1224SGeorge Keishing    ${bmc_version_after}=  Get BMC Version
8396bd1224SGeorge Keishing    Should Be Equal  ${bmc_version_before}  ${bmc_version_after}
84b39a679dSGeorge Keishing    Verify BMC RTC And UTC Time Drift
85*c26e74deSGeorge Keishing    Field Mode Should Be Enabled
8696bd1224SGeorge Keishing
8796bd1224SGeorge Keishing
8894659a2cSGeorge KeishingTest Teardown Execution
8994659a2cSGeorge Keishing    [Documentation]  Do test case tear-down.
9096bd1224SGeorge Keishing    Ping Host  ${OPENBMC_HOST}
9196bd1224SGeorge Keishing    FFDC On Test Case Fail
9296bd1224SGeorge Keishing
9396bd1224SGeorge Keishing
9496bd1224SGeorge KeishingValidate Parameters
9594659a2cSGeorge Keishing    [Documentation]  Validate PDU parameters.
9696bd1224SGeorge Keishing    Should Not Be Empty   ${PDU_IP}
9796bd1224SGeorge Keishing    Should Not Be Empty   ${PDU_TYPE}
9896bd1224SGeorge Keishing    Should Not Be Empty   ${PDU_SLOT_NO}
9996bd1224SGeorge Keishing    Should Not Be Empty   ${PDU_USERNAME}
10096bd1224SGeorge Keishing    Should Not Be Empty   ${PDU_PASSWORD}
10196bd1224SGeorge Keishing
102*c26e74deSGeorge Keishing
103*c26e74deSGeorge KeishingSuite Setup Execution
104*c26e74deSGeorge Keishing    [Documentation]  Enable field mode.
105*c26e74deSGeorge Keishing    Enable Field Mode And Verify Unmount
106*c26e74deSGeorge Keishing    Field Mode Should Be Enabled
107