xref: /openbmc/openbmc-test-automation/extended/test_bmc_reset_loop.robot (revision 5d5b8a2979d9568337754b02aab77892e268de48)
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
11c26e74deSGeorge KeishingResource        ../lib/code_update_utils.robot
129867beddSGeorge KeishingLibrary         ../lib/bmc_ssh_utils.py
1396bd1224SGeorge Keishing
1494659a2cSGeorge KeishingTest Teardown   Test Teardown Execution
15c26e74deSGeorge KeishingSuite Setup     Suite Setup Execution
1696bd1224SGeorge Keishing
1796bd1224SGeorge Keishing*** Variables ***
1896bd1224SGeorge Keishing${LOOP_COUNT}    ${50}
1996bd1224SGeorge Keishing
202c89173cSGeorge Keishing# Error strings to check from journald.
215b8ff520SGeorge Keishing${ERROR_REGEX}     SEGV|core-dump|FAILURE|Failed to start
222c89173cSGeorge Keishing
2396bd1224SGeorge Keishing*** Test Cases ***
2496bd1224SGeorge Keishing
2596bd1224SGeorge KeishingRun Multiple Power Cycle
2696bd1224SGeorge Keishing    [Documentation]  Execute multiple power cycles.
2796bd1224SGeorge Keishing    [Setup]  Validate Parameters
2896bd1224SGeorge Keishing    [Tags]  Run_Multiple_Power_Cycle
2996bd1224SGeorge Keishing
3096bd1224SGeorge Keishing    # By default run test for 50 loops, else user input iteration.
3196bd1224SGeorge Keishing    # Fails immediately if any of the execution rounds fail and
3296bd1224SGeorge Keishing    # check if BMC is still pinging and FFDC is collected.
3396bd1224SGeorge Keishing    Repeat Keyword  ${LOOP_COUNT} times  Power Cycle System Via PDU
3496bd1224SGeorge Keishing
3596bd1224SGeorge Keishing
36*5d5b8a29SGeorge KeishingRun Multiple BMC Reset Via Redfish
3796bd1224SGeorge Keishing    [Documentation]  Execute multiple reboots via REST.
38*5d5b8a29SGeorge Keishing    [Tags]  Run_Multiple_BMC_Reset_Via_Redfish
3996bd1224SGeorge Keishing
4096bd1224SGeorge Keishing    # By default run test for 50 loops, else user input iteration.
4196bd1224SGeorge Keishing    # Fails immediately if any of the execution rounds fail and
4296bd1224SGeorge Keishing    # check if BMC is still pinging and FFDC is collected.
43*5d5b8a29SGeorge Keishing    Repeat Keyword  ${LOOP_COUNT} times  BMC Redfish Reset Cycle
4496bd1224SGeorge Keishing
4596bd1224SGeorge Keishing
4696bd1224SGeorge KeishingRun Multiple BMC Reset Via Reboot
4796bd1224SGeorge Keishing    [Documentation]  Execute multiple reboots via "reboot" command.
4896bd1224SGeorge Keishing    [Tags]  Run_Multiple_BMC_Reset_Via_Reboot
4996bd1224SGeorge Keishing
5096bd1224SGeorge Keishing    # By default run test for 50 loops, else user input iteration.
5196bd1224SGeorge Keishing    # Fails immediately if any of the execution rounds fail and
5296bd1224SGeorge Keishing    # check if BMC is still pinging and FFDC is collected.
5396bd1224SGeorge Keishing    Repeat Keyword  ${LOOP_COUNT} times  BMC Reboot Cycle
5496bd1224SGeorge Keishing
5596bd1224SGeorge Keishing
5696bd1224SGeorge Keishing*** Keywords ***
5796bd1224SGeorge Keishing
5896bd1224SGeorge KeishingPower Cycle System Via PDU
5996bd1224SGeorge Keishing    [Documentation]  Power cycle system and wait for BMC to reach Ready state.
60*5d5b8a29SGeorge Keishing
6196bd1224SGeorge Keishing    PDU Power Cycle
6296bd1224SGeorge Keishing    Check If BMC Is Up  5 min  10 sec
6396bd1224SGeorge Keishing
6496bd1224SGeorge Keishing    Wait Until Keyword Succeeds  10 min  10 sec  Is BMC Ready
65b39a679dSGeorge Keishing    Verify BMC RTC And UTC Time Drift
6696bd1224SGeorge Keishing
6796bd1224SGeorge Keishing
68*5d5b8a29SGeorge KeishingBMC Redfish Reset Cycle
69*5d5b8a29SGeorge Keishing    [Documentation]  Reset BMC via Redfish and verify required states.
70*5d5b8a29SGeorge Keishing
71*5d5b8a29SGeorge Keishing    Redfish OBMC Reboot (off)
72*5d5b8a29SGeorge Keishing    ${bmc_version}=  Get BMC Version
73*5d5b8a29SGeorge Keishing    Valid Value  bmc_version  [${initial_bmc_version}]
745b8ff520SGeorge Keishing    Check For Regex In Journald  ${ERROR_REGEX}  error_check=${0}  boot=-b
75b39a679dSGeorge Keishing    Verify BMC RTC And UTC Time Drift
76*5d5b8a29SGeorge Keishing    ${boot_side}=  Get BMC Flash Chip Boot Side
77*5d5b8a29SGeorge Keishing    Valid Value  boot_side  ['0']
7896bd1224SGeorge Keishing
7996bd1224SGeorge Keishing
8096bd1224SGeorge KeishingBMC Reboot Cycle
8196bd1224SGeorge Keishing    [Documentation]  Reboot BMC and wait for ready state.
82*5d5b8a29SGeorge Keishing
8396bd1224SGeorge Keishing    OBMC Reboot (off)  stack_mode=normal
84*5d5b8a29SGeorge Keishing    ${bmc_version}=  Get BMC Version
85*5d5b8a29SGeorge Keishing    Valid Value  bmc_version  [${initial_bmc_version}]
86b39a679dSGeorge Keishing    Verify BMC RTC And UTC Time Drift
872c89173cSGeorge Keishing    Check For Regex In Journald  ${ERROR_REGEX}  error_check=${0}
88*5d5b8a29SGeorge Keishing    ${boot_side}=  Get BMC Flash Chip Boot Side
89*5d5b8a29SGeorge Keishing    Valid Value  boot_side  ['0']
9096bd1224SGeorge Keishing
9196bd1224SGeorge Keishing
9294659a2cSGeorge KeishingTest Teardown Execution
9394659a2cSGeorge Keishing    [Documentation]  Do test case tear-down.
9496bd1224SGeorge Keishing    Ping Host  ${OPENBMC_HOST}
9596bd1224SGeorge Keishing    FFDC On Test Case Fail
9696bd1224SGeorge Keishing
9796bd1224SGeorge Keishing
9896bd1224SGeorge KeishingValidate Parameters
9994659a2cSGeorge Keishing    [Documentation]  Validate PDU parameters.
10096bd1224SGeorge Keishing    Should Not Be Empty   ${PDU_IP}
10196bd1224SGeorge Keishing    Should Not Be Empty   ${PDU_TYPE}
10296bd1224SGeorge Keishing    Should Not Be Empty   ${PDU_SLOT_NO}
10396bd1224SGeorge Keishing    Should Not Be Empty   ${PDU_USERNAME}
10496bd1224SGeorge Keishing    Should Not Be Empty   ${PDU_PASSWORD}
10596bd1224SGeorge Keishing
106c26e74deSGeorge Keishing
107c26e74deSGeorge KeishingSuite Setup Execution
108*5d5b8a29SGeorge Keishing    [Documentation]  Do suite setup.
109*5d5b8a29SGeorge Keishing
110*5d5b8a29SGeorge Keishing    ${bmc_version}=  Get BMC Version
111*5d5b8a29SGeorge Keishing    Set Suite Variable  ${initial_bmc_version}  ${bmc_version}
112