blob: a39213f7789e7518a1569d5935d7add88ccebc1c [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
Rahul Maheshwari982fee42017-05-03 00:33:15 -05009Test Teardown Post Test Case Execution
10
11*** Variables ***
12
13*** Test Cases ***
14
15Verify SOL During Boot
16 [Documentation] Verify SOL during boot.
17 [Tags] Verify_SOL_During_Boot
18
19 ${current_state}= Get Host State Via External IPMI
Rahul Maheshwaricd441b82017-06-01 13:42:35 -050020 Run Keyword If '${current_state}' == 'on'
Rahul Maheshwari982fee42017-05-03 00:33:15 -050021 ... Initiate Host PowerOff Via External IPMI
22 Initiate Host Boot Via External IPMI wait=${0}
23
24 Activate SOL Via IPMI
25 Wait Until Keyword Succeeds 10 mins 30 secs
26 ... Check IPMI SOL Output Content Petitboot
27
28Verify Deactivate Non Existing SOL
29 [Documentation] Verify deactivate non existing SOL session.
30 [Tags] Verify_Deactivate_Non_Existing_SOL
31
32 ${resp}= Deactivate SOL Via IPMI
33 Should Contain ${resp} SOL payload already de-activated
34 ... case_insensitive=True
35
36
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -050037Set Valid SOL Retry Count
38 # Description of template fields:
39 # Setting name Min valid value Max valid value
40 retry-count 0 7
41 [Documentation] Verify valid SOL's retry count via IPMI.
42 [Tags] Set_Valid_SOL_Retry_Count
43
44 [Template] Verify SOL Setting
45
46
47Set Valid SOL Retry Interval
48 # Description of template fields:
49 # Setting name Min valid value Max valid value
50 retry-interval 0 255
51 [Documentation] Verify valid SOL's retry interval via IPMI.
52 [Tags] Set_Valid_SOL_Retry_Interval
53
54 [Template] Verify SOL Setting
55
56
57Set Valid SOL Character Accumulate Level
58 # Description of template fields:
59 # Setting name Min valid value Max valid value
60 character-accumulate-level 1 255
61 [Documentation] Verify valid SOL's character accumulate level via IPMI.
62 [Tags] Set_Valid_SOL_Character_Accumulate_Level
63
64 [Template] Verify SOL Setting
65
66
67Set Valid SOL Character Send Threshold
68 # Description of template fields:
69 # Setting name Min valid value Max valid value
70 character-send-threshold 0 255
71 [Documentation] Verify valid SOL's character send threshold via IPMI.
72 [Tags] Set_Valid_SOL_Character_Send_Threshold
73
74 [Template] Verify SOL Setting
75
76
Rahul Maheshwarid71cd952017-06-20 21:30:51 -050077Set SOL Enabled
78 [Documentation] Verify enabling SOL via IPMI.
79 [Tags] Set_SOL_Enabled
80
81 ${msg}= Run Keyword Run IPMI Standard Command
82 ... sol set enabled true
83
84 # Verify SOL status from ipmitool sol info command.
85 ${sol_info_dict}= Get SOL Info
86 ${sol_enable_status}= Get From Dictionary
87 ... ${sol_info_dict} Enabled
88
89 Should Be Equal '${sol_enable_status}' 'true'
90
91
92Set SOL Disabled
93 [Documentation] Verify disabling SOL via IPMI.
94 [Tags] Set_SOL_Disabled
95
96 ${msg}= Run Keyword Run IPMI Standard Command
97 ... sol set enabled false
98
99 # Verify SOL status from ipmitool sol info command.
100 ${sol_info_dict}= Get SOL Info
101 ${sol_enable_status}= Get From Dictionary
102 ... ${sol_info_dict} Enabled
103 Should Be Equal '${sol_enable_status}' 'false'
104
105 # Verify error while activating SOL with SOL disabled.
106 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
107 ... sol activate
108 Should Contain ${msg} SOL payload disabled ignore_case=True
109
110
Rahul Maheshwari6fe52b92017-06-16 03:35:26 -0500111Set Valid SOL Privilege Level
112 [Documentation] Verify valid SOL's privilege level via IPMI.
113 [Tags] Set_Valid_SOL_Privilege_Level
114
115 ${privilege_level_list}= Create List user operator admin oem
116 : FOR ${item} IN @{privilege_level_list}
Rahul Maheshwari9e0b4d62017-06-21 06:42:46 -0500117 \ Set SOL Setting privilege-level ${item}
118 \ ${output}= Get SOL Setting Privilege Level
Rahul Maheshwari6fe52b92017-06-16 03:35:26 -0500119 \ Should Contain ${output} ${item} ignore_case=True
120
121
122Set Invalid SOL Privilege Level
123 [Documentation] Verify invalid SOL's retry count via IPMI.
124 [Tags] Set_Invalid_SOL_Privilege_Level
125
126 ${value}= Generate Random String ${8}
127 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
128 ... sol set privilege-level ${value}
129 Should Contain ${msg} Invalid value ignore_case=True
130
131
Rahul Maheshwaria88de442017-06-16 01:05:16 -0500132Set Invalid SOL Retry Count
133 [Documentation] Verify invalid SOL's retry count via IPMI.
134 [Tags] Set_Invalid_SOL_Retry_Count
135
136 # Any interger above 7 is invalid for SOL retry count.
137 ${value}= Evaluate random.randint(8, 10000) modules=random
138
139 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
140 ... sol set retry-count ${value}
141 Should Contain ${msg} Invalid value ignore_case=True
142
143
144Set Invalid SOL Retry Interval
145 [Documentation] Verify invalid SOL's retry interval via IPMI.
146 [Tags] Set_Invalid_SOL_Retry_Interval
147
148 # Any interger above 255 is invalid for SOL retry interval.
149 ${value}= Evaluate random.randint(256, 10000) modules=random
150
151 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
152 ... sol set retry-interval ${value}
153 Should Contain ${msg} Invalid value ignore_case=True
154
155
156Set Invalid SOL Character Accumulate Level
157 [Documentation] Verify invalid SOL's character accumulate level via IPMI.
158 [Tags] Set_Invalid_SOL_Character_Accumulate_Level
159
160 # Any integer above 255 is invalid for SOL character accumulate level.
161 ${value}= Evaluate random.randint(256, 10000) modules=random
162
163 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
164 ... sol set character-accumulate-level ${value}
165 Should Contain ${msg} Invalid value ignore_case=True
166
167
168Set Invalid SOL Character Send Threshold
169 [Documentation] Verify invalid SOL's character send threshold via IPMI.
170 [Tags] Set_Invalid_SOL_Character_Send_Threshold
171
172 # Any interger above 255 is invalid for SOL character send threshold.
173 ${value}= Evaluate random.randint(256, 10000) modules=random
174
175 ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
176 ... sol set character-send-threshold ${value}
177 Should Contain ${msg} Invalid value ignore_case=True
178
179
Rahul Maheshwari982fee42017-05-03 00:33:15 -0500180*** Keywords ***
181
Rahul Maheshwari982fee42017-05-03 00:33:15 -0500182Check IPMI SOL Output Content
183 [Documentation] Check if SOL has given content.
184 [Arguments] ${data} ${file_path}=/tmp/sol_${OPENBMC_HOST}
185 # Description of argument(s):
186 # data Content which need to be checked(e.g. Petitboot, ISTEP).
187 # file_path The file path on the local machine to check SOL content.
188 # By default it check SOL content from /tmp/sol_<BMC_IP>.
189
190 ${rc} ${output}= Run and Return RC and Output cat ${file_path}
191 Should Be Equal ${rc} ${0} msg=${output}
192
193 Should Contain ${output} ${data} case_insensitive=True
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500194
195
196Verify SOL Setting
197 [Documentation] Verify SOL Setting via IPMI.
198 [Arguments] ${setting_name} ${min_value} ${max_value}
199 # Description of Arguments:
200 # setting_name Setting to verify (e.g. "retry-count").
201 # min_value min valid value for given setting.
202 # max_value max valid value for given setting.
203
204 ${value}=
205 ... Evaluate random.randint(${min_value}, ${max_value}) modules=random
206
207 # Character accumulate level setting is set in multiples of 5.
208 # Retry interval setting is set in multiples of 10.
209 # Reference IPMI specification v2.0
210
211 ${expected_value}= Run Keyword If
212 ... '${setting_name}' == 'character-accumulate-level' Evaluate ${value}*5
213 ... ELSE IF '${setting_name}' == 'retry-interval' Evaluate ${value}*10
214 ... ELSE Set Variable ${value}
215
216 Set SOL Setting ${setting_name} '${value}'
217
218 # Replace "-" with space " " in setting name.
219 # E.g. "retry-count" to "retry count"
220 ${setting_name}= Evaluate $setting_name.replace('-',' ')
221
222 ${sol_info_dict}= Get SOL Info
223
224 # Get exact SOL setting name from sol info output.
225 ${list}= Get Matches ${sol_info_dict} ${setting_name}*
226 ... case_insensitive=${True}
227 ${setting_name_from_dict}= Get From List ${list} 0
228
229 # Get SOL setting value from above setting name.
230 ${setting_value}= Get From Dictionary
231 ... ${sol_info_dict} ${setting_name_from_dict}
232
233 Should Be Equal '${setting_value}' '${expected_value}'
234
235 # Power on host to check if SOL is working fine with new setting.
236 ${current_state}= Get Host State Via External IPMI
237 Run Keyword If '${current_state}' == 'on'
238 ... Initiate Host PowerOff Via External IPMI
239 Initiate Host Boot Via External IPMI wait=${0}
240
241 Activate SOL Via IPMI
242 Wait Until Keyword Succeeds 10 mins 30 secs
243 ... Check IPMI SOL Output Content Petitboot
244
Rahul Maheshwari9e0b4d62017-06-21 06:42:46 -0500245Get SOL Setting
246 [Documentation] Returns status for given SOL setting.
247 [Arguments] ${setting}
248 # Description of argument(s):
249 # setting SOL setting which needs to be read(e.g. "Retry Count").
250
251 ${sol_info_dict}= Get SOL Info
252 ${setting_status}= Get From Dictionary ${sol_info_dict} ${setting}
253
254 [Return] ${setting_status}
255
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500256
257Restore Default SOL Configuration
258 [Documentation] Restore default SOL configuration.
259
260 Open Connection And Log In
261
Rahul Maheshwarid71cd952017-06-20 21:30:51 -0500262 Set SOL Setting enabled true
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500263 Set SOL Setting retry-count 7
264 Set SOL Setting retry-interval 10
265 Set SOL Setting character-accumulate-level 20
266 Set SOL Setting character-send-threshold 1
Rahul Maheshwari6fe52b92017-06-16 03:35:26 -0500267 Set SOL Setting privilege-level user
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500268
269 Close All Connections
270
271
272Post Test Case Execution
273 [Documentation] Do the post test teardown.
274
275 Deactivate SOL Via IPMI
Rahul Maheshwari2a175112017-08-22 05:06:49 -0500276 ${sol_log}= Stop SOL Console Logging
277 Log ${sol_log}
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -0500278 FFDC On Test Case Fail
279 Restore Default SOL Configuration