blob: b4659c32fe1834449e08b67c332dcd19de61f728 [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
chithragdc5679e2022-03-01 11:51:41 +000010Variables ../data/ipmi_raw_cmd_table.py
Rahul Maheshwari982fee42017-05-03 00:33:15 -050011
Rahul Maheshwari2a175112017-08-22 05:06:49 -050012Test Setup Start SOL Console Logging
George Keishing0ea976a2017-12-08 01:09:40 -060013Test Teardown Test Teardown Execution
Rahul Maheshwari982fee42017-05-03 00:33:15 -050014
Rahul Maheshwari7eea8ed2018-12-18 04:51:38 -060015Force Tags SOL_Test
16
17
Rahul Maheshwari982fee42017-05-03 00:33:15 -050018*** Variables ***
19
chithragdc5679e2022-03-01 11:51:41 +000020@{valid_bit_rates} ${9.6} ${19.2} ${38.4} ${57.6} ${115.2}
21@{setinprogress} set-complete set-in-progress commit-write
22${invalid_bit_rate} 7.5
23
24
Rahul Maheshwari982fee42017-05-03 00:33:15 -050025*** Test Cases ***
26
Rahul Maheshwarid71cd952017-06-20 21:30:51 -050027Set SOL Enabled
28 [Documentation] Verify enabling SOL via IPMI.
29 [Tags] Set_SOL_Enabled
30
31 ${msg}= Run Keyword Run IPMI Standard Command
32 ... sol set enabled true
33
34 # Verify SOL status from ipmitool sol info command.
35 ${sol_info_dict}= Get SOL Info
36 ${sol_enable_status}= Get From Dictionary
37 ... ${sol_info_dict} Enabled
38
39 Should Be Equal '${sol_enable_status}' 'true'
40
41
42Set SOL Disabled
43 [Documentation] Verify disabling SOL via IPMI.
44 [Tags] Set_SOL_Disabled
45
46 ${msg}= Run Keyword Run IPMI Standard Command
47 ... sol set enabled false
48
49 # Verify SOL status from ipmitool sol info command.
50 ${sol_info_dict}= Get SOL Info
51 ${sol_enable_status}= Get From Dictionary
52 ... ${sol_info_dict} Enabled
53 Should Be Equal '${sol_enable_status}' 'false'
54
55 # Verify error while activating SOL with SOL disabled.
56 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
57 ... sol activate
58 Should Contain ${msg} SOL payload disabled ignore_case=True
59
60
Rahul Maheshwari6fe52b92017-06-16 03:35:26 -050061Set Valid SOL Privilege Level
62 [Documentation] Verify valid SOL's privilege level via IPMI.
63 [Tags] Set_Valid_SOL_Privilege_Level
64
65 ${privilege_level_list}= Create List user operator admin oem
Sushil Singhab209cd2020-07-01 09:01:14 -050066
67 FOR ${item} IN @{privilege_level_list}
68 Set SOL Setting privilege-level ${item}
69 ${output}= Get SOL Setting Privilege Level
70 Should Contain ${output} ${item} ignore_case=True
71 END
Rahul Maheshwari6fe52b92017-06-16 03:35:26 -050072
73
74Set Invalid SOL Privilege Level
75 [Documentation] Verify invalid SOL's retry count via IPMI.
76 [Tags] Set_Invalid_SOL_Privilege_Level
77
78 ${value}= Generate Random String ${8}
79 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
80 ... sol set privilege-level ${value}
81 Should Contain ${msg} Invalid value ignore_case=True
82
83
Rahul Maheshwaria88de442017-06-16 01:05:16 -050084Set Invalid SOL Retry Count
85 [Documentation] Verify invalid SOL's retry count via IPMI.
86 [Tags] Set_Invalid_SOL_Retry_Count
87
Gunnar Mills28e403b2017-10-25 16:16:38 -050088 # Any integer above 7 is invalid for SOL retry count.
Rahul Maheshwaria88de442017-06-16 01:05:16 -050089 ${value}= Evaluate random.randint(8, 10000) modules=random
90
91 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
92 ... sol set retry-count ${value}
93 Should Contain ${msg} Invalid value ignore_case=True
94
95
96Set Invalid SOL Retry Interval
97 [Documentation] Verify invalid SOL's retry interval via IPMI.
98 [Tags] Set_Invalid_SOL_Retry_Interval
99
Gunnar Mills28e403b2017-10-25 16:16:38 -0500100 # Any integer above 255 is invalid for SOL retry interval.
Rahul Maheshwaria88de442017-06-16 01:05:16 -0500101 ${value}= Evaluate random.randint(256, 10000) modules=random
102
103 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
104 ... sol set retry-interval ${value}
105 Should Contain ${msg} Invalid value ignore_case=True
106
107
108Set Invalid SOL Character Accumulate Level
109 [Documentation] Verify invalid SOL's character accumulate level via IPMI.
110 [Tags] Set_Invalid_SOL_Character_Accumulate_Level
111
112 # Any integer above 255 is invalid for SOL character accumulate level.
113 ${value}= Evaluate random.randint(256, 10000) modules=random
114
115 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
116 ... sol set character-accumulate-level ${value}
117 Should Contain ${msg} Invalid value ignore_case=True
118
119
120Set Invalid SOL Character Send Threshold
121 [Documentation] Verify invalid SOL's character send threshold via IPMI.
122 [Tags] Set_Invalid_SOL_Character_Send_Threshold
123
Gunnar Mills28e403b2017-10-25 16:16:38 -0500124 # Any integer above 255 is invalid for SOL character send threshold.
Rahul Maheshwaria88de442017-06-16 01:05:16 -0500125 ${value}= Evaluate random.randint(256, 10000) modules=random
126
127 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
128 ... sol set character-send-threshold ${value}
129 Should Contain ${msg} Invalid value ignore_case=True
130
131
George Keishing1ca77aa2017-08-21 23:55:51 -0500132Verify SOL During Boot
chithrag0f0bd532022-04-05 09:49:53 +0000133 [Documentation] Verify SOL activate console output during boot.
George Keishing1ca77aa2017-08-21 23:55:51 -0500134 [Tags] Verify_SOL_During_Boot
135
George Keishing26206722021-11-17 01:29:53 -0600136 IPMI Power Off stack_mode=skip
George Keishing1ca77aa2017-08-21 23:55:51 -0500137 Activate SOL Via IPMI
George Keishinge053d342019-10-25 07:16:20 -0500138 Initiate Host Boot Via External IPMI wait=${0}
George Keishingde9804a2017-09-28 04:03:11 -0500139
chithrag0f0bd532022-04-05 09:49:53 +0000140 Should Not Be Empty ${SOL_BIOS_OUTPUT}
141 Should Not Be Empty ${SOL_LOGIN_OUTPUT}
George Keishinge053d342019-10-25 07:16:20 -0500142
chithrag0f0bd532022-04-05 09:49:53 +0000143 # Content takes maximum of 10 minutes to display in SOL console
144 # SOL_BIOS_OUTPUT - BIOS SOL console output
145 ${status}= Run Keyword And Return Status Wait Until Keyword Succeeds 10 mins 15 secs
146 ... Check IPMI SOL Output Content ${SOL_BIOS_OUTPUT}
George Keishinge053d342019-10-25 07:16:20 -0500147
chithrag0f0bd532022-04-05 09:49:53 +0000148 Run Keyword If '${status}' == 'False'
149 ... Run Keywords IPMI Power Off AND FAIL msg=BIOS not loaded.
150
151 # SOL_LOGIN_OUTPUT - SOL output login prompt
152 # Once host reboot completes, SOL console may take maximum of 15 minutes to get the login prompt.
153 ${status}= Run Keyword And Return Status Wait Until Keyword Succeeds 15 mins 15 secs
154 ... Check IPMI SOL Output Content ${SOL_LOGIN_OUTPUT}
155
156 Run Keyword If '${status}' == 'False'
157 ... IPMI Power Off
George Keishing5632f3c2018-11-01 00:39:10 -0500158
159
George Keishing1ca77aa2017-08-21 23:55:51 -0500160Verify Deactivate Non Existing SOL
161 [Documentation] Verify deactivate non existing SOL session.
162 [Tags] Verify_Deactivate_Non_Existing_SOL
163
164 ${resp}= Deactivate SOL Via IPMI
165 Should Contain ${resp} SOL payload already de-activated
166 ... case_insensitive=True
167
168
169Set Valid SOL Retry Count
George Keishing1ca77aa2017-08-21 23:55:51 -0500170 [Documentation] Verify valid SOL's retry count via IPMI.
171 [Tags] Set_Valid_SOL_Retry_Count
George Keishing1ca77aa2017-08-21 23:55:51 -0500172 [Template] Verify SOL Setting
173
George Keishing5abfe602018-07-05 11:54:37 -0500174 # Setting name Min valid value Max valid value
175 retry-count 0 7
176
George Keishing1ca77aa2017-08-21 23:55:51 -0500177
178Set Valid SOL Retry Interval
George Keishing1ca77aa2017-08-21 23:55:51 -0500179 [Documentation] Verify valid SOL's retry interval via IPMI.
180 [Tags] Set_Valid_SOL_Retry_Interval
George Keishing1ca77aa2017-08-21 23:55:51 -0500181 [Template] Verify SOL Setting
182
George Keishing5abfe602018-07-05 11:54:37 -0500183 # Setting name Min valid value Max valid value
184 retry-interval 0 255
185
George Keishing1ca77aa2017-08-21 23:55:51 -0500186
187Set Valid SOL Character Accumulate Level
George Keishing1ca77aa2017-08-21 23:55:51 -0500188 [Documentation] Verify valid SOL's character accumulate level via IPMI.
189 [Tags] Set_Valid_SOL_Character_Accumulate_Level
George Keishing1ca77aa2017-08-21 23:55:51 -0500190 [Template] Verify SOL Setting
191
George Keishing5abfe602018-07-05 11:54:37 -0500192 # Setting name Min valid value Max valid value
193 character-accumulate-level 1 255
194
George Keishing1ca77aa2017-08-21 23:55:51 -0500195
196Set Valid SOL Character Send Threshold
George Keishing1ca77aa2017-08-21 23:55:51 -0500197 [Documentation] Verify valid SOL's character send threshold via IPMI.
198 [Tags] Set_Valid_SOL_Character_Send_Threshold
George Keishing1ca77aa2017-08-21 23:55:51 -0500199 [Template] Verify SOL Setting
200
George Keishing5abfe602018-07-05 11:54:37 -0500201 # Setting name Min valid value Max valid value
202 character-send-threshold 0 255
203
Anusha Dathatric3a0bb72020-02-12 07:52:40 -0600204
205Verify Continuous Activation And Deactivation Of SOL
206 [Documentation] Continuously on and off SOL.
207 [Tags] Verify_Continuous_Activation_And_Deactivation_Of_SOL
208
209 ${iteration_count}= Evaluate random.randint(5,10) modules=random
210 FOR ${iter} IN RANGE ${iteration_count}
211 Activate SOL Via IPMI
212 Deactivate SOL Via IPMI
213 END
214
215
chithragdc5679e2022-03-01 11:51:41 +0000216Verify SOL Payload Channel
217 [Documentation] Verify SOL payload channel from SOL info.
218 [Tags] Verify_SOL_Payload_Channel
219
220 # Get channel number from SOL Info and verify it is not empty.
221 ${payload_channel}= Get SOL Setting Payload Channel
222 Should Not Be Empty ${payload_channel}
223
224
225Verify SOL Payload Port
226 [Documentation] Verify SOL payload port from SOL info.
227 [Tags] Verify_SOL_Payload_Port
228
229 # Get Payload Port from SOL Info and verify it equal with ipmi port.
230 ${payload_port}= Get SOL Setting Payload Port
231 Should Be Equal ${IPMI_PORT} ${payload_port}
232
233
234Set Valid SOL Non Volatile Bit Rate
235 [Documentation] Verify ability to set valid SOL non-volatile bit rate.
236 [Tags] Set_Valid_SOL_Non_Volatile_Bit_Rate
237
238 FOR ${bit_rate} IN @{valid_bit_rates}
239
240 # Set valid non-volatile-bit-rate from SOL Info.
241 Run Keyword And Expect Error *Parameter not supported*
242 ... Run IPMI Standard Command
243 ... sol set non-volatile-bit-rate ${bit_rate}
244
245 END
246
247
248Set Invalid SOL Non Volatile Bit Rate
249 [Documentation] Verify ability to set invalid SOL non-volatile bit rate.
250 [Tags] Set_Invalid_SOL_Non_Volatile_Bit_Rate
251
252 # Set Invalid non-volatile-bit-rate from SOL Info.
253 ${resp} = Run Keyword and Expect Error *${IPMI_RAW_CMD['SOL']['Set_SOL'][0]}*
254 ... Run IPMI Standard Command sol set non-volatile-bit-rate ${invalid_bit_rate}
255
256 # Compares whether valid values are displayed.
257 Should Contain ${resp} ${IPMI_RAW_CMD['SOL']['Set_SOL'][1]} ignore_case=True
258
259
260Set Valid SOL Volatile Bit Rate
261 [Documentation] Verify ability to set valid SOL volatile bit rate.
262 [Tags] Set_Valid_SOL_Volatile_Bit_Rate
263
264 FOR ${bit_rate} IN @{valid_bit_rates}
265
266 # Set valid volatile-bit-rate from SOL Info.
267 Run Keyword and Expect Error *Parameter not supported*
268 ... Run IPMI Standard Command
269 ... sol set volatile-bit-rate ${bit_rate}
270
271 END
272
273
274Set Invalid SOL Volatile Bit Rate
275 [Documentation] Verify ability to set invalid SOL volatile bit rate.
276 [Tags] Set_Invalid_SOL_Volatile_Bit_Rate
277
278 # Set invalid volatile-bit-rate from SOL Info.
279 ${resp} = Run Keyword and Expect Error *${IPMI_RAW_CMD['SOL']['Set_SOL'][0]}*
280 ... Run IPMI Standard Command sol set volatile-bit-rate ${invalid_bit_rate}
281
282 # Compares whether valid values are displayed.
283 Should Contain ${resp} ${IPMI_RAW_CMD['SOL']['Set_SOL'][1]} ignore_case=True
284
285
286Verify SOL Set In Progress
287 [Documentation] Verify ability to set the set in-progress data for SOL.
288 [Tags] Verify_SOL_Set_In_Progress
289 [Teardown] Run Keywords Set SOL Setting set-in-progress set-complete
290 ... AND Test Teardown Execution
291
292 # Set the param 0 - set-in-progress from SOL Info.
293 FOR ${prog} IN @{setinprogress}
294 Run Keyword Run IPMI Standard Command sol set set-in-progress ${prog}
295 # Get the param 0 - set-in-progress from SOL Info and verify.
296 ${set_inprogress_state}= Get SOL Setting Set in progress
297 Should Be Equal ${prog} ${set_inprogress_state}
298 END
299
300
Rahul Maheshwari982fee42017-05-03 00:33:15 -0500301*** Keywords ***
302
Rahul Maheshwari982fee42017-05-03 00:33:15 -0500303Check IPMI SOL Output Content
304 [Documentation] Check if SOL has given content.
George Keishing26206722021-11-17 01:29:53 -0600305 [Arguments] ${data} ${file_path}=${IPMI_SOL_LOG_FILE}
Nagarjun B2fe6d9e2023-05-25 13:29:12 +0530306
Rahul Maheshwari982fee42017-05-03 00:33:15 -0500307 # Description of argument(s):
308 # data Content which need to be checked(e.g. Petitboot, ISTEP).
309 # file_path The file path on the local machine to check SOL content.
George Keishing26206722021-11-17 01:29:53 -0600310 # By default it check SOL content from log/sol_<BMC_IP>.
Rahul Maheshwari982fee42017-05-03 00:33:15 -0500311
George Keishing6f88c5e2019-07-03 13:54:12 -0500312 ${output}= OperatingSystem.Get File ${file_path} encoding_errors=ignore
Nagarjun B2fe6d9e2023-05-25 13:29:12 +0530313 Should Match Regexp ${output} ${data} case_insensitive=True
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500314
315
316Verify SOL Setting
317 [Documentation] Verify SOL Setting via IPMI.
318 [Arguments] ${setting_name} ${min_value} ${max_value}
319 # Description of Arguments:
320 # setting_name Setting to verify (e.g. "retry-count").
321 # min_value min valid value for given setting.
322 # max_value max valid value for given setting.
323
324 ${value}=
325 ... Evaluate random.randint(${min_value}, ${max_value}) modules=random
326
327 # Character accumulate level setting is set in multiples of 5.
328 # Retry interval setting is set in multiples of 10.
329 # Reference IPMI specification v2.0
330
331 ${expected_value}= Run Keyword If
332 ... '${setting_name}' == 'character-accumulate-level' Evaluate ${value}*5
333 ... ELSE IF '${setting_name}' == 'retry-interval' Evaluate ${value}*10
334 ... ELSE Set Variable ${value}
335
336 Set SOL Setting ${setting_name} '${value}'
337
338 # Replace "-" with space " " in setting name.
339 # E.g. "retry-count" to "retry count"
340 ${setting_name}= Evaluate $setting_name.replace('-',' ')
341
342 ${sol_info_dict}= Get SOL Info
343
344 # Get exact SOL setting name from sol info output.
345 ${list}= Get Matches ${sol_info_dict} ${setting_name}*
346 ... case_insensitive=${True}
347 ${setting_name_from_dict}= Get From List ${list} 0
348
349 # Get SOL setting value from above setting name.
350 ${setting_value}= Get From Dictionary
351 ... ${sol_info_dict} ${setting_name_from_dict}
352
353 Should Be Equal '${setting_value}' '${expected_value}'
354
George Keishing26206722021-11-17 01:29:53 -0600355 IPMI Power Off stack_mode=skip
George Keishinge053d342019-10-25 07:16:20 -0500356
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500357 Initiate Host Boot Via External IPMI wait=${0}
358
359 Activate SOL Via IPMI
ganesanbcbfcd722022-11-25 05:37:49 +0000360 # Content takes maximum of 10 minutes to display in SOL console
361 # SOL_BIOS_OUTPUT - BIOS SOL console output
362 ${status}= Run Keyword And Return Status Wait Until Keyword Succeeds 10 mins 15 secs
363 ... Check IPMI SOL Output Content ${SOL_BIOS_OUTPUT}
George Keishing0ea976a2017-12-08 01:09:40 -0600364
ganesanbcbfcd722022-11-25 05:37:49 +0000365 Run Keyword If '${status}' == 'False'
366 ... Run Keywords IPMI Power Off AND FAIL msg=BIOS not loaded.
367
368 # SOL_LOGIN_OUTPUT - SOL output login prompt
369 # Once host reboot completes, SOL console may take maximum of 15 minutes to get the login prompt.
370 ${status}= Run Keyword And Return Status Wait Until Keyword Succeeds 15 mins 15 secs
371 ... Check IPMI SOL Output Content ${SOL_LOGIN_OUTPUT}
372
373 Run Keyword If '${status}' == 'False'
374 ... IPMI Power Off
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500375
George Keishinge053d342019-10-25 07:16:20 -0500376
Rahul Maheshwari9e0b4d62017-06-21 06:42:46 -0500377Get SOL Setting
378 [Documentation] Returns status for given SOL setting.
379 [Arguments] ${setting}
380 # Description of argument(s):
381 # setting SOL setting which needs to be read(e.g. "Retry Count").
382
383 ${sol_info_dict}= Get SOL Info
384 ${setting_status}= Get From Dictionary ${sol_info_dict} ${setting}
385
386 [Return] ${setting_status}
387
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500388
389Restore Default SOL Configuration
390 [Documentation] Restore default SOL configuration.
391
Rahul Maheshwarid71cd952017-06-20 21:30:51 -0500392 Set SOL Setting enabled true
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500393 Set SOL Setting retry-count 7
394 Set SOL Setting retry-interval 10
395 Set SOL Setting character-accumulate-level 20
396 Set SOL Setting character-send-threshold 1
Rahul Maheshwari6fe52b92017-06-16 03:35:26 -0500397 Set SOL Setting privilege-level user
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500398
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500399
George Keishing0ea976a2017-12-08 01:09:40 -0600400Test Teardown Execution
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500401 [Documentation] Do the post test teardown.
402
George Keishinge053d342019-10-25 07:16:20 -0500403 Wait Until Keyword Succeeds 15 sec 5 sec Restore Default SOL Configuration
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500404 Deactivate SOL Via IPMI
Rahul Maheshwari2a175112017-08-22 05:06:49 -0500405 ${sol_log}= Stop SOL Console Logging
406 Log ${sol_log}
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500407 FFDC On Test Case Fail