blob: 2ffc7eaf884f42a994e1643349b8e68b0e50dfd8 [file] [log] [blame]
Chris Austenb29d2e82016-06-07 12:25:35 -05001*** Settings ***
2Documentation This example demonstrates executing commands on a remote machine
3... and getting their output and the return code.
4...
5... Notice how connections are handled as part of the suite setup and
6... teardown. This saves some time when executing several test cases.
7
Rahul Maheshwari06174f22017-03-06 03:17:09 -06008Resource ../lib/rest_client.robot
9Resource ../lib/ipmi_client.robot
10Resource ../lib/openbmc_ffdc.robot
George Keishinga7433222017-03-23 23:47:11 -050011Resource ../lib/state_manager.robot
Rahul Maheshwari06174f22017-03-06 03:17:09 -060012Library ../data/model.py
Chris Austenb29d2e82016-06-07 12:25:35 -050013
Sweta Potthuri7e5dc592017-07-03 06:10:02 -050014Suite Setup Setup The Suite
Rahul Maheshwari06174f22017-03-06 03:17:09 -060015Test Setup Open Connection And Log In
16Test Teardown Post Test Case Execution
Chris Austenb29d2e82016-06-07 12:25:35 -050017
18*** Variables ***
Gunnar Mills1cd544d2016-12-06 11:19:22 -060019${model}= ${OPENBMC_MODEL}
Chris Austenb29d2e82016-06-07 12:25:35 -050020
21*** Test Cases ***
22Verify connection
23 Execute new Command echo "hello"
24 Response Should Be Equal "hello"
25
26Execute ipmi BT capabilities command
George Keishingcac24c72016-09-23 04:44:19 -050027 [Tags] Execute_ipmi_BT_capabilities_command
Chris Austenb29d2e82016-06-07 12:25:35 -050028 Run IPMI command 0x06 0x36
29 response Should Be Equal " 01 40 40 0a 01"
30
Sridevi Ramesh83f5c592017-01-20 04:35:13 -060031Execute Set Sensor Boot Count
32 [Tags] Execute_Set_Sensor_Boot_Count
33
Gunnar Mills1cd544d2016-12-06 11:19:22 -060034 ${uri}= Get System component BootCount
35 ${x}= Get Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -050036
37 Run IPMI command 0x04 0x30 ${x} 0x01 0x00 0x35 0x00 0x00 0x00 0x00 0x00 0x00
38 Read the Attribute ${uri} value
Gunnar Mills1cd544d2016-12-06 11:19:22 -060039 ${val}= convert to integer 53
Chris Austenb29d2e82016-06-07 12:25:35 -050040 Response Should Be Equal ${val}
41
Sridevi Ramesh83f5c592017-01-20 04:35:13 -060042Set Sensor Boot Progress
43 [Tags] Set_Sensor_Boot_Progress
44
Gunnar Mills1cd544d2016-12-06 11:19:22 -060045 ${uri}= Get System component BootProgress
46 ${x}= Get Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -050047
48 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x04 0x00 0x00 0x00 0x00 0x14 0x00
49 Read the Attribute ${uri} value
50 Response Should Be Equal FW Progress, Baseboard Init
51
Sridevi Ramesh83f5c592017-01-20 04:35:13 -060052Set Sensor Boot Progress Longest String
53 [Tags] Set_Sensor_Boot_Progress_Longest_String
Gunnar Mills1cd544d2016-12-06 11:19:22 -060054 ${uri}= Get System component BootProgress
55 ${x}= Get Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -050056
57 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x04 0x00 0x00 0x00 0x00 0x0e 0x00
58 Read The Attribute ${uri} value
59 Response Should Be Equal FW Progress, Docking station attachment
60
Sridevi Ramesh83f5c592017-01-20 04:35:13 -060061Boot Progress Sensor FW Hang Unspecified Error
62 [Tags] Boot_Progress_Sensor_FW_Hang_Unspecified_Error
63
Gunnar Mills1cd544d2016-12-06 11:19:22 -060064 ${uri}= Get System component BootProgress
65 ${x}= Get Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -050066
67 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x02 0x00 0x00 0x00 0x00 0x00 0x00
68 Read The Attribute ${uri} value
69 Response Should Be Equal FW Hang, Unspecified
70
Sridevi Ramesh83f5c592017-01-20 04:35:13 -060071Boot Progress FW Hang State
72 [Tags] Boot_Progress_FW_Hang_State
73
Gunnar Mills1cd544d2016-12-06 11:19:22 -060074 ${uri}= Get System component BootProgress
75 ${x}= Get Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -050076
77 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x01 0x00 0x00 0x00 0x00 0x20 0x00
78 Read The Attribute ${uri} value
79 Response Should Be Equal POST Error, unknown
80
Sridevi Ramesh83f5c592017-01-20 04:35:13 -060081OS Status Sensor Boot Completed Progress
82 [Tags] OS_Status_Sensor_Boot_Completed_Progress
83
Gunnar Mills1cd544d2016-12-06 11:19:22 -060084 ${uri}= Get System component OperatingSystemStatus
85 ${x}= Get Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -050086
87 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x20 0x00
88 Read The Attribute ${uri} value
89 Response Should Be Equal Boot completed (00)
90
Sridevi Ramesh83f5c592017-01-20 04:35:13 -060091OS Status Sensor Progress
92 [Tags] OS_Status_Sensor_Progress
93
Gunnar Mills1cd544d2016-12-06 11:19:22 -060094 ${uri}= Get System component OperatingSystemStatus
95 ${x}= Get Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -050096
97 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x04 0x00 0x00 0x00 0x00 0x20 0x00
98 Read The Attribute ${uri} value
99 Response Should Be Equal PXE boot completed
100
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600101OCC Active Sensor On Enabled
102 [Tags] OCC_Active_Sensor_On_Enabled
103
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600104 ${uri}= Get System component OccStatus
105 ${x}= Get Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500106
107 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x20 0x00
108 Read The Attribute ${uri} value
109 Response Should Be Equal Enabled
110
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600111OCC Active Sensor On Disabled
112 [Tags] OCC_Active_Sensor_On_Disabled
113
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600114 ${uri}= Get System component OccStatus
115 ${x}= Get Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500116
117 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x20 0x00
118 Read The Attribute ${uri} value
119 Response Should Be Equal Disabled
120
Rahul Maheshwarieb1f6db2017-04-27 06:32:53 -0500121Verify OCC Power Supply Redundancy
122 [Documentation] Check if OCC's power supply is set to not redundant.
123 [Tags] Verify_OCC_Power_Supply_Redundancy
124 ${uri}= Get System Component PowerSupplyRedundancy
125
126 Read The Attribute ${uri} value
127 Response Should Be Equal Disabled
128
129Verify OCC Power Supply Derating Value
130 [Documentation] Check if OCC's power supply derating value
131 ... is set correctly to a constant value 10.
132 [Tags] Verify_OCC_Power_Supply_Derating_Value
133
134 ${uri}= Get System Component PowerSupplyDerating
135
136 Read The Attribute ${uri} value
137 Response Should Be Equal ${10}
138
Rahul Maheshwarica368e52017-05-04 05:01:49 -0500139
140Verify Enabling OCC Turbo Setting Via IPMI
141 [Documentation] Set and verify OCC's turbo allowed on enable.
142 # The allowed value for turbo allowed:
143 # True - To enable turbo allowed.
144 # False - To disable turbo allowed.
Sweta Potthuri7e5dc592017-07-03 06:10:02 -0500145 [Setup] Turbo Setting Test Case Setup
Rahul Maheshwarica368e52017-05-04 05:01:49 -0500146 [Tags] Verify_Enabling_OCC_Turbo_Setting_Via_IPMI
Sweta Potthuri7e5dc592017-07-03 06:10:02 -0500147 [Teardown] Restore System Configuration
Rahul Maheshwarica368e52017-05-04 05:01:49 -0500148
149 ${uri}= Get System Component TurboAllowed
150 ${sensor_num}= Get Sensor Number ${uri}
151
152 ${ipmi_cmd}= Catenate SEPARATOR= 0x04 0x30 ${sensor_num} 0x00${SPACE}
153 ... 0x00 0x01 0x00 0x00 0x00 0x00 0x20 0x00
154 Run IPMI Command ${ipmi_cmd}
155
156 Read The Attribute ${uri} value
157 Response Should Be Equal True
158
159
160Verify Disabling OCC Turbo Setting Via IPMI
161 [Documentation] Set and verify OCC's turbo allowed on disable.
162 # The allowed value for turbo allowed:
163 # True - To enable turbo allowed.
164 # False - To disable turbo allowed.
Sweta Potthuri7e5dc592017-07-03 06:10:02 -0500165 [Setup] Turbo Setting Test Case Setup
Rahul Maheshwarica368e52017-05-04 05:01:49 -0500166 [Tags] Verify_Disabling_OCC_Turbo_Setting_Via_IPMI
Sweta Potthuri7e5dc592017-07-03 06:10:02 -0500167 [Teardown] Restore System Configuration
Rahul Maheshwarica368e52017-05-04 05:01:49 -0500168
169 ${uri}= Get System Component TurboAllowed
170 ${sensor_num}= Get Sensor Number ${uri}
171
172 ${ipmi_cmd}= Catenate SEPARATOR= 0x04 0x30 ${sensor_num} 0x00${SPACE}
173 ... 0x00 0x00 0x00 0x01 0x00 0x00 0x20 0x00
174 Run IPMI Command ${ipmi_cmd}
175
176 Read The Attribute ${uri} value
177 Response Should Be Equal False
178
179
Rahul Maheshwaria3fdba42017-05-30 06:44:04 -0500180Verify Setting OCC Turbo Via REST
181 [Documentation] Verify enabling and disabling OCC's turbo allowed
182 ... via REST.
183 # The allowed value for turbo allowed:
184 # True - To enable turbo allowed.
185 # False - To disable turbo allowed.
186
Sweta Potthuri7e5dc592017-07-03 06:10:02 -0500187 [Setup] Turbo Setting Test Case Setup
Rahul Maheshwaria3fdba42017-05-30 06:44:04 -0500188 [Tags] Verify_Setting_OCC_Turbo_Via_REST
Sweta Potthuri7e5dc592017-07-03 06:10:02 -0500189 [Teardown] Restore System Configuration
Rahul Maheshwaria3fdba42017-05-30 06:44:04 -0500190
191 Set Turbo Setting Via REST False
192 ${setting}= Read Turbo Setting Via REST
193 Should Be Equal ${setting} False
194
195 Set Turbo Setting Via REST True
196 ${setting}= Read Turbo Setting Via REST
197 Should Be Equal ${setting} True
198
Chris Austenb29d2e82016-06-07 12:25:35 -0500199CPU Present
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600200 [Tags] CPU_Present
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500201
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600202 ${uri}= Get System component cpu
203 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500204
205 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x80 0x00 0x00 0x00 0x00 0x20 0x00
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500206 Read The Attribute ${uri} present
Chris Austenb29d2e82016-06-07 12:25:35 -0500207 Response Should Be Equal True
208
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600209CPU Not Present
210 [Tags] CPU_Not_Present
211
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600212 ${uri}= Get System component cpu
213 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500214
215 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x00 0x00 0x80 0x00 0x00 0x20 0x00
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500216 Read The Attribute ${uri} present
Chris Austenb29d2e82016-06-07 12:25:35 -0500217 Response Should Be Equal False
218
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600219CPU No Fault
220 [Tags] CPU_No_Fault
221
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600222 ${uri}= Get System component cpu
223 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500224
225 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x20 0x00
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500226 Read The Attribute ${uri} fault
Chris Austenb29d2e82016-06-07 12:25:35 -0500227 Response Should Be Equal False
228
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600229Core Present
230 [Tags] Core_Present
231
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600232 ${uri}= Get System component core11
233 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500234
235 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x80 0x00 0x00 0x00 0x00 0x20 0x00
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500236 Read The Attribute ${uri} present
Chris Austenb29d2e82016-06-07 12:25:35 -0500237 Response Should Be Equal True
238
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600239Core Not Present
240 [Tags] Core_Not_Present
241
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600242 ${uri}= Get System component core11
243 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500244
245 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x00 0x00 0x80 0x00 0x00 0x20 0x00
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500246 Read The Attribute ${uri} present
Chris Austenb29d2e82016-06-07 12:25:35 -0500247 Response Should Be Equal False
248
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600249Core Fault
250 [Tags] Core_Fault
251
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600252 ${uri}= Get System component core11
253 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500254
255 Run IPMI command 0x04 0x30 ${x} 0xa9 0xff 0x00 0x01 0x00 0x00 0x00 0x20 0x00
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500256 Read The Attribute ${uri} fault
Chris Austenb29d2e82016-06-07 12:25:35 -0500257 Response Should Be Equal True
258
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600259Core No Fault
260 [Tags] Core_No_Fault
261
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600262 ${uri}= Get System component core11
263 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500264
265 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x20 0x00
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500266 Read The Attribute ${uri} fault
Chris Austenb29d2e82016-06-07 12:25:35 -0500267 Response Should Be Equal False
268
269DIMM3 Present
Rahul Maheshwaribb20f732016-10-24 06:27:14 -0500270 [Tags] DIMM3_Present
271
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600272 ${uri}= Get System component dimm3
273 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500274
275 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x40 0x00 0x00 0x00 0x00 0x20 0x00
276 Read The Attribute ${uri} present
277 Response Should Be Equal True
278
279DIMM3 not Present
Rahul Maheshwaribb20f732016-10-24 06:27:14 -0500280 [Tags] DIMM3_not_Present
281
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600282 ${uri}= Get System component dimm3
283 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500284
285 Run IPMI command 0x04 0x30 ${x} 0xa9 0xff 0x00 0x00 0x40 0x00 0x00 0x20 0x00
286 Read The Attribute ${uri} present
287 Response Should Be Equal False
288
Chris Austenb29d2e82016-06-07 12:25:35 -0500289DIMM0 no fault
Rahul Maheshwaribb20f732016-10-24 06:27:14 -0500290 [Tags] DIMM0_no_fault
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600291 ${uri}= Get System component dimm0
292 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500293
294 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x10 0x00 0x00 0x20 0x00
295 Read The Attribute ${uri} fault
296 Response Should Be Equal False
297
298Centaur0 Present
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600299 [Tags] Centaur0_Present
Rahul Maheshwarif8119102016-10-05 01:15:56 -0500300
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600301 ${uri}= Get System component membuf
302 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500303
304 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x40 0x00 0x00 0x00 0x00 0x20 0x00
305 Read The Attribute ${uri} present
306 Response Should Be Equal True
307
308Centaur0 not Present
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600309 [Tags] Centaur0_not_Present
Rahul Maheshwarif8119102016-10-05 01:15:56 -0500310
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600311 ${uri}= Get System component membuf
312 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500313
314 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x40 0x00 0x00 0x20 0x00
315 Read The Attribute ${uri} present
316 Response Should Be Equal False
317
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600318Centaur0 Fault
319 [Tags] Centaur0_Fault
320
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600321 ${uri}= Get System component membuf
322 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500323
324 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x10 0x00 0x00 0x00 0x00 0x20 0x00
325 Read The Attribute ${uri} fault
326 Response Should Be Equal True
327
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600328Centaur0 No Fault
329 [Tags] Centaur0_No_Fault
330
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600331 ${uri}= Get System component membuf
332 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500333
334 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x10 0x00 0x00 0x20 0x00
335 Read The Attribute ${uri} fault
336 Response Should Be Equal False
337
338System Present
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600339 [Tags] System_Present
Rahul Maheshwarif8119102016-10-05 01:15:56 -0500340
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600341 ${uri}= Get System component system
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500342 Read The Attribute ${uri} present
Chris Austenb29d2e82016-06-07 12:25:35 -0500343 Response Should Be Equal True
Rahul Maheshwarif8119102016-10-05 01:15:56 -0500344
Chris Austenb29d2e82016-06-07 12:25:35 -0500345System Fault
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600346 [Tags] System_Fault
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600347 ${uri}= Get System component system
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500348 Read The Attribute ${uri} fault
Chris Austenb29d2e82016-06-07 12:25:35 -0500349 Response Should Be Equal False
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500350
Chris Austenb29d2e82016-06-07 12:25:35 -0500351Chassis Present
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600352 [Tags] Chassis_Present
Rahul Maheshwarif8119102016-10-05 01:15:56 -0500353
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600354 ${uri}= Get System component chassis
George Keishingab1bd922016-12-05 05:29:59 -0600355 Read The Attribute
356 ... ${INVENTORY_URI}system/chassis present
Chris Austenb29d2e82016-06-07 12:25:35 -0500357 Response Should Be Equal True
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500358
Chris Austenb29d2e82016-06-07 12:25:35 -0500359Chassis Fault
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600360 [Tags] Chassis_Fault
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600361 ${uri}= Get System component chassis
George Keishingab1bd922016-12-05 05:29:59 -0600362 Read The Attribute
363 ... ${INVENTORY_URI}system/chassis fault
Chris Austenb29d2e82016-06-07 12:25:35 -0500364 Response Should Be Equal False
Chris Austenb29d2e82016-06-07 12:25:35 -0500365
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500366io_board Present
Rahul Maheshwarif8119102016-10-05 01:15:56 -0500367 [Tags] io_board_Present
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600368 ${uri}= Get System component io_board
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500369 Read The Attribute ${uri} present
370 Response Should Be Equal True
371
372io_board Fault
Rahul Maheshwarif8119102016-10-05 01:15:56 -0500373 [Tags] io_board_Fault
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600374 ${uri}= Get System component io_board
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500375 Read The Attribute ${uri} fault
376 Response Should Be Equal False
Chris Austenb29d2e82016-06-07 12:25:35 -0500377
378*** Keywords ***
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500379
380Setup The Suite
George Keishinga7433222017-03-23 23:47:11 -0500381 [Documentation] Do the initial suite setup.
382 ${current_state}= Get Host State
383 Run Keyword If '${current_state}' == 'Off'
384 ... Initiate Host Boot
385
386 Wait Until Keyword Succeeds
387 ... 10 min 10 sec Is OS Starting
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500388
389 Open Connection And Log In
George Keishingab1bd922016-12-05 05:29:59 -0600390 ${resp}= Read Properties ${OPENBMC_BASE_URI}enumerate timeout=30
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500391 Set Suite Variable ${SYSTEM_INFO} ${resp}
392 log Dictionary ${resp}
393
Sweta Potthuri7e5dc592017-07-03 06:10:02 -0500394Turbo Setting Test Case Setup
395 [Documentation] Open Connection and turbo settings
396
397 Open Connection And Log In
Rahul Maheshwarica368e52017-05-04 05:01:49 -0500398 ${setting}= Read Turbo Setting Via REST
399 Set Global Variable ${TURBO_SETTING} ${setting}
400
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500401Get System component
402 [Arguments] ${type}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600403 ${list}= Get Dictionary Keys ${SYSTEM_INFO}
404 ${resp}= Get Matches ${list} regexp=^.*[0-9a-z_].${type}[0-9]*$
405 ${url}= Get From List ${resp} 0
Gunnar Millsc9ea9362016-12-13 16:21:13 -0600406 [Return] ${url}
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500407
Chris Austenb29d2e82016-06-07 12:25:35 -0500408Execute new Command
Gunnar Mills38032802016-12-12 13:43:40 -0600409 [Arguments] ${args}
Chris Austenb29d2e82016-06-07 12:25:35 -0500410 ${output}= Execute Command ${args}
411 set test variable ${OUTPUT} "${output}"
412
413response Should Be Equal
Gunnar Mills38032802016-12-12 13:43:40 -0600414 [Arguments] ${args}
Chris Austenb29d2e82016-06-07 12:25:35 -0500415 Should Be Equal ${OUTPUT} ${args}
416
417Response Should Be Empty
418 Should Be Empty ${OUTPUT}
419
Gunnar Mills56b32892016-11-14 13:56:17 -0600420Read the Attribute
Gunnar Mills38032802016-12-12 13:43:40 -0600421 [Arguments] ${uri} ${parm}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600422 ${output}= Read Attribute ${uri} ${parm}
Chris Austenb29d2e82016-06-07 12:25:35 -0500423 set test variable ${OUTPUT} ${output}
424
425Get Sensor Number
Gunnar Mills38032802016-12-12 13:43:40 -0600426 [Arguments] ${name}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600427 ${x}= get sensor ${OPENBMC_MODEL} ${name}
Gunnar Millsc9ea9362016-12-13 16:21:13 -0600428 [Return] ${x}
Chris Austenb29d2e82016-06-07 12:25:35 -0500429
430Get Inventory Sensor Number
Gunnar Mills38032802016-12-12 13:43:40 -0600431 [Arguments] ${name}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600432 ${x}= get inventory sensor ${OPENBMC_MODEL} ${name}
Gunnar Millsc9ea9362016-12-13 16:21:13 -0600433 [Return] ${x}
Rahul Maheshwari06174f22017-03-06 03:17:09 -0600434
Rahul Maheshwarica368e52017-05-04 05:01:49 -0500435Read Turbo Setting Via REST
436 [Documentation] Return turbo allowed setting.
437
438 ${resp}= OpenBMC Get Request ${SENSORS_URI}host/TurboAllowed
439 ${jsondata}= To JSON ${resp.content}
440 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
441 [Return] ${jsondata["data"]["value"]}
442
443Set Turbo Setting Via REST
444 [Documentation] Set turbo setting via REST.
445 [Arguments] ${setting}
446 # Description of argument(s):
447 # setting Value which needs to be set.(i.e. False or True)
448
449 ${valueDict}= Create Dictionary data=${setting}
450 Write Attribute ${SENSORS_URI}host/TurboAllowed value data=${valueDict}
451
Rahul Maheshwari06174f22017-03-06 03:17:09 -0600452Post Test Case Execution
453 [Documentation] Do the post test teardown.
454 ... 1. Capture FFDC on test failure.
455 ... 2. Close all open SSH connections.
456
457 FFDC On Test Case Fail
458 Close All Connections
Rahul Maheshwarica368e52017-05-04 05:01:49 -0500459
460Restore System Configuration
461 [Documentation] Restore System Configuration.
462
463 Open Connection And Log In
464 Set Turbo Setting Via REST ${TURBO_SETTING}
465 Close All Connections