blob: 1de0df626755e48e87826cef6d796d559393f6d9 [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
11*** Variables ***
12
13*** Test Cases ***
14
Rahul Maheshwarid71cd952017-06-20 21:30:51 -050015Set SOL Enabled
16 [Documentation] Verify enabling SOL via IPMI.
17 [Tags] Set_SOL_Enabled
18
19 ${msg}= Run Keyword Run IPMI Standard Command
20 ... sol set enabled true
21
22 # Verify SOL status from ipmitool sol info command.
23 ${sol_info_dict}= Get SOL Info
24 ${sol_enable_status}= Get From Dictionary
25 ... ${sol_info_dict} Enabled
26
27 Should Be Equal '${sol_enable_status}' 'true'
28
29
30Set SOL Disabled
31 [Documentation] Verify disabling SOL via IPMI.
32 [Tags] Set_SOL_Disabled
33
34 ${msg}= Run Keyword Run IPMI Standard Command
35 ... sol set enabled false
36
37 # Verify SOL status from ipmitool sol info command.
38 ${sol_info_dict}= Get SOL Info
39 ${sol_enable_status}= Get From Dictionary
40 ... ${sol_info_dict} Enabled
41 Should Be Equal '${sol_enable_status}' 'false'
42
43 # Verify error while activating SOL with SOL disabled.
44 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
45 ... sol activate
46 Should Contain ${msg} SOL payload disabled ignore_case=True
47
48
Rahul Maheshwari6fe52b92017-06-16 03:35:26 -050049Set Valid SOL Privilege Level
50 [Documentation] Verify valid SOL's privilege level via IPMI.
51 [Tags] Set_Valid_SOL_Privilege_Level
52
53 ${privilege_level_list}= Create List user operator admin oem
54 : FOR ${item} IN @{privilege_level_list}
Rahul Maheshwari9e0b4d62017-06-21 06:42:46 -050055 \ Set SOL Setting privilege-level ${item}
56 \ ${output}= Get SOL Setting Privilege Level
Rahul Maheshwari6fe52b92017-06-16 03:35:26 -050057 \ Should Contain ${output} ${item} ignore_case=True
58
59
60Set Invalid SOL Privilege Level
61 [Documentation] Verify invalid SOL's retry count via IPMI.
62 [Tags] Set_Invalid_SOL_Privilege_Level
63
64 ${value}= Generate Random String ${8}
65 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
66 ... sol set privilege-level ${value}
67 Should Contain ${msg} Invalid value ignore_case=True
68
69
Rahul Maheshwaria88de442017-06-16 01:05:16 -050070Set Invalid SOL Retry Count
71 [Documentation] Verify invalid SOL's retry count via IPMI.
72 [Tags] Set_Invalid_SOL_Retry_Count
73
Gunnar Mills28e403b2017-10-25 16:16:38 -050074 # Any integer above 7 is invalid for SOL retry count.
Rahul Maheshwaria88de442017-06-16 01:05:16 -050075 ${value}= Evaluate random.randint(8, 10000) modules=random
76
77 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
78 ... sol set retry-count ${value}
79 Should Contain ${msg} Invalid value ignore_case=True
80
81
82Set Invalid SOL Retry Interval
83 [Documentation] Verify invalid SOL's retry interval via IPMI.
84 [Tags] Set_Invalid_SOL_Retry_Interval
85
Gunnar Mills28e403b2017-10-25 16:16:38 -050086 # Any integer above 255 is invalid for SOL retry interval.
Rahul Maheshwaria88de442017-06-16 01:05:16 -050087 ${value}= Evaluate random.randint(256, 10000) modules=random
88
89 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
90 ... sol set retry-interval ${value}
91 Should Contain ${msg} Invalid value ignore_case=True
92
93
94Set Invalid SOL Character Accumulate Level
95 [Documentation] Verify invalid SOL's character accumulate level via IPMI.
96 [Tags] Set_Invalid_SOL_Character_Accumulate_Level
97
98 # Any integer above 255 is invalid for SOL character accumulate level.
99 ${value}= Evaluate random.randint(256, 10000) modules=random
100
101 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
102 ... sol set character-accumulate-level ${value}
103 Should Contain ${msg} Invalid value ignore_case=True
104
105
106Set Invalid SOL Character Send Threshold
107 [Documentation] Verify invalid SOL's character send threshold via IPMI.
108 [Tags] Set_Invalid_SOL_Character_Send_Threshold
109
Gunnar Mills28e403b2017-10-25 16:16:38 -0500110 # Any integer above 255 is invalid for SOL character send threshold.
Rahul Maheshwaria88de442017-06-16 01:05:16 -0500111 ${value}= Evaluate random.randint(256, 10000) modules=random
112
113 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
114 ... sol set character-send-threshold ${value}
115 Should Contain ${msg} Invalid value ignore_case=True
116
117
George Keishing1ca77aa2017-08-21 23:55:51 -0500118Verify SOL During Boot
119 [Documentation] Verify SOL during boot.
120 [Tags] Verify_SOL_During_Boot
121
122 ${current_state}= Get Host State Via External IPMI
123 Run Keyword If '${current_state}' == 'on'
124 ... Initiate Host PowerOff Via External IPMI
125 Initiate Host Boot Via External IPMI wait=${0}
126
127 Activate SOL Via IPMI
George Keishingde9804a2017-09-28 04:03:11 -0500128 Wait Until Keyword Succeeds 3 mins 30 secs
George Keishingd6ddf492018-10-24 09:53:12 -0500129 ... Check IPMI SOL Output Content Welcome to Hostboot
George Keishingde9804a2017-09-28 04:03:11 -0500130
131 Wait Until Keyword Succeeds 3 mins 30 secs
132 ... Check IPMI SOL Output Content ISTEP
George Keishing1ca77aa2017-08-21 23:55:51 -0500133
George Keishing5632f3c2018-11-01 00:39:10 -0500134 # Allow the host to boot.
135 Wait Until Keyword Succeeds 5 min 20 sec Is Host Running
136
137
George Keishing1ca77aa2017-08-21 23:55:51 -0500138Verify Deactivate Non Existing SOL
139 [Documentation] Verify deactivate non existing SOL session.
140 [Tags] Verify_Deactivate_Non_Existing_SOL
141
142 ${resp}= Deactivate SOL Via IPMI
143 Should Contain ${resp} SOL payload already de-activated
144 ... case_insensitive=True
145
146
147Set Valid SOL Retry Count
George Keishing1ca77aa2017-08-21 23:55:51 -0500148 [Documentation] Verify valid SOL's retry count via IPMI.
149 [Tags] Set_Valid_SOL_Retry_Count
George Keishing1ca77aa2017-08-21 23:55:51 -0500150 [Template] Verify SOL Setting
151
George Keishing5abfe602018-07-05 11:54:37 -0500152 # Setting name Min valid value Max valid value
153 retry-count 0 7
154
George Keishing1ca77aa2017-08-21 23:55:51 -0500155
156Set Valid SOL Retry Interval
George Keishing1ca77aa2017-08-21 23:55:51 -0500157 [Documentation] Verify valid SOL's retry interval via IPMI.
158 [Tags] Set_Valid_SOL_Retry_Interval
George Keishing1ca77aa2017-08-21 23:55:51 -0500159 [Template] Verify SOL Setting
160
George Keishing5abfe602018-07-05 11:54:37 -0500161 # Setting name Min valid value Max valid value
162 retry-interval 0 255
163
George Keishing1ca77aa2017-08-21 23:55:51 -0500164
165Set Valid SOL Character Accumulate Level
George Keishing1ca77aa2017-08-21 23:55:51 -0500166 [Documentation] Verify valid SOL's character accumulate level via IPMI.
167 [Tags] Set_Valid_SOL_Character_Accumulate_Level
George Keishing1ca77aa2017-08-21 23:55:51 -0500168 [Template] Verify SOL Setting
169
George Keishing5abfe602018-07-05 11:54:37 -0500170 # Setting name Min valid value Max valid value
171 character-accumulate-level 1 255
172
George Keishing1ca77aa2017-08-21 23:55:51 -0500173
174Set Valid SOL Character Send Threshold
George Keishing1ca77aa2017-08-21 23:55:51 -0500175 [Documentation] Verify valid SOL's character send threshold via IPMI.
176 [Tags] Set_Valid_SOL_Character_Send_Threshold
George Keishing1ca77aa2017-08-21 23:55:51 -0500177 [Template] Verify SOL Setting
178
George Keishing5abfe602018-07-05 11:54:37 -0500179 # Setting name Min valid value Max valid value
180 character-send-threshold 0 255
181
Rahul Maheshwari982fee42017-05-03 00:33:15 -0500182*** Keywords ***
183
Rahul Maheshwari982fee42017-05-03 00:33:15 -0500184Check IPMI SOL Output Content
185 [Documentation] Check if SOL has given content.
186 [Arguments] ${data} ${file_path}=/tmp/sol_${OPENBMC_HOST}
187 # Description of argument(s):
188 # data Content which need to be checked(e.g. Petitboot, ISTEP).
189 # file_path The file path on the local machine to check SOL content.
190 # By default it check SOL content from /tmp/sol_<BMC_IP>.
191
192 ${rc} ${output}= Run and Return RC and Output cat ${file_path}
193 Should Be Equal ${rc} ${0} msg=${output}
194
195 Should Contain ${output} ${data} case_insensitive=True
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500196
197
198Verify SOL Setting
199 [Documentation] Verify SOL Setting via IPMI.
200 [Arguments] ${setting_name} ${min_value} ${max_value}
201 # Description of Arguments:
202 # setting_name Setting to verify (e.g. "retry-count").
203 # min_value min valid value for given setting.
204 # max_value max valid value for given setting.
205
206 ${value}=
207 ... Evaluate random.randint(${min_value}, ${max_value}) modules=random
208
209 # Character accumulate level setting is set in multiples of 5.
210 # Retry interval setting is set in multiples of 10.
211 # Reference IPMI specification v2.0
212
213 ${expected_value}= Run Keyword If
214 ... '${setting_name}' == 'character-accumulate-level' Evaluate ${value}*5
215 ... ELSE IF '${setting_name}' == 'retry-interval' Evaluate ${value}*10
216 ... ELSE Set Variable ${value}
217
218 Set SOL Setting ${setting_name} '${value}'
219
220 # Replace "-" with space " " in setting name.
221 # E.g. "retry-count" to "retry count"
222 ${setting_name}= Evaluate $setting_name.replace('-',' ')
223
224 ${sol_info_dict}= Get SOL Info
225
226 # Get exact SOL setting name from sol info output.
227 ${list}= Get Matches ${sol_info_dict} ${setting_name}*
228 ... case_insensitive=${True}
229 ${setting_name_from_dict}= Get From List ${list} 0
230
231 # Get SOL setting value from above setting name.
232 ${setting_value}= Get From Dictionary
233 ... ${sol_info_dict} ${setting_name_from_dict}
234
235 Should Be Equal '${setting_value}' '${expected_value}'
236
237 # Power on host to check if SOL is working fine with new setting.
238 ${current_state}= Get Host State Via External IPMI
239 Run Keyword If '${current_state}' == 'on'
240 ... Initiate Host PowerOff Via External IPMI
241 Initiate Host Boot Via External IPMI wait=${0}
242
243 Activate SOL Via IPMI
244 Wait Until Keyword Succeeds 10 mins 30 secs
George Keishingd6ddf492018-10-24 09:53:12 -0500245 ... Check IPMI SOL Output Content Welcome to Hostboot
George Keishing0ea976a2017-12-08 01:09:40 -0600246
247 Wait Until Keyword Succeeds 3 mins 30 secs
248 ... Check IPMI SOL Output Content ISTEP
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500249
Rahul Maheshwari9e0b4d62017-06-21 06:42:46 -0500250Get SOL Setting
251 [Documentation] Returns status for given SOL setting.
252 [Arguments] ${setting}
253 # Description of argument(s):
254 # setting SOL setting which needs to be read(e.g. "Retry Count").
255
256 ${sol_info_dict}= Get SOL Info
257 ${setting_status}= Get From Dictionary ${sol_info_dict} ${setting}
258
259 [Return] ${setting_status}
260
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500261
262Restore Default SOL Configuration
263 [Documentation] Restore default SOL configuration.
264
Rahul Maheshwarid71cd952017-06-20 21:30:51 -0500265 Set SOL Setting enabled true
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500266 Set SOL Setting retry-count 7
267 Set SOL Setting retry-interval 10
268 Set SOL Setting character-accumulate-level 20
269 Set SOL Setting character-send-threshold 1
Rahul Maheshwari6fe52b92017-06-16 03:35:26 -0500270 Set SOL Setting privilege-level user
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500271
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500272
George Keishing0ea976a2017-12-08 01:09:40 -0600273Test Teardown Execution
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500274 [Documentation] Do the post test teardown.
275
276 Deactivate SOL Via IPMI
Rahul Maheshwari2a175112017-08-22 05:06:49 -0500277 ${sol_log}= Stop SOL Console Logging
278 Log ${sol_log}
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500279 FFDC On Test Case Fail
280 Restore Default SOL Configuration