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