blob: 13ce00a38a04d79bf9d8084ef10fc923b6f83042 [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
60 : FOR ${item} IN @{privilege_level_list}
Rahul Maheshwari9e0b4d62017-06-21 06:42:46 -050061 \ Set SOL Setting privilege-level ${item}
62 \ ${output}= Get SOL Setting Privilege Level
Rahul Maheshwari6fe52b92017-06-16 03:35:26 -050063 \ Should Contain ${output} ${item} ignore_case=True
64
65
66Set Invalid SOL Privilege Level
67 [Documentation] Verify invalid SOL's retry count via IPMI.
68 [Tags] Set_Invalid_SOL_Privilege_Level
69
70 ${value}= Generate Random String ${8}
71 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
72 ... sol set privilege-level ${value}
73 Should Contain ${msg} Invalid value ignore_case=True
74
75
Rahul Maheshwaria88de442017-06-16 01:05:16 -050076Set Invalid SOL Retry Count
77 [Documentation] Verify invalid SOL's retry count via IPMI.
78 [Tags] Set_Invalid_SOL_Retry_Count
79
Gunnar Mills28e403b2017-10-25 16:16:38 -050080 # Any integer above 7 is invalid for SOL retry count.
Rahul Maheshwaria88de442017-06-16 01:05:16 -050081 ${value}= Evaluate random.randint(8, 10000) modules=random
82
83 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
84 ... sol set retry-count ${value}
85 Should Contain ${msg} Invalid value ignore_case=True
86
87
88Set Invalid SOL Retry Interval
89 [Documentation] Verify invalid SOL's retry interval via IPMI.
90 [Tags] Set_Invalid_SOL_Retry_Interval
91
Gunnar Mills28e403b2017-10-25 16:16:38 -050092 # Any integer above 255 is invalid for SOL retry interval.
Rahul Maheshwaria88de442017-06-16 01:05:16 -050093 ${value}= Evaluate random.randint(256, 10000) modules=random
94
95 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
96 ... sol set retry-interval ${value}
97 Should Contain ${msg} Invalid value ignore_case=True
98
99
100Set Invalid SOL Character Accumulate Level
101 [Documentation] Verify invalid SOL's character accumulate level via IPMI.
102 [Tags] Set_Invalid_SOL_Character_Accumulate_Level
103
104 # Any integer above 255 is invalid for SOL character accumulate level.
105 ${value}= Evaluate random.randint(256, 10000) modules=random
106
107 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
108 ... sol set character-accumulate-level ${value}
109 Should Contain ${msg} Invalid value ignore_case=True
110
111
112Set Invalid SOL Character Send Threshold
113 [Documentation] Verify invalid SOL's character send threshold via IPMI.
114 [Tags] Set_Invalid_SOL_Character_Send_Threshold
115
Gunnar Mills28e403b2017-10-25 16:16:38 -0500116 # Any integer above 255 is invalid for SOL character send threshold.
Rahul Maheshwaria88de442017-06-16 01:05:16 -0500117 ${value}= Evaluate random.randint(256, 10000) modules=random
118
119 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
120 ... sol set character-send-threshold ${value}
121 Should Contain ${msg} Invalid value ignore_case=True
122
123
George Keishing1ca77aa2017-08-21 23:55:51 -0500124Verify SOL During Boot
125 [Documentation] Verify SOL during boot.
126 [Tags] Verify_SOL_During_Boot
127
George Keishinge053d342019-10-25 07:16:20 -0500128 Redfish Hard Power Off
George Keishing1ca77aa2017-08-21 23:55:51 -0500129 Activate SOL Via IPMI
George Keishinge053d342019-10-25 07:16:20 -0500130 Initiate Host Boot Via External IPMI wait=${0}
George Keishingde9804a2017-09-28 04:03:11 -0500131
George Keishinge053d342019-10-25 07:16:20 -0500132 Wait Until Keyword Succeeds 3 mins 15 secs
133 ... Check IPMI SOL Output Content Welcome to Hostboot
134
135 Wait Until Keyword Succeeds 3 mins 15 secs
136 ... Check IPMI SOL Output Content ISTEP
137
138 Redfish Hard Power Off
George Keishing5632f3c2018-11-01 00:39:10 -0500139
140
George Keishing1ca77aa2017-08-21 23:55:51 -0500141Verify Deactivate Non Existing SOL
142 [Documentation] Verify deactivate non existing SOL session.
143 [Tags] Verify_Deactivate_Non_Existing_SOL
144
145 ${resp}= Deactivate SOL Via IPMI
146 Should Contain ${resp} SOL payload already de-activated
147 ... case_insensitive=True
148
149
150Set Valid SOL Retry Count
George Keishing1ca77aa2017-08-21 23:55:51 -0500151 [Documentation] Verify valid SOL's retry count via IPMI.
152 [Tags] Set_Valid_SOL_Retry_Count
George Keishing1ca77aa2017-08-21 23:55:51 -0500153 [Template] Verify SOL Setting
154
George Keishing5abfe602018-07-05 11:54:37 -0500155 # Setting name Min valid value Max valid value
156 retry-count 0 7
157
George Keishing1ca77aa2017-08-21 23:55:51 -0500158
159Set Valid SOL Retry Interval
George Keishing1ca77aa2017-08-21 23:55:51 -0500160 [Documentation] Verify valid SOL's retry interval via IPMI.
161 [Tags] Set_Valid_SOL_Retry_Interval
George Keishing1ca77aa2017-08-21 23:55:51 -0500162 [Template] Verify SOL Setting
163
George Keishing5abfe602018-07-05 11:54:37 -0500164 # Setting name Min valid value Max valid value
165 retry-interval 0 255
166
George Keishing1ca77aa2017-08-21 23:55:51 -0500167
168Set Valid SOL Character Accumulate Level
George Keishing1ca77aa2017-08-21 23:55:51 -0500169 [Documentation] Verify valid SOL's character accumulate level via IPMI.
170 [Tags] Set_Valid_SOL_Character_Accumulate_Level
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 character-accumulate-level 1 255
175
George Keishing1ca77aa2017-08-21 23:55:51 -0500176
177Set Valid SOL Character Send Threshold
George Keishing1ca77aa2017-08-21 23:55:51 -0500178 [Documentation] Verify valid SOL's character send threshold via IPMI.
179 [Tags] Set_Valid_SOL_Character_Send_Threshold
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 character-send-threshold 0 255
184
Anusha Dathatric3a0bb72020-02-12 07:52:40 -0600185
186Verify Continuous Activation And Deactivation Of SOL
187 [Documentation] Continuously on and off SOL.
188 [Tags] Verify_Continuous_Activation_And_Deactivation_Of_SOL
189
190 ${iteration_count}= Evaluate random.randint(5,10) modules=random
191 FOR ${iter} IN RANGE ${iteration_count}
192 Activate SOL Via IPMI
193 Deactivate SOL Via IPMI
194 END
195
196
Rahul Maheshwari982fee42017-05-03 00:33:15 -0500197*** Keywords ***
198
Rahul Maheshwari982fee42017-05-03 00:33:15 -0500199Check IPMI SOL Output Content
200 [Documentation] Check if SOL has given content.
201 [Arguments] ${data} ${file_path}=/tmp/sol_${OPENBMC_HOST}
202 # Description of argument(s):
203 # data Content which need to be checked(e.g. Petitboot, ISTEP).
204 # file_path The file path on the local machine to check SOL content.
205 # By default it check SOL content from /tmp/sol_<BMC_IP>.
206
George Keishing6f88c5e2019-07-03 13:54:12 -0500207 ${output}= OperatingSystem.Get File ${file_path} encoding_errors=ignore
Rahul Maheshwari982fee42017-05-03 00:33:15 -0500208 Should Contain ${output} ${data} case_insensitive=True
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500209
210
211Verify SOL Setting
212 [Documentation] Verify SOL Setting via IPMI.
213 [Arguments] ${setting_name} ${min_value} ${max_value}
214 # Description of Arguments:
215 # setting_name Setting to verify (e.g. "retry-count").
216 # min_value min valid value for given setting.
217 # max_value max valid value for given setting.
218
219 ${value}=
220 ... Evaluate random.randint(${min_value}, ${max_value}) modules=random
221
222 # Character accumulate level setting is set in multiples of 5.
223 # Retry interval setting is set in multiples of 10.
224 # Reference IPMI specification v2.0
225
226 ${expected_value}= Run Keyword If
227 ... '${setting_name}' == 'character-accumulate-level' Evaluate ${value}*5
228 ... ELSE IF '${setting_name}' == 'retry-interval' Evaluate ${value}*10
229 ... ELSE Set Variable ${value}
230
231 Set SOL Setting ${setting_name} '${value}'
232
233 # Replace "-" with space " " in setting name.
234 # E.g. "retry-count" to "retry count"
235 ${setting_name}= Evaluate $setting_name.replace('-',' ')
236
237 ${sol_info_dict}= Get SOL Info
238
239 # Get exact SOL setting name from sol info output.
240 ${list}= Get Matches ${sol_info_dict} ${setting_name}*
241 ... case_insensitive=${True}
242 ${setting_name_from_dict}= Get From List ${list} 0
243
244 # Get SOL setting value from above setting name.
245 ${setting_value}= Get From Dictionary
246 ... ${sol_info_dict} ${setting_name_from_dict}
247
248 Should Be Equal '${setting_value}' '${expected_value}'
249
George Keishinge053d342019-10-25 07:16:20 -0500250 Redfish Hard Power Off
251
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500252 Initiate Host Boot Via External IPMI wait=${0}
253
254 Activate SOL Via IPMI
George Keishinge053d342019-10-25 07:16:20 -0500255 Wait Until Keyword Succeeds 3 mins 15 secs
George Keishingd6ddf492018-10-24 09:53:12 -0500256 ... Check IPMI SOL Output Content Welcome to Hostboot
George Keishing0ea976a2017-12-08 01:09:40 -0600257
George Keishinge053d342019-10-25 07:16:20 -0500258 Wait Until Keyword Succeeds 3 mins 15 secs
George Keishing0ea976a2017-12-08 01:09:40 -0600259 ... Check IPMI SOL Output Content ISTEP
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500260
George Keishinge053d342019-10-25 07:16:20 -0500261
Rahul Maheshwari9e0b4d62017-06-21 06:42:46 -0500262Get SOL Setting
263 [Documentation] Returns status for given SOL setting.
264 [Arguments] ${setting}
265 # Description of argument(s):
266 # setting SOL setting which needs to be read(e.g. "Retry Count").
267
268 ${sol_info_dict}= Get SOL Info
269 ${setting_status}= Get From Dictionary ${sol_info_dict} ${setting}
270
271 [Return] ${setting_status}
272
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500273
274Restore Default SOL Configuration
275 [Documentation] Restore default SOL configuration.
276
Rahul Maheshwarid71cd952017-06-20 21:30:51 -0500277 Set SOL Setting enabled true
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500278 Set SOL Setting retry-count 7
279 Set SOL Setting retry-interval 10
280 Set SOL Setting character-accumulate-level 20
281 Set SOL Setting character-send-threshold 1
Rahul Maheshwari6fe52b92017-06-16 03:35:26 -0500282 Set SOL Setting privilege-level user
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500283
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500284
George Keishing0ea976a2017-12-08 01:09:40 -0600285Test Teardown Execution
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500286 [Documentation] Do the post test teardown.
287
George Keishinge053d342019-10-25 07:16:20 -0500288 Wait Until Keyword Succeeds 15 sec 5 sec Restore Default SOL Configuration
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500289 Deactivate SOL Via IPMI
Rahul Maheshwari2a175112017-08-22 05:06:49 -0500290 ${sol_log}= Stop SOL Console Logging
291 Log ${sol_log}
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500292 FFDC On Test Case Fail