blob: 199063b2ae3d26bab8a9d521cbce1e03283c9cff [file] [log] [blame]
Rahul Maheshwari982fee42017-05-03 00:33:15 -05001*** Settings ***
2Documentation This suite tests IPMI SOL in OpenBMC.
3
Rahul Maheshwari1cd7e432019-03-06 10:27:21 -06004Resource ../lib/ipmi_client.robot
5Resource ../lib/openbmc_ffdc.robot
George Keishing42e1ac62019-03-07 13:18:39 -06006Resource ../lib/state_manager.robot
George Keishing60b5e612019-07-05 12:11:51 -05007Resource ../lib/boot_utils.robot
8Resource ../lib/bmc_redfish_resource.robot
Rahul Maheshwari1cd7e432019-03-06 10:27:21 -06009Library ../lib/ipmi_utils.py
Rahul Maheshwari982fee42017-05-03 00:33:15 -050010
Rahul Maheshwari2a175112017-08-22 05:06:49 -050011Test Setup Start SOL Console Logging
George Keishing0ea976a2017-12-08 01:09:40 -060012Test Teardown Test Teardown Execution
Rahul Maheshwari982fee42017-05-03 00:33:15 -050013
Rahul Maheshwari7eea8ed2018-12-18 04:51:38 -060014Force Tags SOL_Test
15
16
Rahul Maheshwari982fee42017-05-03 00:33:15 -050017*** Variables ***
18
19*** Test Cases ***
20
Rahul Maheshwarid71cd952017-06-20 21:30:51 -050021Set SOL Enabled
22 [Documentation] Verify enabling SOL via IPMI.
23 [Tags] Set_SOL_Enabled
24
25 ${msg}= Run Keyword Run IPMI Standard Command
26 ... sol set enabled true
27
28 # Verify SOL status from ipmitool sol info command.
29 ${sol_info_dict}= Get SOL Info
30 ${sol_enable_status}= Get From Dictionary
31 ... ${sol_info_dict} Enabled
32
33 Should Be Equal '${sol_enable_status}' 'true'
34
35
36Set SOL Disabled
37 [Documentation] Verify disabling SOL via IPMI.
38 [Tags] Set_SOL_Disabled
39
40 ${msg}= Run Keyword Run IPMI Standard Command
41 ... sol set enabled false
42
43 # Verify SOL status from ipmitool sol info command.
44 ${sol_info_dict}= Get SOL Info
45 ${sol_enable_status}= Get From Dictionary
46 ... ${sol_info_dict} Enabled
47 Should Be Equal '${sol_enable_status}' 'false'
48
49 # Verify error while activating SOL with SOL disabled.
50 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
51 ... sol activate
52 Should Contain ${msg} SOL payload disabled ignore_case=True
53
54
Rahul Maheshwari6fe52b92017-06-16 03:35:26 -050055Set Valid SOL Privilege Level
56 [Documentation] Verify valid SOL's privilege level via IPMI.
57 [Tags] Set_Valid_SOL_Privilege_Level
58
59 ${privilege_level_list}= Create List user operator admin oem
Sushil Singhab209cd2020-07-01 09:01:14 -050060
61 FOR ${item} IN @{privilege_level_list}
62 Set SOL Setting privilege-level ${item}
63 ${output}= Get SOL Setting Privilege Level
64 Should Contain ${output} ${item} ignore_case=True
65 END
Rahul Maheshwari6fe52b92017-06-16 03:35:26 -050066
67
68Set Invalid SOL Privilege Level
69 [Documentation] Verify invalid SOL's retry count via IPMI.
70 [Tags] Set_Invalid_SOL_Privilege_Level
71
72 ${value}= Generate Random String ${8}
73 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
74 ... sol set privilege-level ${value}
75 Should Contain ${msg} Invalid value ignore_case=True
76
77
Rahul Maheshwaria88de442017-06-16 01:05:16 -050078Set Invalid SOL Retry Count
79 [Documentation] Verify invalid SOL's retry count via IPMI.
80 [Tags] Set_Invalid_SOL_Retry_Count
81
Gunnar Mills28e403b2017-10-25 16:16:38 -050082 # Any integer above 7 is invalid for SOL retry count.
Rahul Maheshwaria88de442017-06-16 01:05:16 -050083 ${value}= Evaluate random.randint(8, 10000) modules=random
84
85 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
86 ... sol set retry-count ${value}
87 Should Contain ${msg} Invalid value ignore_case=True
88
89
90Set Invalid SOL Retry Interval
91 [Documentation] Verify invalid SOL's retry interval via IPMI.
92 [Tags] Set_Invalid_SOL_Retry_Interval
93
Gunnar Mills28e403b2017-10-25 16:16:38 -050094 # Any integer above 255 is invalid for SOL retry interval.
Rahul Maheshwaria88de442017-06-16 01:05:16 -050095 ${value}= Evaluate random.randint(256, 10000) modules=random
96
97 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
98 ... sol set retry-interval ${value}
99 Should Contain ${msg} Invalid value ignore_case=True
100
101
102Set Invalid SOL Character Accumulate Level
103 [Documentation] Verify invalid SOL's character accumulate level via IPMI.
104 [Tags] Set_Invalid_SOL_Character_Accumulate_Level
105
106 # Any integer above 255 is invalid for SOL character accumulate level.
107 ${value}= Evaluate random.randint(256, 10000) modules=random
108
109 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
110 ... sol set character-accumulate-level ${value}
111 Should Contain ${msg} Invalid value ignore_case=True
112
113
114Set Invalid SOL Character Send Threshold
115 [Documentation] Verify invalid SOL's character send threshold via IPMI.
116 [Tags] Set_Invalid_SOL_Character_Send_Threshold
117
Gunnar Mills28e403b2017-10-25 16:16:38 -0500118 # Any integer above 255 is invalid for SOL character send threshold.
Rahul Maheshwaria88de442017-06-16 01:05:16 -0500119 ${value}= Evaluate random.randint(256, 10000) modules=random
120
121 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
122 ... sol set character-send-threshold ${value}
123 Should Contain ${msg} Invalid value ignore_case=True
124
125
George Keishing1ca77aa2017-08-21 23:55:51 -0500126Verify SOL During Boot
127 [Documentation] Verify SOL during boot.
128 [Tags] Verify_SOL_During_Boot
129
Konstantin Aladysheve6aa96b2021-03-23 16:03:32 +0300130 Redfish Hard Power Off stack_mode=skip
George Keishing1ca77aa2017-08-21 23:55:51 -0500131 Activate SOL Via IPMI
George Keishinge053d342019-10-25 07:16:20 -0500132 Initiate Host Boot Via External IPMI wait=${0}
George Keishingde9804a2017-09-28 04:03:11 -0500133
George Keishinge053d342019-10-25 07:16:20 -0500134 Wait Until Keyword Succeeds 3 mins 15 secs
135 ... Check IPMI SOL Output Content Welcome to Hostboot
136
137 Wait Until Keyword Succeeds 3 mins 15 secs
138 ... Check IPMI SOL Output Content ISTEP
139
140 Redfish Hard Power Off
George Keishing5632f3c2018-11-01 00:39:10 -0500141
142
George Keishing1ca77aa2017-08-21 23:55:51 -0500143Verify Deactivate Non Existing SOL
144 [Documentation] Verify deactivate non existing SOL session.
145 [Tags] Verify_Deactivate_Non_Existing_SOL
146
147 ${resp}= Deactivate SOL Via IPMI
148 Should Contain ${resp} SOL payload already de-activated
149 ... case_insensitive=True
150
151
152Set Valid SOL Retry Count
George Keishing1ca77aa2017-08-21 23:55:51 -0500153 [Documentation] Verify valid SOL's retry count via IPMI.
154 [Tags] Set_Valid_SOL_Retry_Count
George Keishing1ca77aa2017-08-21 23:55:51 -0500155 [Template] Verify SOL Setting
156
George Keishing5abfe602018-07-05 11:54:37 -0500157 # Setting name Min valid value Max valid value
158 retry-count 0 7
159
George Keishing1ca77aa2017-08-21 23:55:51 -0500160
161Set Valid SOL Retry Interval
George Keishing1ca77aa2017-08-21 23:55:51 -0500162 [Documentation] Verify valid SOL's retry interval via IPMI.
163 [Tags] Set_Valid_SOL_Retry_Interval
George Keishing1ca77aa2017-08-21 23:55:51 -0500164 [Template] Verify SOL Setting
165
George Keishing5abfe602018-07-05 11:54:37 -0500166 # Setting name Min valid value Max valid value
167 retry-interval 0 255
168
George Keishing1ca77aa2017-08-21 23:55:51 -0500169
170Set Valid SOL Character Accumulate Level
George Keishing1ca77aa2017-08-21 23:55:51 -0500171 [Documentation] Verify valid SOL's character accumulate level via IPMI.
172 [Tags] Set_Valid_SOL_Character_Accumulate_Level
George Keishing1ca77aa2017-08-21 23:55:51 -0500173 [Template] Verify SOL Setting
174
George Keishing5abfe602018-07-05 11:54:37 -0500175 # Setting name Min valid value Max valid value
176 character-accumulate-level 1 255
177
George Keishing1ca77aa2017-08-21 23:55:51 -0500178
179Set Valid SOL Character Send Threshold
George Keishing1ca77aa2017-08-21 23:55:51 -0500180 [Documentation] Verify valid SOL's character send threshold via IPMI.
181 [Tags] Set_Valid_SOL_Character_Send_Threshold
George Keishing1ca77aa2017-08-21 23:55:51 -0500182 [Template] Verify SOL Setting
183
George Keishing5abfe602018-07-05 11:54:37 -0500184 # Setting name Min valid value Max valid value
185 character-send-threshold 0 255
186
Anusha Dathatric3a0bb72020-02-12 07:52:40 -0600187
188Verify Continuous Activation And Deactivation Of SOL
189 [Documentation] Continuously on and off SOL.
190 [Tags] Verify_Continuous_Activation_And_Deactivation_Of_SOL
191
192 ${iteration_count}= Evaluate random.randint(5,10) modules=random
193 FOR ${iter} IN RANGE ${iteration_count}
194 Activate SOL Via IPMI
195 Deactivate SOL Via IPMI
196 END
197
198
Rahul Maheshwari982fee42017-05-03 00:33:15 -0500199*** Keywords ***
200
Rahul Maheshwari982fee42017-05-03 00:33:15 -0500201Check IPMI SOL Output Content
202 [Documentation] Check if SOL has given content.
203 [Arguments] ${data} ${file_path}=/tmp/sol_${OPENBMC_HOST}
204 # Description of argument(s):
205 # data Content which need to be checked(e.g. Petitboot, ISTEP).
206 # file_path The file path on the local machine to check SOL content.
207 # By default it check SOL content from /tmp/sol_<BMC_IP>.
208
George Keishing6f88c5e2019-07-03 13:54:12 -0500209 ${output}= OperatingSystem.Get File ${file_path} encoding_errors=ignore
Rahul Maheshwari982fee42017-05-03 00:33:15 -0500210 Should Contain ${output} ${data} case_insensitive=True
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500211
212
213Verify SOL Setting
214 [Documentation] Verify SOL Setting via IPMI.
215 [Arguments] ${setting_name} ${min_value} ${max_value}
216 # Description of Arguments:
217 # setting_name Setting to verify (e.g. "retry-count").
218 # min_value min valid value for given setting.
219 # max_value max valid value for given setting.
220
221 ${value}=
222 ... Evaluate random.randint(${min_value}, ${max_value}) modules=random
223
224 # Character accumulate level setting is set in multiples of 5.
225 # Retry interval setting is set in multiples of 10.
226 # Reference IPMI specification v2.0
227
228 ${expected_value}= Run Keyword If
229 ... '${setting_name}' == 'character-accumulate-level' Evaluate ${value}*5
230 ... ELSE IF '${setting_name}' == 'retry-interval' Evaluate ${value}*10
231 ... ELSE Set Variable ${value}
232
233 Set SOL Setting ${setting_name} '${value}'
234
235 # Replace "-" with space " " in setting name.
236 # E.g. "retry-count" to "retry count"
237 ${setting_name}= Evaluate $setting_name.replace('-',' ')
238
239 ${sol_info_dict}= Get SOL Info
240
241 # Get exact SOL setting name from sol info output.
242 ${list}= Get Matches ${sol_info_dict} ${setting_name}*
243 ... case_insensitive=${True}
244 ${setting_name_from_dict}= Get From List ${list} 0
245
246 # Get SOL setting value from above setting name.
247 ${setting_value}= Get From Dictionary
248 ... ${sol_info_dict} ${setting_name_from_dict}
249
250 Should Be Equal '${setting_value}' '${expected_value}'
251
Konstantin Aladysheve6aa96b2021-03-23 16:03:32 +0300252 Redfish Hard Power Off stack_mode=skip
George Keishinge053d342019-10-25 07:16:20 -0500253
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500254 Initiate Host Boot Via External IPMI wait=${0}
255
256 Activate SOL Via IPMI
George Keishinge053d342019-10-25 07:16:20 -0500257 Wait Until Keyword Succeeds 3 mins 15 secs
George Keishingd6ddf492018-10-24 09:53:12 -0500258 ... Check IPMI SOL Output Content Welcome to Hostboot
George Keishing0ea976a2017-12-08 01:09:40 -0600259
George Keishinge053d342019-10-25 07:16:20 -0500260 Wait Until Keyword Succeeds 3 mins 15 secs
George Keishing0ea976a2017-12-08 01:09:40 -0600261 ... Check IPMI SOL Output Content ISTEP
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500262
George Keishinge053d342019-10-25 07:16:20 -0500263
Rahul Maheshwari9e0b4d62017-06-21 06:42:46 -0500264Get SOL Setting
265 [Documentation] Returns status for given SOL setting.
266 [Arguments] ${setting}
267 # Description of argument(s):
268 # setting SOL setting which needs to be read(e.g. "Retry Count").
269
270 ${sol_info_dict}= Get SOL Info
271 ${setting_status}= Get From Dictionary ${sol_info_dict} ${setting}
272
273 [Return] ${setting_status}
274
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500275
276Restore Default SOL Configuration
277 [Documentation] Restore default SOL configuration.
278
Rahul Maheshwarid71cd952017-06-20 21:30:51 -0500279 Set SOL Setting enabled true
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500280 Set SOL Setting retry-count 7
281 Set SOL Setting retry-interval 10
282 Set SOL Setting character-accumulate-level 20
283 Set SOL Setting character-send-threshold 1
Rahul Maheshwari6fe52b92017-06-16 03:35:26 -0500284 Set SOL Setting privilege-level user
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500285
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500286
George Keishing0ea976a2017-12-08 01:09:40 -0600287Test Teardown Execution
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500288 [Documentation] Do the post test teardown.
289
George Keishinge053d342019-10-25 07:16:20 -0500290 Wait Until Keyword Succeeds 15 sec 5 sec Restore Default SOL Configuration
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500291 Deactivate SOL Via IPMI
Rahul Maheshwari2a175112017-08-22 05:06:49 -0500292 ${sol_log}= Stop SOL Console Logging
293 Log ${sol_log}
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500294 FFDC On Test Case Fail