blob: 853db02312b08401b709b1129d6f2ded7a8d51cd [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
George Keishing87dc4422023-10-20 12:56:30 +053015Force Tags IPMI_SOL
Rahul Maheshwari7eea8ed2018-12-18 04:51:38 -060016
Rahul Maheshwari982fee42017-05-03 00:33:15 -050017*** Variables ***
18
chithragdc5679e2022-03-01 11:51:41 +000019@{valid_bit_rates} ${9.6} ${19.2} ${38.4} ${57.6} ${115.2}
20@{setinprogress} set-complete set-in-progress commit-write
21${invalid_bit_rate} 7.5
22
23
Rahul Maheshwari982fee42017-05-03 00:33:15 -050024*** Test Cases ***
25
Rahul Maheshwarid71cd952017-06-20 21:30:51 -050026Set SOL Enabled
27 [Documentation] Verify enabling SOL via IPMI.
28 [Tags] Set_SOL_Enabled
29
ishwaryamathim372cd862023-11-14 18:12:23 +000030 ${msg}= Run Keyword Run External IPMI Standard Command
Rahul Maheshwarid71cd952017-06-20 21:30:51 -050031 ... sol set enabled true
32
33 # Verify SOL status from ipmitool sol info command.
34 ${sol_info_dict}= Get SOL Info
35 ${sol_enable_status}= Get From Dictionary
36 ... ${sol_info_dict} Enabled
37
38 Should Be Equal '${sol_enable_status}' 'true'
39
40
41Set SOL Disabled
42 [Documentation] Verify disabling SOL via IPMI.
43 [Tags] Set_SOL_Disabled
44
ishwaryamathim372cd862023-11-14 18:12:23 +000045 ${msg}= Run Keyword Run External IPMI Standard Command
Rahul Maheshwarid71cd952017-06-20 21:30:51 -050046 ... sol set enabled false
47
48 # Verify SOL status from ipmitool sol info command.
49 ${sol_info_dict}= Get SOL Info
50 ${sol_enable_status}= Get From Dictionary
51 ... ${sol_info_dict} Enabled
52 Should Be Equal '${sol_enable_status}' 'false'
53
54 # Verify error while activating SOL with SOL disabled.
ishwaryamathim372cd862023-11-14 18:12:23 +000055 ${msg}= Run Keyword And Expect Error * Run External IPMI Standard Command
Rahul Maheshwarid71cd952017-06-20 21:30:51 -050056 ... sol activate
57 Should Contain ${msg} SOL payload disabled ignore_case=True
58
59
Rahul Maheshwari6fe52b92017-06-16 03:35:26 -050060Set Valid SOL Privilege Level
61 [Documentation] Verify valid SOL's privilege level via IPMI.
62 [Tags] Set_Valid_SOL_Privilege_Level
63
64 ${privilege_level_list}= Create List user operator admin oem
Sushil Singhab209cd2020-07-01 09:01:14 -050065
66 FOR ${item} IN @{privilege_level_list}
67 Set SOL Setting privilege-level ${item}
68 ${output}= Get SOL Setting Privilege Level
69 Should Contain ${output} ${item} ignore_case=True
70 END
Rahul Maheshwari6fe52b92017-06-16 03:35:26 -050071
72
73Set Invalid SOL Privilege Level
74 [Documentation] Verify invalid SOL's retry count via IPMI.
75 [Tags] Set_Invalid_SOL_Privilege_Level
76
77 ${value}= Generate Random String ${8}
ishwaryamathim372cd862023-11-14 18:12:23 +000078 ${msg}= Run Keyword And Expect Error * Run External IPMI Standard Command
Rahul Maheshwari6fe52b92017-06-16 03:35:26 -050079 ... sol set privilege-level ${value}
80 Should Contain ${msg} Invalid value ignore_case=True
81
82
Rahul Maheshwaria88de442017-06-16 01:05:16 -050083Set Invalid SOL Retry Count
84 [Documentation] Verify invalid SOL's retry count via IPMI.
85 [Tags] Set_Invalid_SOL_Retry_Count
86
Gunnar Mills28e403b2017-10-25 16:16:38 -050087 # Any integer above 7 is invalid for SOL retry count.
Rahul Maheshwaria88de442017-06-16 01:05:16 -050088 ${value}= Evaluate random.randint(8, 10000) modules=random
89
ishwaryamathim372cd862023-11-14 18:12:23 +000090 ${msg}= Run Keyword And Expect Error * Run External IPMI Standard Command
Rahul Maheshwaria88de442017-06-16 01:05:16 -050091 ... sol set retry-count ${value}
92 Should Contain ${msg} Invalid value ignore_case=True
93
94
95Set Invalid SOL Retry Interval
96 [Documentation] Verify invalid SOL's retry interval via IPMI.
97 [Tags] Set_Invalid_SOL_Retry_Interval
98
Gunnar Mills28e403b2017-10-25 16:16:38 -050099 # Any integer above 255 is invalid for SOL retry interval.
Rahul Maheshwaria88de442017-06-16 01:05:16 -0500100 ${value}= Evaluate random.randint(256, 10000) modules=random
101
ishwaryamathim372cd862023-11-14 18:12:23 +0000102 ${msg}= Run Keyword And Expect Error * Run External IPMI Standard Command
Rahul Maheshwaria88de442017-06-16 01:05:16 -0500103 ... sol set retry-interval ${value}
104 Should Contain ${msg} Invalid value ignore_case=True
105
106
107Set Invalid SOL Character Accumulate Level
108 [Documentation] Verify invalid SOL's character accumulate level via IPMI.
109 [Tags] Set_Invalid_SOL_Character_Accumulate_Level
110
111 # Any integer above 255 is invalid for SOL character accumulate level.
112 ${value}= Evaluate random.randint(256, 10000) modules=random
113
ishwaryamathim372cd862023-11-14 18:12:23 +0000114 ${msg}= Run Keyword And Expect Error * Run External IPMI Standard Command
Rahul Maheshwaria88de442017-06-16 01:05:16 -0500115 ... sol set character-accumulate-level ${value}
116 Should Contain ${msg} Invalid value ignore_case=True
117
118
119Set Invalid SOL Character Send Threshold
120 [Documentation] Verify invalid SOL's character send threshold via IPMI.
121 [Tags] Set_Invalid_SOL_Character_Send_Threshold
122
Gunnar Mills28e403b2017-10-25 16:16:38 -0500123 # Any integer above 255 is invalid for SOL character send threshold.
Rahul Maheshwaria88de442017-06-16 01:05:16 -0500124 ${value}= Evaluate random.randint(256, 10000) modules=random
125
ishwaryamathim372cd862023-11-14 18:12:23 +0000126 ${msg}= Run Keyword And Expect Error * Run External IPMI Standard Command
Rahul Maheshwaria88de442017-06-16 01:05:16 -0500127 ... sol set character-send-threshold ${value}
128 Should Contain ${msg} Invalid value ignore_case=True
129
130
George Keishing1ca77aa2017-08-21 23:55:51 -0500131Verify SOL During Boot
chithrag0f0bd532022-04-05 09:49:53 +0000132 [Documentation] Verify SOL activate console output during boot.
George Keishing1ca77aa2017-08-21 23:55:51 -0500133 [Tags] Verify_SOL_During_Boot
134
George Keishing26206722021-11-17 01:29:53 -0600135 IPMI Power Off stack_mode=skip
George Keishing1ca77aa2017-08-21 23:55:51 -0500136 Activate SOL Via IPMI
George Keishinge053d342019-10-25 07:16:20 -0500137 Initiate Host Boot Via External IPMI wait=${0}
George Keishingde9804a2017-09-28 04:03:11 -0500138
chithrag0f0bd532022-04-05 09:49:53 +0000139 Should Not Be Empty ${SOL_BIOS_OUTPUT}
140 Should Not Be Empty ${SOL_LOGIN_OUTPUT}
George Keishinge053d342019-10-25 07:16:20 -0500141
chithrag0f0bd532022-04-05 09:49:53 +0000142 # Content takes maximum of 10 minutes to display in SOL console
143 # SOL_BIOS_OUTPUT - BIOS SOL console output
144 ${status}= Run Keyword And Return Status Wait Until Keyword Succeeds 10 mins 15 secs
145 ... Check IPMI SOL Output Content ${SOL_BIOS_OUTPUT}
George Keishinge053d342019-10-25 07:16:20 -0500146
chithrag0f0bd532022-04-05 09:49:53 +0000147 Run Keyword If '${status}' == 'False'
148 ... Run Keywords IPMI Power Off AND FAIL msg=BIOS not loaded.
149
150 # SOL_LOGIN_OUTPUT - SOL output login prompt
151 # Once host reboot completes, SOL console may take maximum of 15 minutes to get the login prompt.
152 ${status}= Run Keyword And Return Status Wait Until Keyword Succeeds 15 mins 15 secs
153 ... Check IPMI SOL Output Content ${SOL_LOGIN_OUTPUT}
154
155 Run Keyword If '${status}' == 'False'
156 ... IPMI Power Off
George Keishing5632f3c2018-11-01 00:39:10 -0500157
158
George Keishing1ca77aa2017-08-21 23:55:51 -0500159Verify Deactivate Non Existing SOL
160 [Documentation] Verify deactivate non existing SOL session.
161 [Tags] Verify_Deactivate_Non_Existing_SOL
162
163 ${resp}= Deactivate SOL Via IPMI
164 Should Contain ${resp} SOL payload already de-activated
165 ... case_insensitive=True
166
167
168Set Valid SOL Retry Count
George Keishing1ca77aa2017-08-21 23:55:51 -0500169 [Documentation] Verify valid SOL's retry count via IPMI.
170 [Tags] Set_Valid_SOL_Retry_Count
George Keishing1ca77aa2017-08-21 23:55:51 -0500171 [Template] Verify SOL Setting
172
George Keishing5abfe602018-07-05 11:54:37 -0500173 # Setting name Min valid value Max valid value
174 retry-count 0 7
175
George Keishing1ca77aa2017-08-21 23:55:51 -0500176
177Set Valid SOL Retry Interval
George Keishing1ca77aa2017-08-21 23:55:51 -0500178 [Documentation] Verify valid SOL's retry interval via IPMI.
179 [Tags] Set_Valid_SOL_Retry_Interval
George Keishing1ca77aa2017-08-21 23:55:51 -0500180 [Template] Verify SOL Setting
181
George Keishing5abfe602018-07-05 11:54:37 -0500182 # Setting name Min valid value Max valid value
183 retry-interval 0 255
184
George Keishing1ca77aa2017-08-21 23:55:51 -0500185
186Set Valid SOL Character Accumulate Level
George Keishing1ca77aa2017-08-21 23:55:51 -0500187 [Documentation] Verify valid SOL's character accumulate level via IPMI.
188 [Tags] Set_Valid_SOL_Character_Accumulate_Level
George Keishing1ca77aa2017-08-21 23:55:51 -0500189 [Template] Verify SOL Setting
190
George Keishing5abfe602018-07-05 11:54:37 -0500191 # Setting name Min valid value Max valid value
192 character-accumulate-level 1 255
193
George Keishing1ca77aa2017-08-21 23:55:51 -0500194
195Set Valid SOL Character Send Threshold
George Keishing1ca77aa2017-08-21 23:55:51 -0500196 [Documentation] Verify valid SOL's character send threshold via IPMI.
197 [Tags] Set_Valid_SOL_Character_Send_Threshold
George Keishing1ca77aa2017-08-21 23:55:51 -0500198 [Template] Verify SOL Setting
199
George Keishing5abfe602018-07-05 11:54:37 -0500200 # Setting name Min valid value Max valid value
201 character-send-threshold 0 255
202
Anusha Dathatric3a0bb72020-02-12 07:52:40 -0600203
204Verify Continuous Activation And Deactivation Of SOL
205 [Documentation] Continuously on and off SOL.
206 [Tags] Verify_Continuous_Activation_And_Deactivation_Of_SOL
207
208 ${iteration_count}= Evaluate random.randint(5,10) modules=random
209 FOR ${iter} IN RANGE ${iteration_count}
210 Activate SOL Via IPMI
211 Deactivate SOL Via IPMI
212 END
213
214
chithragdc5679e2022-03-01 11:51:41 +0000215Verify SOL Payload Channel
216 [Documentation] Verify SOL payload channel from SOL info.
217 [Tags] Verify_SOL_Payload_Channel
218
219 # Get channel number from SOL Info and verify it is not empty.
220 ${payload_channel}= Get SOL Setting Payload Channel
221 Should Not Be Empty ${payload_channel}
222
223
224Verify SOL Payload Port
225 [Documentation] Verify SOL payload port from SOL info.
226 [Tags] Verify_SOL_Payload_Port
227
228 # Get Payload Port from SOL Info and verify it equal with ipmi port.
229 ${payload_port}= Get SOL Setting Payload Port
230 Should Be Equal ${IPMI_PORT} ${payload_port}
231
232
233Set Valid SOL Non Volatile Bit Rate
234 [Documentation] Verify ability to set valid SOL non-volatile bit rate.
235 [Tags] Set_Valid_SOL_Non_Volatile_Bit_Rate
236
237 FOR ${bit_rate} IN @{valid_bit_rates}
238
239 # Set valid non-volatile-bit-rate from SOL Info.
240 Run Keyword And Expect Error *Parameter not supported*
ishwaryamathim372cd862023-11-14 18:12:23 +0000241 ... Run External IPMI Standard Command
chithragdc5679e2022-03-01 11:51:41 +0000242 ... sol set non-volatile-bit-rate ${bit_rate}
243
244 END
245
246
247Set Invalid SOL Non Volatile Bit Rate
248 [Documentation] Verify ability to set invalid SOL non-volatile bit rate.
249 [Tags] Set_Invalid_SOL_Non_Volatile_Bit_Rate
250
251 # Set Invalid non-volatile-bit-rate from SOL Info.
252 ${resp} = Run Keyword and Expect Error *${IPMI_RAW_CMD['SOL']['Set_SOL'][0]}*
ishwaryamathim372cd862023-11-14 18:12:23 +0000253 ... Run External IPMI Standard Command sol set non-volatile-bit-rate ${invalid_bit_rate}
chithragdc5679e2022-03-01 11:51:41 +0000254
255 # Compares whether valid values are displayed.
256 Should Contain ${resp} ${IPMI_RAW_CMD['SOL']['Set_SOL'][1]} ignore_case=True
257
258
259Set Valid SOL Volatile Bit Rate
260 [Documentation] Verify ability to set valid SOL volatile bit rate.
261 [Tags] Set_Valid_SOL_Volatile_Bit_Rate
262
263 FOR ${bit_rate} IN @{valid_bit_rates}
264
265 # Set valid volatile-bit-rate from SOL Info.
266 Run Keyword and Expect Error *Parameter not supported*
ishwaryamathim372cd862023-11-14 18:12:23 +0000267 ... Run External IPMI Standard Command
chithragdc5679e2022-03-01 11:51:41 +0000268 ... sol set volatile-bit-rate ${bit_rate}
269
270 END
271
272
273Set Invalid SOL Volatile Bit Rate
274 [Documentation] Verify ability to set invalid SOL volatile bit rate.
275 [Tags] Set_Invalid_SOL_Volatile_Bit_Rate
276
277 # Set invalid volatile-bit-rate from SOL Info.
278 ${resp} = Run Keyword and Expect Error *${IPMI_RAW_CMD['SOL']['Set_SOL'][0]}*
ishwaryamathim372cd862023-11-14 18:12:23 +0000279 ... Run External IPMI Standard Command sol set volatile-bit-rate ${invalid_bit_rate}
chithragdc5679e2022-03-01 11:51:41 +0000280
281 # Compares whether valid values are displayed.
282 Should Contain ${resp} ${IPMI_RAW_CMD['SOL']['Set_SOL'][1]} ignore_case=True
283
284
285Verify SOL Set In Progress
286 [Documentation] Verify ability to set the set in-progress data for SOL.
287 [Tags] Verify_SOL_Set_In_Progress
288 [Teardown] Run Keywords Set SOL Setting set-in-progress set-complete
289 ... AND Test Teardown Execution
290
291 # Set the param 0 - set-in-progress from SOL Info.
292 FOR ${prog} IN @{setinprogress}
ishwaryamathim372cd862023-11-14 18:12:23 +0000293 Run Keyword Run External IPMI Standard Command sol set set-in-progress ${prog}
chithragdc5679e2022-03-01 11:51:41 +0000294 # Get the param 0 - set-in-progress from SOL Info and verify.
295 ${set_inprogress_state}= Get SOL Setting Set in progress
296 Should Be Equal ${prog} ${set_inprogress_state}
297 END
298
299
Rahul Maheshwari982fee42017-05-03 00:33:15 -0500300*** Keywords ***
301
Rahul Maheshwari982fee42017-05-03 00:33:15 -0500302Check IPMI SOL Output Content
303 [Documentation] Check if SOL has given content.
George Keishing26206722021-11-17 01:29:53 -0600304 [Arguments] ${data} ${file_path}=${IPMI_SOL_LOG_FILE}
Nagarjun B2fe6d9e2023-05-25 13:29:12 +0530305
Rahul Maheshwari982fee42017-05-03 00:33:15 -0500306 # Description of argument(s):
307 # data Content which need to be checked(e.g. Petitboot, ISTEP).
308 # file_path The file path on the local machine to check SOL content.
George Keishing26206722021-11-17 01:29:53 -0600309 # By default it check SOL content from log/sol_<BMC_IP>.
Rahul Maheshwari982fee42017-05-03 00:33:15 -0500310
George Keishing6f88c5e2019-07-03 13:54:12 -0500311 ${output}= OperatingSystem.Get File ${file_path} encoding_errors=ignore
Nagarjun B2fe6d9e2023-05-25 13:29:12 +0530312 Should Match Regexp ${output} ${data} case_insensitive=True
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500313
314
315Verify SOL Setting
316 [Documentation] Verify SOL Setting via IPMI.
317 [Arguments] ${setting_name} ${min_value} ${max_value}
318 # Description of Arguments:
319 # setting_name Setting to verify (e.g. "retry-count").
320 # min_value min valid value for given setting.
321 # max_value max valid value for given setting.
322
323 ${value}=
324 ... Evaluate random.randint(${min_value}, ${max_value}) modules=random
325
326 # Character accumulate level setting is set in multiples of 5.
327 # Retry interval setting is set in multiples of 10.
328 # Reference IPMI specification v2.0
329
330 ${expected_value}= Run Keyword If
331 ... '${setting_name}' == 'character-accumulate-level' Evaluate ${value}*5
332 ... ELSE IF '${setting_name}' == 'retry-interval' Evaluate ${value}*10
333 ... ELSE Set Variable ${value}
334
335 Set SOL Setting ${setting_name} '${value}'
336
337 # Replace "-" with space " " in setting name.
338 # E.g. "retry-count" to "retry count"
339 ${setting_name}= Evaluate $setting_name.replace('-',' ')
340
341 ${sol_info_dict}= Get SOL Info
342
343 # Get exact SOL setting name from sol info output.
344 ${list}= Get Matches ${sol_info_dict} ${setting_name}*
345 ... case_insensitive=${True}
346 ${setting_name_from_dict}= Get From List ${list} 0
347
348 # Get SOL setting value from above setting name.
349 ${setting_value}= Get From Dictionary
350 ... ${sol_info_dict} ${setting_name_from_dict}
351
352 Should Be Equal '${setting_value}' '${expected_value}'
353
George Keishing26206722021-11-17 01:29:53 -0600354 IPMI Power Off stack_mode=skip
George Keishinge053d342019-10-25 07:16:20 -0500355
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500356 Initiate Host Boot Via External IPMI wait=${0}
357
358 Activate SOL Via IPMI
ganesanbcbfcd722022-11-25 05:37:49 +0000359 # Content takes maximum of 10 minutes to display in SOL console
360 # SOL_BIOS_OUTPUT - BIOS SOL console output
361 ${status}= Run Keyword And Return Status Wait Until Keyword Succeeds 10 mins 15 secs
362 ... Check IPMI SOL Output Content ${SOL_BIOS_OUTPUT}
George Keishing0ea976a2017-12-08 01:09:40 -0600363
ganesanbcbfcd722022-11-25 05:37:49 +0000364 Run Keyword If '${status}' == 'False'
365 ... Run Keywords IPMI Power Off AND FAIL msg=BIOS not loaded.
366
367 # SOL_LOGIN_OUTPUT - SOL output login prompt
368 # Once host reboot completes, SOL console may take maximum of 15 minutes to get the login prompt.
369 ${status}= Run Keyword And Return Status Wait Until Keyword Succeeds 15 mins 15 secs
370 ... Check IPMI SOL Output Content ${SOL_LOGIN_OUTPUT}
371
372 Run Keyword If '${status}' == 'False'
373 ... IPMI Power Off
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500374
George Keishinge053d342019-10-25 07:16:20 -0500375
Rahul Maheshwari9e0b4d62017-06-21 06:42:46 -0500376Get SOL Setting
377 [Documentation] Returns status for given SOL setting.
378 [Arguments] ${setting}
379 # Description of argument(s):
380 # setting SOL setting which needs to be read(e.g. "Retry Count").
381
382 ${sol_info_dict}= Get SOL Info
383 ${setting_status}= Get From Dictionary ${sol_info_dict} ${setting}
384
385 [Return] ${setting_status}
386
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500387
388Restore Default SOL Configuration
389 [Documentation] Restore default SOL configuration.
390
Rahul Maheshwarid71cd952017-06-20 21:30:51 -0500391 Set SOL Setting enabled true
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500392 Set SOL Setting retry-count 7
393 Set SOL Setting retry-interval 10
394 Set SOL Setting character-accumulate-level 20
395 Set SOL Setting character-send-threshold 1
Rahul Maheshwari6fe52b92017-06-16 03:35:26 -0500396 Set SOL Setting privilege-level user
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500397
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500398
George Keishing0ea976a2017-12-08 01:09:40 -0600399Test Teardown Execution
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500400 [Documentation] Do the post test teardown.
401
George Keishinge053d342019-10-25 07:16:20 -0500402 Wait Until Keyword Succeeds 15 sec 5 sec Restore Default SOL Configuration
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500403 Deactivate SOL Via IPMI
Rahul Maheshwari2a175112017-08-22 05:06:49 -0500404 ${sol_log}= Stop SOL Console Logging
405 Log ${sol_log}
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500406 FFDC On Test Case Fail