blob: 3ee3d2c9078404d88dc5ca6588639a1b197dd584 [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
George Keishing6f88c5e2019-07-03 13:54:12 -0500196 ${output}= OperatingSystem.Get File ${file_path} encoding_errors=ignore
Rahul Maheshwari982fee42017-05-03 00:33:15 -0500197 Should Contain ${output} ${data} case_insensitive=True
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500198
199
200Verify SOL Setting
201 [Documentation] Verify SOL Setting via IPMI.
202 [Arguments] ${setting_name} ${min_value} ${max_value}
203 # Description of Arguments:
204 # setting_name Setting to verify (e.g. "retry-count").
205 # min_value min valid value for given setting.
206 # max_value max valid value for given setting.
207
208 ${value}=
209 ... Evaluate random.randint(${min_value}, ${max_value}) modules=random
210
211 # Character accumulate level setting is set in multiples of 5.
212 # Retry interval setting is set in multiples of 10.
213 # Reference IPMI specification v2.0
214
215 ${expected_value}= Run Keyword If
216 ... '${setting_name}' == 'character-accumulate-level' Evaluate ${value}*5
217 ... ELSE IF '${setting_name}' == 'retry-interval' Evaluate ${value}*10
218 ... ELSE Set Variable ${value}
219
220 Set SOL Setting ${setting_name} '${value}'
221
222 # Replace "-" with space " " in setting name.
223 # E.g. "retry-count" to "retry count"
224 ${setting_name}= Evaluate $setting_name.replace('-',' ')
225
226 ${sol_info_dict}= Get SOL Info
227
228 # Get exact SOL setting name from sol info output.
229 ${list}= Get Matches ${sol_info_dict} ${setting_name}*
230 ... case_insensitive=${True}
231 ${setting_name_from_dict}= Get From List ${list} 0
232
233 # Get SOL setting value from above setting name.
234 ${setting_value}= Get From Dictionary
235 ... ${sol_info_dict} ${setting_name_from_dict}
236
237 Should Be Equal '${setting_value}' '${expected_value}'
238
239 # Power on host to check if SOL is working fine with new setting.
240 ${current_state}= Get Host State Via External IPMI
241 Run Keyword If '${current_state}' == 'on'
242 ... Initiate Host PowerOff Via External IPMI
243 Initiate Host Boot Via External IPMI wait=${0}
244
245 Activate SOL Via IPMI
246 Wait Until Keyword Succeeds 10 mins 30 secs
George Keishingd6ddf492018-10-24 09:53:12 -0500247 ... Check IPMI SOL Output Content Welcome to Hostboot
George Keishing0ea976a2017-12-08 01:09:40 -0600248
249 Wait Until Keyword Succeeds 3 mins 30 secs
250 ... Check IPMI SOL Output Content ISTEP
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500251
Rahul Maheshwari9e0b4d62017-06-21 06:42:46 -0500252Get SOL Setting
253 [Documentation] Returns status for given SOL setting.
254 [Arguments] ${setting}
255 # Description of argument(s):
256 # setting SOL setting which needs to be read(e.g. "Retry Count").
257
258 ${sol_info_dict}= Get SOL Info
259 ${setting_status}= Get From Dictionary ${sol_info_dict} ${setting}
260
261 [Return] ${setting_status}
262
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500263
264Restore Default SOL Configuration
265 [Documentation] Restore default SOL configuration.
266
Rahul Maheshwarid71cd952017-06-20 21:30:51 -0500267 Set SOL Setting enabled true
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500268 Set SOL Setting retry-count 7
269 Set SOL Setting retry-interval 10
270 Set SOL Setting character-accumulate-level 20
271 Set SOL Setting character-send-threshold 1
Rahul Maheshwari6fe52b92017-06-16 03:35:26 -0500272 Set SOL Setting privilege-level user
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500273
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500274
George Keishing0ea976a2017-12-08 01:09:40 -0600275Test Teardown Execution
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500276 [Documentation] Do the post test teardown.
277
278 Deactivate SOL Via IPMI
Rahul Maheshwari2a175112017-08-22 05:06:49 -0500279 ${sol_log}= Stop SOL Console Logging
280 Log ${sol_log}
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500281 FFDC On Test Case Fail
282 Restore Default SOL Configuration