blob: 4a8d7d92c6d298279016f638f5d8d63d5addbeae [file] [log] [blame]
George Keishing92abc992016-10-18 13:29:25 -05001*** 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
George Keishingca709b02017-02-02 11:38:19 -06009Resource ../lib/state_manager.robot
George Keishingbf1500d2017-10-30 12:47:47 -050010Resource ../lib/boot_utils.robot
George Keishingc26e74d2017-11-17 00:45:20 -060011Resource ../lib/code_update_utils.robot
George Keishing9867bed2018-02-04 22:31:36 -060012Library ../lib/bmc_ssh_utils.py
George Keishing92abc992016-10-18 13:29:25 -050013
George Keishing94659a22017-11-17 00:03:05 -060014Test Teardown Test Teardown Execution
George Keishingc26e74d2017-11-17 00:45:20 -060015Suite Setup Suite Setup Execution
George Keishing92abc992016-10-18 13:29:25 -050016
17*** Variables ***
18${LOOP_COUNT} ${50}
19
George Keishing2c891732018-09-18 07:39:59 -050020# Error strings to check from journald.
George Keishing5b8ff522019-09-05 11:15:41 -050021${ERROR_REGEX} SEGV|core-dump|FAILURE|Failed to start
George Keishing2c891732018-09-18 07:39:59 -050022
George Keishing92abc992016-10-18 13:29:25 -050023*** Test Cases ***
24
George Keishingca709b02017-02-02 11:38:19 -060025Run Multiple Power Cycle
26 [Documentation] Execute multiple power cycles.
27 [Setup] Validate Parameters
28 [Tags] Run_Multiple_Power_Cycle
George Keishing92abc992016-10-18 13:29:25 -050029
George Keishingca709b02017-02-02 11:38:19 -060030 # By default run test for 50 loops, else user input iteration.
31 # Fails immediately if any of the execution rounds fail and
32 # check if BMC is still pinging and FFDC is collected.
33 Repeat Keyword ${LOOP_COUNT} times Power Cycle System Via PDU
34
35
George Keishingbf1500d2017-10-30 12:47:47 -050036Run Multiple BMC Reset Via REST
37 [Documentation] Execute multiple reboots via REST.
38 [Tags] Run_Multiple_BMC_Reset_Via_REST
39
40 # By default run test for 50 loops, else user input iteration.
41 # Fails immediately if any of the execution rounds fail and
42 # check if BMC is still pinging and FFDC is collected.
43 Repeat Keyword ${LOOP_COUNT} times BMC REST Reset Cycle
44
45
46Run Multiple BMC Reset Via Reboot
47 [Documentation] Execute multiple reboots via "reboot" command.
48 [Tags] Run_Multiple_BMC_Reset_Via_Reboot
George Keishingca709b02017-02-02 11:38:19 -060049
50 # By default run test for 50 loops, else user input iteration.
51 # Fails immediately if any of the execution rounds fail and
52 # check if BMC is still pinging and FFDC is collected.
53 Repeat Keyword ${LOOP_COUNT} times BMC Reboot Cycle
George Keishing92abc992016-10-18 13:29:25 -050054
55
56*** Keywords ***
57
George Keishingca709b02017-02-02 11:38:19 -060058Power Cycle System Via PDU
59 [Documentation] Power cycle system and wait for BMC to reach Ready state.
60 Log "Doing power cycle"
George Keishing92abc992016-10-18 13:29:25 -050061 PDU Power Cycle
George Keishingca709b02017-02-02 11:38:19 -060062 Check If BMC Is Up 5 min 10 sec
George Keishing92abc992016-10-18 13:29:25 -050063
George Keishingca709b02017-02-02 11:38:19 -060064 Wait Until Keyword Succeeds 10 min 10 sec Is BMC Ready
George Keishingb39a6792017-11-10 22:58:52 -060065 Verify BMC RTC And UTC Time Drift
George Keishingc26e74d2017-11-17 00:45:20 -060066 Field Mode Should Be Enabled
George Keishingca709b02017-02-02 11:38:19 -060067
68
George Keishingbf1500d2017-10-30 12:47:47 -050069BMC REST Reset Cycle
70 [Documentation] Reset BMC via REST and wait for ready state.
George Keishingca709b02017-02-02 11:38:19 -060071 Log "Doing Reboot cycle"
George Keishing137882c2017-10-28 09:19:05 -050072 ${bmc_version_before}= Get BMC Version
George Keishingca709b02017-02-02 11:38:19 -060073 Initiate BMC Reboot
74 Wait Until Keyword Succeeds 10 min 10 sec Is BMC Ready
George Keishing137882c2017-10-28 09:19:05 -050075 ${bmc_version_after}= Get BMC Version
76 Should Be Equal ${bmc_version_before} ${bmc_version_after}
George Keishing5b8ff522019-09-05 11:15:41 -050077 Check For Regex In Journald ${ERROR_REGEX} error_check=${0} boot=-b
George Keishingb39a6792017-11-10 22:58:52 -060078 Verify BMC RTC And UTC Time Drift
George Keishingc26e74d2017-11-17 00:45:20 -060079 Field Mode Should Be Enabled
George Keishing92abc992016-10-18 13:29:25 -050080
81
George Keishingbf1500d2017-10-30 12:47:47 -050082BMC Reboot Cycle
83 [Documentation] Reboot BMC and wait for ready state.
84 Log "Doing Reboot cycle"
85 ${bmc_version_before}= Get BMC Version
86 OBMC Reboot (off) stack_mode=normal
87 ${bmc_version_after}= Get BMC Version
88 Should Be Equal ${bmc_version_before} ${bmc_version_after}
George Keishingb39a6792017-11-10 22:58:52 -060089 Verify BMC RTC And UTC Time Drift
George Keishing2c891732018-09-18 07:39:59 -050090 Check For Regex In Journald ${ERROR_REGEX} error_check=${0}
George Keishingc26e74d2017-11-17 00:45:20 -060091 Field Mode Should Be Enabled
George Keishingbf1500d2017-10-30 12:47:47 -050092
93
George Keishing94659a22017-11-17 00:03:05 -060094Test Teardown Execution
95 [Documentation] Do test case tear-down.
George Keishing92abc992016-10-18 13:29:25 -050096 Ping Host ${OPENBMC_HOST}
Gunnar Millseac1af22016-11-14 15:30:09 -060097 FFDC On Test Case Fail
George Keishing92abc992016-10-18 13:29:25 -050098
George Keishing9867bed2018-02-04 22:31:36 -060099 # Example of the u-boot-env o/p:
100 # root@witherspoon:~# grep fieldmode /dev/mtd/u-boot-env
101 # fieldmode=true
102 # fieldmode=true
103 ${field_mode}=
104 ... BMC Execute Command grep fieldmode /dev/mtd/u-boot-env
105 Should Contain "${field_mode[0]}" fieldmode=true
106 ... msg=u-boot-env shows "fieldmode" is not set to true.
107
George Keishing92abc992016-10-18 13:29:25 -0500108
109Validate Parameters
George Keishing94659a22017-11-17 00:03:05 -0600110 [Documentation] Validate PDU parameters.
George Keishing92abc992016-10-18 13:29:25 -0500111 Should Not Be Empty ${PDU_IP}
112 Should Not Be Empty ${PDU_TYPE}
113 Should Not Be Empty ${PDU_SLOT_NO}
114 Should Not Be Empty ${PDU_USERNAME}
115 Should Not Be Empty ${PDU_PASSWORD}
116
George Keishingc26e74d2017-11-17 00:45:20 -0600117
118Suite Setup Execution
119 [Documentation] Enable field mode.
120 Enable Field Mode And Verify Unmount
121 Field Mode Should Be Enabled