xref: /openbmc/openbmc-test-automation/extended/test_bmc_reset_loop.robot (revision c79341b531aadc42a865767fde9877065d591b70)
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}
19397846bbSGeorge Keishing${CHECK_FOR_ERRORS}    ${1}
2096bd1224SGeorge Keishing
212c89173cSGeorge Keishing# Error strings to check from journald.
22*c79341b5SJian Zhang${ERROR_REGEX}     SEGV|core-dump|FAILURE|Failed to start|Found ordering cycle
232c89173cSGeorge Keishing
2496bd1224SGeorge Keishing*** Test Cases ***
2596bd1224SGeorge Keishing
2696bd1224SGeorge KeishingRun Multiple Power Cycle
2796bd1224SGeorge Keishing    [Documentation]  Execute multiple power cycles.
2896bd1224SGeorge Keishing    [Setup]  Validate Parameters
2996bd1224SGeorge Keishing    [Tags]  Run_Multiple_Power_Cycle
3096bd1224SGeorge Keishing
3196bd1224SGeorge Keishing    # By default run test for 50 loops, else user input iteration.
3296bd1224SGeorge Keishing    # Fails immediately if any of the execution rounds fail and
3396bd1224SGeorge Keishing    # check if BMC is still pinging and FFDC is collected.
3496bd1224SGeorge Keishing    Repeat Keyword  ${LOOP_COUNT} times  Power Cycle System Via PDU
3596bd1224SGeorge Keishing
3696bd1224SGeorge Keishing
375d5b8a29SGeorge KeishingRun Multiple BMC Reset Via Redfish
3896bd1224SGeorge Keishing    [Documentation]  Execute multiple reboots via REST.
395d5b8a29SGeorge Keishing    [Tags]  Run_Multiple_BMC_Reset_Via_Redfish
4096bd1224SGeorge Keishing
4196bd1224SGeorge Keishing    # By default run test for 50 loops, else user input iteration.
4296bd1224SGeorge Keishing    # Fails immediately if any of the execution rounds fail and
4396bd1224SGeorge Keishing    # check if BMC is still pinging and FFDC is collected.
445d5b8a29SGeorge Keishing    Repeat Keyword  ${LOOP_COUNT} times  BMC Redfish Reset Cycle
4596bd1224SGeorge Keishing
4696bd1224SGeorge Keishing
4796bd1224SGeorge KeishingRun Multiple BMC Reset Via Reboot
4896bd1224SGeorge Keishing    [Documentation]  Execute multiple reboots via "reboot" command.
4996bd1224SGeorge Keishing    [Tags]  Run_Multiple_BMC_Reset_Via_Reboot
5096bd1224SGeorge Keishing
5196bd1224SGeorge Keishing    # By default run test for 50 loops, else user input iteration.
5296bd1224SGeorge Keishing    # Fails immediately if any of the execution rounds fail and
5396bd1224SGeorge Keishing    # check if BMC is still pinging and FFDC is collected.
5496bd1224SGeorge Keishing    Repeat Keyword  ${LOOP_COUNT} times  BMC Reboot Cycle
5596bd1224SGeorge Keishing
5696bd1224SGeorge Keishing
57c948916eSGeorge KeishingRun Multiple BMC Reset When Host Is Booted Via Redfish
58c948916eSGeorge Keishing    [Documentation]  Execute multiple reboots via redfish.
59c948916eSGeorge Keishing    [Tags]  Run_Multiple_BMC_Reset_When_Host_Is_Booted_Via_Redfish
60c948916eSGeorge Keishing
61c948916eSGeorge Keishing    # By default run test for 50 loops, else user input iteration.
62c948916eSGeorge Keishing    # Fails immediately if any of the execution rounds fail and
63c948916eSGeorge Keishing    # check if BMC is still pinging and FFDC is collected.
64c948916eSGeorge Keishing    Repeat Keyword  ${LOOP_COUNT} times  BMC Redfish Reset Runtime Cycle
65c948916eSGeorge Keishing
6696bd1224SGeorge Keishing*** Keywords ***
6796bd1224SGeorge Keishing
6896bd1224SGeorge KeishingPower Cycle System Via PDU
6996bd1224SGeorge Keishing    [Documentation]  Power cycle system and wait for BMC to reach Ready state.
705d5b8a29SGeorge Keishing
7196bd1224SGeorge Keishing    PDU Power Cycle
7296bd1224SGeorge Keishing    Check If BMC Is Up  5 min  10 sec
7396bd1224SGeorge Keishing
7496bd1224SGeorge Keishing    Wait Until Keyword Succeeds  10 min  10 sec  Is BMC Ready
75b39a679dSGeorge Keishing    Verify BMC RTC And UTC Time Drift
7696bd1224SGeorge Keishing
7796bd1224SGeorge Keishing
785d5b8a29SGeorge KeishingBMC Redfish Reset Cycle
795d5b8a29SGeorge Keishing    [Documentation]  Reset BMC via Redfish and verify required states.
805d5b8a29SGeorge Keishing
815d5b8a29SGeorge Keishing    Redfish OBMC Reboot (off)
82397846bbSGeorge Keishing
835d5b8a29SGeorge Keishing    ${bmc_version}=  Get BMC Version
84397846bbSGeorge Keishing    Valid Value  bmc_version  valid_values=['${initial_bmc_version}']
85397846bbSGeorge Keishing
86397846bbSGeorge Keishing    Run Keyword If  '${CHECK_FOR_ERRORS}' == '${1}'
87397846bbSGeorge Keishing    ...  Check For Regex In Journald  ${ERROR_REGEX}  error_check=${0}  boot=-b
88397846bbSGeorge Keishing
89b39a679dSGeorge Keishing    Verify BMC RTC And UTC Time Drift
9096bd1224SGeorge Keishing
9196bd1224SGeorge Keishing
92c948916eSGeorge KeishingBMC Redfish Reset Runtime Cycle
93c948916eSGeorge Keishing    [Documentation]  Reset BMC via Redfish and verify required states.
94c948916eSGeorge Keishing
95fad12ad7SGeorge Keishing    Redfish OBMC Reboot (run)
96c948916eSGeorge Keishing
97c948916eSGeorge Keishing    ${bmc_version}=  Get BMC Version
98c948916eSGeorge Keishing    Valid Value  bmc_version  valid_values=['${initial_bmc_version}']
99c948916eSGeorge Keishing
100c948916eSGeorge Keishing    Run Keyword If  '${CHECK_FOR_ERRORS}' == '${1}'
101c948916eSGeorge Keishing    ...  Check For Regex In Journald  ${ERROR_REGEX}  error_check=${0}  boot=-b
102c948916eSGeorge Keishing
103c948916eSGeorge Keishing    Verify BMC RTC And UTC Time Drift
104c948916eSGeorge Keishing
105c948916eSGeorge Keishing
10696bd1224SGeorge KeishingBMC Reboot Cycle
10796bd1224SGeorge Keishing    [Documentation]  Reboot BMC and wait for ready state.
1085d5b8a29SGeorge Keishing
10996bd1224SGeorge Keishing    OBMC Reboot (off)  stack_mode=normal
1105d5b8a29SGeorge Keishing    ${bmc_version}=  Get BMC Version
1119aa2f0bbSGeorge Keishing    Valid Value  bmc_version  ["${initial_bmc_version}"]
112b39a679dSGeorge Keishing    Verify BMC RTC And UTC Time Drift
113ef3308b7SGeorge Keishing    Check For Regex In Journald  ${ERROR_REGEX}  error_check=${0}  boot=-b
1145d5b8a29SGeorge Keishing    ${boot_side}=  Get BMC Flash Chip Boot Side
1155d5b8a29SGeorge Keishing    Valid Value  boot_side  ['0']
11696bd1224SGeorge Keishing
11796bd1224SGeorge Keishing
11894659a2cSGeorge KeishingTest Teardown Execution
11994659a2cSGeorge Keishing    [Documentation]  Do test case tear-down.
12096bd1224SGeorge Keishing    Ping Host  ${OPENBMC_HOST}
12196bd1224SGeorge Keishing    FFDC On Test Case Fail
12296bd1224SGeorge Keishing
12396bd1224SGeorge Keishing
12496bd1224SGeorge KeishingValidate Parameters
12594659a2cSGeorge Keishing    [Documentation]  Validate PDU parameters.
12696bd1224SGeorge Keishing    Should Not Be Empty   ${PDU_IP}
12796bd1224SGeorge Keishing    Should Not Be Empty   ${PDU_TYPE}
12896bd1224SGeorge Keishing    Should Not Be Empty   ${PDU_SLOT_NO}
12996bd1224SGeorge Keishing    Should Not Be Empty   ${PDU_USERNAME}
13096bd1224SGeorge Keishing    Should Not Be Empty   ${PDU_PASSWORD}
13196bd1224SGeorge Keishing
132c26e74deSGeorge Keishing
133c26e74deSGeorge KeishingSuite Setup Execution
1345d5b8a29SGeorge Keishing    [Documentation]  Do suite setup.
1355d5b8a29SGeorge Keishing
1365d5b8a29SGeorge Keishing    ${bmc_version}=  Get BMC Version
1375d5b8a29SGeorge Keishing    Set Suite Variable  ${initial_bmc_version}  ${bmc_version}
138