blob: d70b6967cdbc2a9d7a4cfd8a3535be43ca621a43 [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
Rahul Maheshwari1cd7e432019-03-06 10:27:21 -06007Library ../lib/ipmi_utils.py
Rahul Maheshwari982fee42017-05-03 00:33:15 -05008
Rahul Maheshwari2a175112017-08-22 05:06:49 -05009Test Setup Start SOL Console Logging
George Keishing0ea976a2017-12-08 01:09:40 -060010Test Teardown Test Teardown Execution
Rahul Maheshwari982fee42017-05-03 00:33:15 -050011
Rahul Maheshwari7eea8ed2018-12-18 04:51:38 -060012Force Tags SOL_Test
13
14
Rahul Maheshwari982fee42017-05-03 00:33:15 -050015*** Variables ***
16
17*** Test Cases ***
18
Rahul Maheshwarid71cd952017-06-20 21:30:51 -050019Set SOL Enabled
20 [Documentation] Verify enabling SOL via IPMI.
21 [Tags] Set_SOL_Enabled
22
23 ${msg}= Run Keyword Run IPMI Standard Command
24 ... sol set enabled true
25
26 # Verify SOL status from ipmitool sol info command.
27 ${sol_info_dict}= Get SOL Info
28 ${sol_enable_status}= Get From Dictionary
29 ... ${sol_info_dict} Enabled
30
31 Should Be Equal '${sol_enable_status}' 'true'
32
33
34Set SOL Disabled
35 [Documentation] Verify disabling SOL via IPMI.
36 [Tags] Set_SOL_Disabled
37
38 ${msg}= Run Keyword Run IPMI Standard Command
39 ... sol set enabled false
40
41 # Verify SOL status from ipmitool sol info command.
42 ${sol_info_dict}= Get SOL Info
43 ${sol_enable_status}= Get From Dictionary
44 ... ${sol_info_dict} Enabled
45 Should Be Equal '${sol_enable_status}' 'false'
46
47 # Verify error while activating SOL with SOL disabled.
48 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
49 ... sol activate
50 Should Contain ${msg} SOL payload disabled ignore_case=True
51
52
Rahul Maheshwari6fe52b92017-06-16 03:35:26 -050053Set Valid SOL Privilege Level
54 [Documentation] Verify valid SOL's privilege level via IPMI.
55 [Tags] Set_Valid_SOL_Privilege_Level
56
57 ${privilege_level_list}= Create List user operator admin oem
58 : FOR ${item} IN @{privilege_level_list}
Rahul Maheshwari9e0b4d62017-06-21 06:42:46 -050059 \ Set SOL Setting privilege-level ${item}
60 \ ${output}= Get SOL Setting Privilege Level
Rahul Maheshwari6fe52b92017-06-16 03:35:26 -050061 \ Should Contain ${output} ${item} ignore_case=True
62
63
64Set Invalid SOL Privilege Level
65 [Documentation] Verify invalid SOL's retry count via IPMI.
66 [Tags] Set_Invalid_SOL_Privilege_Level
67
68 ${value}= Generate Random String ${8}
69 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
70 ... sol set privilege-level ${value}
71 Should Contain ${msg} Invalid value ignore_case=True
72
73
Rahul Maheshwaria88de442017-06-16 01:05:16 -050074Set Invalid SOL Retry Count
75 [Documentation] Verify invalid SOL's retry count via IPMI.
76 [Tags] Set_Invalid_SOL_Retry_Count
77
Gunnar Mills28e403b2017-10-25 16:16:38 -050078 # Any integer above 7 is invalid for SOL retry count.
Rahul Maheshwaria88de442017-06-16 01:05:16 -050079 ${value}= Evaluate random.randint(8, 10000) modules=random
80
81 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
82 ... sol set retry-count ${value}
83 Should Contain ${msg} Invalid value ignore_case=True
84
85
86Set Invalid SOL Retry Interval
87 [Documentation] Verify invalid SOL's retry interval via IPMI.
88 [Tags] Set_Invalid_SOL_Retry_Interval
89
Gunnar Mills28e403b2017-10-25 16:16:38 -050090 # Any integer above 255 is invalid for SOL retry interval.
Rahul Maheshwaria88de442017-06-16 01:05:16 -050091 ${value}= Evaluate random.randint(256, 10000) modules=random
92
93 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
94 ... sol set retry-interval ${value}
95 Should Contain ${msg} Invalid value ignore_case=True
96
97
98Set Invalid SOL Character Accumulate Level
99 [Documentation] Verify invalid SOL's character accumulate level via IPMI.
100 [Tags] Set_Invalid_SOL_Character_Accumulate_Level
101
102 # Any integer above 255 is invalid for SOL character accumulate level.
103 ${value}= Evaluate random.randint(256, 10000) modules=random
104
105 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
106 ... sol set character-accumulate-level ${value}
107 Should Contain ${msg} Invalid value ignore_case=True
108
109
110Set Invalid SOL Character Send Threshold
111 [Documentation] Verify invalid SOL's character send threshold via IPMI.
112 [Tags] Set_Invalid_SOL_Character_Send_Threshold
113
Gunnar Mills28e403b2017-10-25 16:16:38 -0500114 # Any integer above 255 is invalid for SOL character send threshold.
Rahul Maheshwaria88de442017-06-16 01:05:16 -0500115 ${value}= Evaluate random.randint(256, 10000) modules=random
116
117 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
118 ... sol set character-send-threshold ${value}
119 Should Contain ${msg} Invalid value ignore_case=True
120
121
George Keishing1ca77aa2017-08-21 23:55:51 -0500122Verify SOL During Boot
123 [Documentation] Verify SOL during boot.
124 [Tags] Verify_SOL_During_Boot
125
126 ${current_state}= Get Host State Via External IPMI
127 Run Keyword If '${current_state}' == 'on'
128 ... Initiate Host PowerOff Via External IPMI
129 Initiate Host Boot Via External IPMI wait=${0}
130
131 Activate SOL Via IPMI
George Keishingde9804a2017-09-28 04:03:11 -0500132 Wait Until Keyword Succeeds 3 mins 30 secs
George Keishingd6ddf492018-10-24 09:53:12 -0500133 ... Check IPMI SOL Output Content Welcome to Hostboot
George Keishingde9804a2017-09-28 04:03:11 -0500134
135 Wait Until Keyword Succeeds 3 mins 30 secs
136 ... Check IPMI SOL Output Content ISTEP
George Keishing1ca77aa2017-08-21 23:55:51 -0500137
George Keishing5632f3c2018-11-01 00:39:10 -0500138 # Allow the host to boot.
139 Wait Until Keyword Succeeds 5 min 20 sec Is Host Running
140
141
George Keishing1ca77aa2017-08-21 23:55:51 -0500142Verify Deactivate Non Existing SOL
143 [Documentation] Verify deactivate non existing SOL session.
144 [Tags] Verify_Deactivate_Non_Existing_SOL
145
146 ${resp}= Deactivate SOL Via IPMI
147 Should Contain ${resp} SOL payload already de-activated
148 ... case_insensitive=True
149
150
151Set Valid SOL Retry Count
George Keishing1ca77aa2017-08-21 23:55:51 -0500152 [Documentation] Verify valid SOL's retry count via IPMI.
153 [Tags] Set_Valid_SOL_Retry_Count
George Keishing1ca77aa2017-08-21 23:55:51 -0500154 [Template] Verify SOL Setting
155
George Keishing5abfe602018-07-05 11:54:37 -0500156 # Setting name Min valid value Max valid value
157 retry-count 0 7
158
George Keishing1ca77aa2017-08-21 23:55:51 -0500159
160Set Valid SOL Retry Interval
George Keishing1ca77aa2017-08-21 23:55:51 -0500161 [Documentation] Verify valid SOL's retry interval via IPMI.
162 [Tags] Set_Valid_SOL_Retry_Interval
George Keishing1ca77aa2017-08-21 23:55:51 -0500163 [Template] Verify SOL Setting
164
George Keishing5abfe602018-07-05 11:54:37 -0500165 # Setting name Min valid value Max valid value
166 retry-interval 0 255
167
George Keishing1ca77aa2017-08-21 23:55:51 -0500168
169Set Valid SOL Character Accumulate Level
George Keishing1ca77aa2017-08-21 23:55:51 -0500170 [Documentation] Verify valid SOL's character accumulate level via IPMI.
171 [Tags] Set_Valid_SOL_Character_Accumulate_Level
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 character-accumulate-level 1 255
176
George Keishing1ca77aa2017-08-21 23:55:51 -0500177
178Set Valid SOL Character Send Threshold
George Keishing1ca77aa2017-08-21 23:55:51 -0500179 [Documentation] Verify valid SOL's character send threshold via IPMI.
180 [Tags] Set_Valid_SOL_Character_Send_Threshold
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 character-send-threshold 0 255
185
Rahul Maheshwari982fee42017-05-03 00:33:15 -0500186*** Keywords ***
187
Rahul Maheshwari982fee42017-05-03 00:33:15 -0500188Check IPMI SOL Output Content
189 [Documentation] Check if SOL has given content.
190 [Arguments] ${data} ${file_path}=/tmp/sol_${OPENBMC_HOST}
191 # Description of argument(s):
192 # data Content which need to be checked(e.g. Petitboot, ISTEP).
193 # file_path The file path on the local machine to check SOL content.
194 # By default it check SOL content from /tmp/sol_<BMC_IP>.
195
196 ${rc} ${output}= Run and Return RC and Output cat ${file_path}
197 Should Be Equal ${rc} ${0} msg=${output}
198
199 Should Contain ${output} ${data} case_insensitive=True
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500200
201
202Verify SOL Setting
203 [Documentation] Verify SOL Setting via IPMI.
204 [Arguments] ${setting_name} ${min_value} ${max_value}
205 # Description of Arguments:
206 # setting_name Setting to verify (e.g. "retry-count").
207 # min_value min valid value for given setting.
208 # max_value max valid value for given setting.
209
210 ${value}=
211 ... Evaluate random.randint(${min_value}, ${max_value}) modules=random
212
213 # Character accumulate level setting is set in multiples of 5.
214 # Retry interval setting is set in multiples of 10.
215 # Reference IPMI specification v2.0
216
217 ${expected_value}= Run Keyword If
218 ... '${setting_name}' == 'character-accumulate-level' Evaluate ${value}*5
219 ... ELSE IF '${setting_name}' == 'retry-interval' Evaluate ${value}*10
220 ... ELSE Set Variable ${value}
221
222 Set SOL Setting ${setting_name} '${value}'
223
224 # Replace "-" with space " " in setting name.
225 # E.g. "retry-count" to "retry count"
226 ${setting_name}= Evaluate $setting_name.replace('-',' ')
227
228 ${sol_info_dict}= Get SOL Info
229
230 # Get exact SOL setting name from sol info output.
231 ${list}= Get Matches ${sol_info_dict} ${setting_name}*
232 ... case_insensitive=${True}
233 ${setting_name_from_dict}= Get From List ${list} 0
234
235 # Get SOL setting value from above setting name.
236 ${setting_value}= Get From Dictionary
237 ... ${sol_info_dict} ${setting_name_from_dict}
238
239 Should Be Equal '${setting_value}' '${expected_value}'
240
241 # Power on host to check if SOL is working fine with new setting.
242 ${current_state}= Get Host State Via External IPMI
243 Run Keyword If '${current_state}' == 'on'
244 ... Initiate Host PowerOff Via External IPMI
245 Initiate Host Boot Via External IPMI wait=${0}
246
247 Activate SOL Via IPMI
248 Wait Until Keyword Succeeds 10 mins 30 secs
George Keishingd6ddf492018-10-24 09:53:12 -0500249 ... Check IPMI SOL Output Content Welcome to Hostboot
George Keishing0ea976a2017-12-08 01:09:40 -0600250
251 Wait Until Keyword Succeeds 3 mins 30 secs
252 ... Check IPMI SOL Output Content ISTEP
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500253
Rahul Maheshwari9e0b4d62017-06-21 06:42:46 -0500254Get SOL Setting
255 [Documentation] Returns status for given SOL setting.
256 [Arguments] ${setting}
257 # Description of argument(s):
258 # setting SOL setting which needs to be read(e.g. "Retry Count").
259
260 ${sol_info_dict}= Get SOL Info
261 ${setting_status}= Get From Dictionary ${sol_info_dict} ${setting}
262
263 [Return] ${setting_status}
264
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500265
266Restore Default SOL Configuration
267 [Documentation] Restore default SOL configuration.
268
Rahul Maheshwarid71cd952017-06-20 21:30:51 -0500269 Set SOL Setting enabled true
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500270 Set SOL Setting retry-count 7
271 Set SOL Setting retry-interval 10
272 Set SOL Setting character-accumulate-level 20
273 Set SOL Setting character-send-threshold 1
Rahul Maheshwari6fe52b92017-06-16 03:35:26 -0500274 Set SOL Setting privilege-level user
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500275
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500276
George Keishing0ea976a2017-12-08 01:09:40 -0600277Test Teardown Execution
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500278 [Documentation] Do the post test teardown.
279
280 Deactivate SOL Via IPMI
Rahul Maheshwari2a175112017-08-22 05:06:49 -0500281 ${sol_log}= Stop SOL Console Logging
282 Log ${sol_log}
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500283 FFDC On Test Case Fail
284 Restore Default SOL Configuration