-
Notifications
You must be signed in to change notification settings - Fork 95
/
Copy pathtest_bmc_reset_loop.robot
137 lines (95 loc) · 4.39 KB
/
test_bmc_reset_loop.robot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
*** Settings ***
Documentation Power cycle loop. This is to test where network service
... becomes unavailable during AC-Cycle stress test.
Resource ../lib/rest_client.robot
Resource ../lib/pdu/pdu.robot
Resource ../lib/utils.robot
Resource ../lib/openbmc_ffdc.robot
Resource ../lib/state_manager.robot
Resource ../lib/boot_utils.robot
Resource ../lib/code_update_utils.robot
Library ../lib/bmc_ssh_utils.py
Test Teardown Test Teardown Execution
Suite Setup Suite Setup Execution
*** Variables ***
${LOOP_COUNT} ${50}
${CHECK_FOR_ERRORS} ${1}
# Error strings to check from journald.
${ERROR_REGEX} SEGV|core-dump|FAILURE|Failed to start|Found ordering cycle
*** Test Cases ***
Run Multiple Power Cycle
[Documentation] Execute multiple power cycles.
[Setup] Validate Parameters
[Tags] Run_Multiple_Power_Cycle
# By default run test for 50 loops, else user input iteration.
# Fails immediately if any of the execution rounds fail and
# check if BMC is still pinging and FFDC is collected.
Repeat Keyword ${LOOP_COUNT} times Power Cycle System Via PDU
Run Multiple BMC Reset Via Redfish
[Documentation] Execute multiple reboots via REST.
[Tags] Run_Multiple_BMC_Reset_Via_Redfish
# By default run test for 50 loops, else user input iteration.
# Fails immediately if any of the execution rounds fail and
# check if BMC is still pinging and FFDC is collected.
Repeat Keyword ${LOOP_COUNT} times BMC Redfish Reset Cycle
Run Multiple BMC Reset Via Reboot
[Documentation] Execute multiple reboots via "reboot" command.
[Tags] Run_Multiple_BMC_Reset_Via_Reboot
# By default run test for 50 loops, else user input iteration.
# Fails immediately if any of the execution rounds fail and
# check if BMC is still pinging and FFDC is collected.
Repeat Keyword ${LOOP_COUNT} times BMC Reboot Cycle
Run Multiple BMC Reset When Host Is Booted Via Redfish
[Documentation] Execute multiple reboots via redfish.
[Tags] Run_Multiple_BMC_Reset_When_Host_Is_Booted_Via_Redfish
# By default run test for 50 loops, else user input iteration.
# Fails immediately if any of the execution rounds fail and
# check if BMC is still pinging and FFDC is collected.
Repeat Keyword ${LOOP_COUNT} times BMC Redfish Reset Runtime Cycle
*** Keywords ***
Power Cycle System Via PDU
[Documentation] Power cycle system and wait for BMC to reach Ready state.
PDU Power Cycle
Check If BMC Is Up 5 min 10 sec
Wait Until Keyword Succeeds 10 min 10 sec Is BMC Ready
Verify BMC RTC And UTC Time Drift
BMC Redfish Reset Cycle
[Documentation] Reset BMC via Redfish and verify required states.
Redfish OBMC Reboot (off)
${bmc_version}= Get BMC Version
Valid Value bmc_version valid_values=['${initial_bmc_version}']
Run Keyword If '${CHECK_FOR_ERRORS}' == '${1}'
... Check For Regex In Journald ${ERROR_REGEX} error_check=${0} boot=-b
Verify BMC RTC And UTC Time Drift
BMC Redfish Reset Runtime Cycle
[Documentation] Reset BMC via Redfish and verify required states.
Redfish OBMC Reboot (run)
${bmc_version}= Get BMC Version
Valid Value bmc_version valid_values=['${initial_bmc_version}']
Run Keyword If '${CHECK_FOR_ERRORS}' == '${1}'
... Check For Regex In Journald ${ERROR_REGEX} error_check=${0} boot=-b
Verify BMC RTC And UTC Time Drift
BMC Reboot Cycle
[Documentation] Reboot BMC and wait for ready state.
OBMC Reboot (off) stack_mode=normal
${bmc_version}= Get BMC Version
Valid Value bmc_version ["${initial_bmc_version}"]
Verify BMC RTC And UTC Time Drift
Check For Regex In Journald ${ERROR_REGEX} error_check=${0} boot=-b
${boot_side}= Get BMC Flash Chip Boot Side
Valid Value boot_side ['0']
Test Teardown Execution
[Documentation] Do test case tear-down.
Ping Host ${OPENBMC_HOST}
FFDC On Test Case Fail
Validate Parameters
[Documentation] Validate PDU parameters.
Should Not Be Empty ${PDU_IP}
Should Not Be Empty ${PDU_TYPE}
Should Not Be Empty ${PDU_SLOT_NO}
Should Not Be Empty ${PDU_USERNAME}
Should Not Be Empty ${PDU_PASSWORD}
Suite Setup Execution
[Documentation] Do suite setup.
${bmc_version}= Get BMC Version
Set Suite Variable ${initial_bmc_version} ${bmc_version}