blob: 25d56c8d8acd5925f5a62195aa871ba72caca7c0 [file] [log] [blame]
Rahul Maheshwari982fee42017-05-03 00:33:15 -05001*** Settings ***
2Documentation This suite tests IPMI SOL in OpenBMC.
3
4Resource ../../lib/ipmi_client.robot
5Resource ../../lib/openbmc_ffdc.robot
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -05006Library ../../lib/ipmi_utils.py
Rahul Maheshwari982fee42017-05-03 00:33:15 -05007
Rahul Maheshwari2a175112017-08-22 05:06:49 -05008Test Setup Start SOL Console Logging
George Keishing0ea976a2017-12-08 01:09:40 -06009Test Teardown Test Teardown Execution
Rahul Maheshwari982fee42017-05-03 00:33:15 -050010
Rahul Maheshwari7eea8ed2018-12-18 04:51:38 -060011Force Tags SOL_Test
12
13
Rahul Maheshwari982fee42017-05-03 00:33:15 -050014*** Variables ***
15
16*** Test Cases ***
17
Rahul Maheshwarid71cd952017-06-20 21:30:51 -050018Set SOL Enabled
19 [Documentation] Verify enabling SOL via IPMI.
20 [Tags] Set_SOL_Enabled
21
22 ${msg}= Run Keyword Run IPMI Standard Command
23 ... sol set enabled true
24
25 # Verify SOL status from ipmitool sol info command.
26 ${sol_info_dict}= Get SOL Info
27 ${sol_enable_status}= Get From Dictionary
28 ... ${sol_info_dict} Enabled
29
30 Should Be Equal '${sol_enable_status}' 'true'
31
32
33Set SOL Disabled
34 [Documentation] Verify disabling SOL via IPMI.
35 [Tags] Set_SOL_Disabled
36
37 ${msg}= Run Keyword Run IPMI Standard Command
38 ... sol set enabled false
39
40 # Verify SOL status from ipmitool sol info command.
41 ${sol_info_dict}= Get SOL Info
42 ${sol_enable_status}= Get From Dictionary
43 ... ${sol_info_dict} Enabled
44 Should Be Equal '${sol_enable_status}' 'false'
45
46 # Verify error while activating SOL with SOL disabled.
47 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
48 ... sol activate
49 Should Contain ${msg} SOL payload disabled ignore_case=True
50
51
Rahul Maheshwari6fe52b92017-06-16 03:35:26 -050052Set Valid SOL Privilege Level
53 [Documentation] Verify valid SOL's privilege level via IPMI.
54 [Tags] Set_Valid_SOL_Privilege_Level
55
56 ${privilege_level_list}= Create List user operator admin oem
57 : FOR ${item} IN @{privilege_level_list}
Rahul Maheshwari9e0b4d62017-06-21 06:42:46 -050058 \ Set SOL Setting privilege-level ${item}
59 \ ${output}= Get SOL Setting Privilege Level
Rahul Maheshwari6fe52b92017-06-16 03:35:26 -050060 \ Should Contain ${output} ${item} ignore_case=True
61
62
63Set Invalid SOL Privilege Level
64 [Documentation] Verify invalid SOL's retry count via IPMI.
65 [Tags] Set_Invalid_SOL_Privilege_Level
66
67 ${value}= Generate Random String ${8}
68 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
69 ... sol set privilege-level ${value}
70 Should Contain ${msg} Invalid value ignore_case=True
71
72
Rahul Maheshwaria88de442017-06-16 01:05:16 -050073Set Invalid SOL Retry Count
74 [Documentation] Verify invalid SOL's retry count via IPMI.
75 [Tags] Set_Invalid_SOL_Retry_Count
76
Gunnar Mills28e403b2017-10-25 16:16:38 -050077 # Any integer above 7 is invalid for SOL retry count.
Rahul Maheshwaria88de442017-06-16 01:05:16 -050078 ${value}= Evaluate random.randint(8, 10000) modules=random
79
80 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
81 ... sol set retry-count ${value}
82 Should Contain ${msg} Invalid value ignore_case=True
83
84
85Set Invalid SOL Retry Interval
86 [Documentation] Verify invalid SOL's retry interval via IPMI.
87 [Tags] Set_Invalid_SOL_Retry_Interval
88
Gunnar Mills28e403b2017-10-25 16:16:38 -050089 # Any integer above 255 is invalid for SOL retry interval.
Rahul Maheshwaria88de442017-06-16 01:05:16 -050090 ${value}= Evaluate random.randint(256, 10000) modules=random
91
92 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
93 ... sol set retry-interval ${value}
94 Should Contain ${msg} Invalid value ignore_case=True
95
96
97Set Invalid SOL Character Accumulate Level
98 [Documentation] Verify invalid SOL's character accumulate level via IPMI.
99 [Tags] Set_Invalid_SOL_Character_Accumulate_Level
100
101 # Any integer above 255 is invalid for SOL character accumulate level.
102 ${value}= Evaluate random.randint(256, 10000) modules=random
103
104 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
105 ... sol set character-accumulate-level ${value}
106 Should Contain ${msg} Invalid value ignore_case=True
107
108
109Set Invalid SOL Character Send Threshold
110 [Documentation] Verify invalid SOL's character send threshold via IPMI.
111 [Tags] Set_Invalid_SOL_Character_Send_Threshold
112
Gunnar Mills28e403b2017-10-25 16:16:38 -0500113 # Any integer above 255 is invalid for SOL character send threshold.
Rahul Maheshwaria88de442017-06-16 01:05:16 -0500114 ${value}= Evaluate random.randint(256, 10000) modules=random
115
116 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
117 ... sol set character-send-threshold ${value}
118 Should Contain ${msg} Invalid value ignore_case=True
119
120
George Keishing1ca77aa2017-08-21 23:55:51 -0500121Verify SOL During Boot
122 [Documentation] Verify SOL during boot.
123 [Tags] Verify_SOL_During_Boot
124
125 ${current_state}= Get Host State Via External IPMI
126 Run Keyword If '${current_state}' == 'on'
127 ... Initiate Host PowerOff Via External IPMI
128 Initiate Host Boot Via External IPMI wait=${0}
129
130 Activate SOL Via IPMI
George Keishingde9804a2017-09-28 04:03:11 -0500131 Wait Until Keyword Succeeds 3 mins 30 secs
George Keishingd6ddf492018-10-24 09:53:12 -0500132 ... Check IPMI SOL Output Content Welcome to Hostboot
George Keishingde9804a2017-09-28 04:03:11 -0500133
134 Wait Until Keyword Succeeds 3 mins 30 secs
135 ... Check IPMI SOL Output Content ISTEP
George Keishing1ca77aa2017-08-21 23:55:51 -0500136
George Keishing5632f3c2018-11-01 00:39:10 -0500137 # Allow the host to boot.
138 Wait Until Keyword Succeeds 5 min 20 sec Is Host Running
139
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
Rahul Maheshwari982fee42017-05-03 00:33:15 -0500185*** Keywords ***
186
Rahul Maheshwari982fee42017-05-03 00:33:15 -0500187Check IPMI SOL Output Content
188 [Documentation] Check if SOL has given content.
189 [Arguments] ${data} ${file_path}=/tmp/sol_${OPENBMC_HOST}
190 # Description of argument(s):
191 # data Content which need to be checked(e.g. Petitboot, ISTEP).
192 # file_path The file path on the local machine to check SOL content.
193 # By default it check SOL content from /tmp/sol_<BMC_IP>.
194
195 ${rc} ${output}= Run and Return RC and Output cat ${file_path}
196 Should Be Equal ${rc} ${0} msg=${output}
197
198 Should Contain ${output} ${data} case_insensitive=True
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500199
200
201Verify SOL Setting
202 [Documentation] Verify SOL Setting via IPMI.
203 [Arguments] ${setting_name} ${min_value} ${max_value}
204 # Description of Arguments:
205 # setting_name Setting to verify (e.g. "retry-count").
206 # min_value min valid value for given setting.
207 # max_value max valid value for given setting.
208
209 ${value}=
210 ... Evaluate random.randint(${min_value}, ${max_value}) modules=random
211
212 # Character accumulate level setting is set in multiples of 5.
213 # Retry interval setting is set in multiples of 10.
214 # Reference IPMI specification v2.0
215
216 ${expected_value}= Run Keyword If
217 ... '${setting_name}' == 'character-accumulate-level' Evaluate ${value}*5
218 ... ELSE IF '${setting_name}' == 'retry-interval' Evaluate ${value}*10
219 ... ELSE Set Variable ${value}
220
221 Set SOL Setting ${setting_name} '${value}'
222
223 # Replace "-" with space " " in setting name.
224 # E.g. "retry-count" to "retry count"
225 ${setting_name}= Evaluate $setting_name.replace('-',' ')
226
227 ${sol_info_dict}= Get SOL Info
228
229 # Get exact SOL setting name from sol info output.
230 ${list}= Get Matches ${sol_info_dict} ${setting_name}*
231 ... case_insensitive=${True}
232 ${setting_name_from_dict}= Get From List ${list} 0
233
234 # Get SOL setting value from above setting name.
235 ${setting_value}= Get From Dictionary
236 ... ${sol_info_dict} ${setting_name_from_dict}
237
238 Should Be Equal '${setting_value}' '${expected_value}'
239
240 # Power on host to check if SOL is working fine with new setting.
241 ${current_state}= Get Host State Via External IPMI
242 Run Keyword If '${current_state}' == 'on'
243 ... Initiate Host PowerOff Via External IPMI
244 Initiate Host Boot Via External IPMI wait=${0}
245
246 Activate SOL Via IPMI
247 Wait Until Keyword Succeeds 10 mins 30 secs
George Keishingd6ddf492018-10-24 09:53:12 -0500248 ... Check IPMI SOL Output Content Welcome to Hostboot
George Keishing0ea976a2017-12-08 01:09:40 -0600249
250 Wait Until Keyword Succeeds 3 mins 30 secs
251 ... Check IPMI SOL Output Content ISTEP
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500252
Rahul Maheshwari9e0b4d62017-06-21 06:42:46 -0500253Get SOL Setting
254 [Documentation] Returns status for given SOL setting.
255 [Arguments] ${setting}
256 # Description of argument(s):
257 # setting SOL setting which needs to be read(e.g. "Retry Count").
258
259 ${sol_info_dict}= Get SOL Info
260 ${setting_status}= Get From Dictionary ${sol_info_dict} ${setting}
261
262 [Return] ${setting_status}
263
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500264
265Restore Default SOL Configuration
266 [Documentation] Restore default SOL configuration.
267
Rahul Maheshwarid71cd952017-06-20 21:30:51 -0500268 Set SOL Setting enabled true
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500269 Set SOL Setting retry-count 7
270 Set SOL Setting retry-interval 10
271 Set SOL Setting character-accumulate-level 20
272 Set SOL Setting character-send-threshold 1
Rahul Maheshwari6fe52b92017-06-16 03:35:26 -0500273 Set SOL Setting privilege-level user
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500274
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500275
George Keishing0ea976a2017-12-08 01:09:40 -0600276Test Teardown Execution
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500277 [Documentation] Do the post test teardown.
278
279 Deactivate SOL Via IPMI
Rahul Maheshwari2a175112017-08-22 05:06:49 -0500280 ${sol_log}= Stop SOL Console Logging
281 Log ${sol_log}
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500282 FFDC On Test Case Fail
283 Restore Default SOL Configuration