blob: 4825554e177e423dc9cfa33c7a53af4a43aecd19 [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
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -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
Rahul Maheshwarica368e52017-05-04 05:01:49 -050017Suite Teardown Restore System Configuration
Chris Austenb29d2e82016-06-07 12:25:35 -050018
19*** Variables ***
Gunnar Mills1cd544d2016-12-06 11:19:22 -060020${model}= ${OPENBMC_MODEL}
Chris Austenb29d2e82016-06-07 12:25:35 -050021
22*** Test Cases ***
23Verify connection
24 Execute new Command echo "hello"
25 Response Should Be Equal "hello"
26
27Execute ipmi BT capabilities command
George Keishingcac24c72016-09-23 04:44:19 -050028 [Tags] Execute_ipmi_BT_capabilities_command
Chris Austenb29d2e82016-06-07 12:25:35 -050029 Run IPMI command 0x06 0x36
30 response Should Be Equal " 01 40 40 0a 01"
31
Sridevi Ramesh83f5c592017-01-20 04:35:13 -060032Execute Set Sensor Boot Count
33 [Tags] Execute_Set_Sensor_Boot_Count
34
Gunnar Mills1cd544d2016-12-06 11:19:22 -060035 ${uri}= Get System component BootCount
36 ${x}= Get Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -050037
38 Run IPMI command 0x04 0x30 ${x} 0x01 0x00 0x35 0x00 0x00 0x00 0x00 0x00 0x00
39 Read the Attribute ${uri} value
Gunnar Mills1cd544d2016-12-06 11:19:22 -060040 ${val}= convert to integer 53
Chris Austenb29d2e82016-06-07 12:25:35 -050041 Response Should Be Equal ${val}
42
Sridevi Ramesh83f5c592017-01-20 04:35:13 -060043Set Sensor Boot Progress
44 [Tags] Set_Sensor_Boot_Progress
45
Gunnar Mills1cd544d2016-12-06 11:19:22 -060046 ${uri}= Get System component BootProgress
47 ${x}= Get Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -050048
49 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x04 0x00 0x00 0x00 0x00 0x14 0x00
50 Read the Attribute ${uri} value
51 Response Should Be Equal FW Progress, Baseboard Init
52
Sridevi Ramesh83f5c592017-01-20 04:35:13 -060053Set Sensor Boot Progress Longest String
54 [Tags] Set_Sensor_Boot_Progress_Longest_String
Gunnar Mills1cd544d2016-12-06 11:19:22 -060055 ${uri}= Get System component BootProgress
56 ${x}= Get Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -050057
58 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x04 0x00 0x00 0x00 0x00 0x0e 0x00
59 Read The Attribute ${uri} value
60 Response Should Be Equal FW Progress, Docking station attachment
61
Sridevi Ramesh83f5c592017-01-20 04:35:13 -060062Boot Progress Sensor FW Hang Unspecified Error
63 [Tags] Boot_Progress_Sensor_FW_Hang_Unspecified_Error
64
Gunnar Mills1cd544d2016-12-06 11:19:22 -060065 ${uri}= Get System component BootProgress
66 ${x}= Get Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -050067
68 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x02 0x00 0x00 0x00 0x00 0x00 0x00
69 Read The Attribute ${uri} value
70 Response Should Be Equal FW Hang, Unspecified
71
Sridevi Ramesh83f5c592017-01-20 04:35:13 -060072Boot Progress FW Hang State
73 [Tags] Boot_Progress_FW_Hang_State
74
Gunnar Mills1cd544d2016-12-06 11:19:22 -060075 ${uri}= Get System component BootProgress
76 ${x}= Get Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -050077
78 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x01 0x00 0x00 0x00 0x00 0x20 0x00
79 Read The Attribute ${uri} value
80 Response Should Be Equal POST Error, unknown
81
Sridevi Ramesh83f5c592017-01-20 04:35:13 -060082OS Status Sensor Boot Completed Progress
83 [Tags] OS_Status_Sensor_Boot_Completed_Progress
84
Gunnar Mills1cd544d2016-12-06 11:19:22 -060085 ${uri}= Get System component OperatingSystemStatus
86 ${x}= Get Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -050087
88 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x20 0x00
89 Read The Attribute ${uri} value
90 Response Should Be Equal Boot completed (00)
91
Sridevi Ramesh83f5c592017-01-20 04:35:13 -060092OS Status Sensor Progress
93 [Tags] OS_Status_Sensor_Progress
94
Gunnar Mills1cd544d2016-12-06 11:19:22 -060095 ${uri}= Get System component OperatingSystemStatus
96 ${x}= Get Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -050097
98 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x04 0x00 0x00 0x00 0x00 0x20 0x00
99 Read The Attribute ${uri} value
100 Response Should Be Equal PXE boot completed
101
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600102OCC Active Sensor On Enabled
103 [Tags] OCC_Active_Sensor_On_Enabled
104
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600105 ${uri}= Get System component OccStatus
106 ${x}= Get Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500107
108 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x20 0x00
109 Read The Attribute ${uri} value
110 Response Should Be Equal Enabled
111
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600112OCC Active Sensor On Disabled
113 [Tags] OCC_Active_Sensor_On_Disabled
114
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600115 ${uri}= Get System component OccStatus
116 ${x}= Get Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500117
118 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x20 0x00
119 Read The Attribute ${uri} value
120 Response Should Be Equal Disabled
121
Rahul Maheshwarieb1f6db2017-04-27 06:32:53 -0500122Verify OCC Power Supply Redundancy
123 [Documentation] Check if OCC's power supply is set to not redundant.
124 [Tags] Verify_OCC_Power_Supply_Redundancy
125 ${uri}= Get System Component PowerSupplyRedundancy
126
127 Read The Attribute ${uri} value
128 Response Should Be Equal Disabled
129
130Verify OCC Power Supply Derating Value
131 [Documentation] Check if OCC's power supply derating value
132 ... is set correctly to a constant value 10.
133 [Tags] Verify_OCC_Power_Supply_Derating_Value
134
135 ${uri}= Get System Component PowerSupplyDerating
136
137 Read The Attribute ${uri} value
138 Response Should Be Equal ${10}
139
Rahul Maheshwarica368e52017-05-04 05:01:49 -0500140
141Verify Enabling OCC Turbo Setting Via IPMI
142 [Documentation] Set and verify OCC's turbo allowed on enable.
143 # The allowed value for turbo allowed:
144 # True - To enable turbo allowed.
145 # False - To disable turbo allowed.
146
147 [Tags] Verify_Enabling_OCC_Turbo_Setting_Via_IPMI
148
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.
165
166 [Tags] Verify_Disabling_OCC_Turbo_Setting_Via_IPMI
167
168 ${uri}= Get System Component TurboAllowed
169 ${sensor_num}= Get Sensor Number ${uri}
170
171 ${ipmi_cmd}= Catenate SEPARATOR= 0x04 0x30 ${sensor_num} 0x00${SPACE}
172 ... 0x00 0x00 0x00 0x01 0x00 0x00 0x20 0x00
173 Run IPMI Command ${ipmi_cmd}
174
175 Read The Attribute ${uri} value
176 Response Should Be Equal False
177
178
Rahul Maheshwaria3fdba42017-05-30 06:44:04 -0500179Verify Setting OCC Turbo Via REST
180 [Documentation] Verify enabling and disabling OCC's turbo allowed
181 ... via REST.
182 # The allowed value for turbo allowed:
183 # True - To enable turbo allowed.
184 # False - To disable turbo allowed.
185
186 [Tags] Verify_Setting_OCC_Turbo_Via_REST
187
188 Set Turbo Setting Via REST False
189 ${setting}= Read Turbo Setting Via REST
190 Should Be Equal ${setting} False
191
192 Set Turbo Setting Via REST True
193 ${setting}= Read Turbo Setting Via REST
194 Should Be Equal ${setting} True
195
196
Chris Austenb29d2e82016-06-07 12:25:35 -0500197CPU Present
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600198 [Tags] CPU_Present
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500199
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600200 ${uri}= Get System component cpu
201 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500202
203 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x80 0x00 0x00 0x00 0x00 0x20 0x00
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500204 Read The Attribute ${uri} present
Chris Austenb29d2e82016-06-07 12:25:35 -0500205 Response Should Be Equal True
206
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600207CPU Not Present
208 [Tags] CPU_Not_Present
209
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600210 ${uri}= Get System component cpu
211 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500212
213 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x00 0x00 0x80 0x00 0x00 0x20 0x00
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500214 Read The Attribute ${uri} present
Chris Austenb29d2e82016-06-07 12:25:35 -0500215 Response Should Be Equal False
216
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600217CPU No Fault
218 [Tags] CPU_No_Fault
219
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600220 ${uri}= Get System component cpu
221 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500222
223 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x20 0x00
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500224 Read The Attribute ${uri} fault
Chris Austenb29d2e82016-06-07 12:25:35 -0500225 Response Should Be Equal False
226
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600227Core Present
228 [Tags] Core_Present
229
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600230 ${uri}= Get System component core11
231 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500232
233 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x80 0x00 0x00 0x00 0x00 0x20 0x00
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500234 Read The Attribute ${uri} present
Chris Austenb29d2e82016-06-07 12:25:35 -0500235 Response Should Be Equal True
236
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600237Core Not Present
238 [Tags] Core_Not_Present
239
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600240 ${uri}= Get System component core11
241 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500242
243 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x00 0x00 0x80 0x00 0x00 0x20 0x00
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500244 Read The Attribute ${uri} present
Chris Austenb29d2e82016-06-07 12:25:35 -0500245 Response Should Be Equal False
246
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600247Core Fault
248 [Tags] Core_Fault
249
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600250 ${uri}= Get System component core11
251 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500252
253 Run IPMI command 0x04 0x30 ${x} 0xa9 0xff 0x00 0x01 0x00 0x00 0x00 0x20 0x00
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500254 Read The Attribute ${uri} fault
Chris Austenb29d2e82016-06-07 12:25:35 -0500255 Response Should Be Equal True
256
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600257Core No Fault
258 [Tags] Core_No_Fault
259
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600260 ${uri}= Get System component core11
261 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500262
263 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x20 0x00
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500264 Read The Attribute ${uri} fault
Chris Austenb29d2e82016-06-07 12:25:35 -0500265 Response Should Be Equal False
266
267DIMM3 Present
Rahul Maheshwaribb20f732016-10-24 06:27:14 -0500268 [Tags] DIMM3_Present
269
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600270 ${uri}= Get System component dimm3
271 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500272
273 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x40 0x00 0x00 0x00 0x00 0x20 0x00
274 Read The Attribute ${uri} present
275 Response Should Be Equal True
276
277DIMM3 not Present
Rahul Maheshwaribb20f732016-10-24 06:27:14 -0500278 [Tags] DIMM3_not_Present
279
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600280 ${uri}= Get System component dimm3
281 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500282
283 Run IPMI command 0x04 0x30 ${x} 0xa9 0xff 0x00 0x00 0x40 0x00 0x00 0x20 0x00
284 Read The Attribute ${uri} present
285 Response Should Be Equal False
286
Chris Austenb29d2e82016-06-07 12:25:35 -0500287DIMM0 no fault
Rahul Maheshwaribb20f732016-10-24 06:27:14 -0500288 [Tags] DIMM0_no_fault
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600289 ${uri}= Get System component dimm0
290 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500291
292 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x10 0x00 0x00 0x20 0x00
293 Read The Attribute ${uri} fault
294 Response Should Be Equal False
295
296Centaur0 Present
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600297 [Tags] Centaur0_Present
Rahul Maheshwarif8119102016-10-05 01:15:56 -0500298
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600299 ${uri}= Get System component membuf
300 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500301
302 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x40 0x00 0x00 0x00 0x00 0x20 0x00
303 Read The Attribute ${uri} present
304 Response Should Be Equal True
305
306Centaur0 not Present
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600307 [Tags] Centaur0_not_Present
Rahul Maheshwarif8119102016-10-05 01:15:56 -0500308
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600309 ${uri}= Get System component membuf
310 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500311
312 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x40 0x00 0x00 0x20 0x00
313 Read The Attribute ${uri} present
314 Response Should Be Equal False
315
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600316Centaur0 Fault
317 [Tags] Centaur0_Fault
318
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600319 ${uri}= Get System component membuf
320 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500321
322 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x10 0x00 0x00 0x00 0x00 0x20 0x00
323 Read The Attribute ${uri} fault
324 Response Should Be Equal True
325
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600326Centaur0 No Fault
327 [Tags] Centaur0_No_Fault
328
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600329 ${uri}= Get System component membuf
330 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500331
332 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x10 0x00 0x00 0x20 0x00
333 Read The Attribute ${uri} fault
334 Response Should Be Equal False
335
336System Present
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600337 [Tags] System_Present
Rahul Maheshwarif8119102016-10-05 01:15:56 -0500338
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600339 ${uri}= Get System component system
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500340 Read The Attribute ${uri} present
Chris Austenb29d2e82016-06-07 12:25:35 -0500341 Response Should Be Equal True
Rahul Maheshwarif8119102016-10-05 01:15:56 -0500342
Chris Austenb29d2e82016-06-07 12:25:35 -0500343System Fault
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600344 [Tags] System_Fault
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600345 ${uri}= Get System component system
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500346 Read The Attribute ${uri} fault
Chris Austenb29d2e82016-06-07 12:25:35 -0500347 Response Should Be Equal False
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500348
Chris Austenb29d2e82016-06-07 12:25:35 -0500349Chassis Present
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600350 [Tags] Chassis_Present
Rahul Maheshwarif8119102016-10-05 01:15:56 -0500351
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600352 ${uri}= Get System component chassis
George Keishingab1bd922016-12-05 05:29:59 -0600353 Read The Attribute
354 ... ${INVENTORY_URI}system/chassis present
Chris Austenb29d2e82016-06-07 12:25:35 -0500355 Response Should Be Equal True
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500356
Chris Austenb29d2e82016-06-07 12:25:35 -0500357Chassis Fault
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600358 [Tags] Chassis_Fault
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600359 ${uri}= Get System component chassis
George Keishingab1bd922016-12-05 05:29:59 -0600360 Read The Attribute
361 ... ${INVENTORY_URI}system/chassis fault
Chris Austenb29d2e82016-06-07 12:25:35 -0500362 Response Should Be Equal False
Chris Austenb29d2e82016-06-07 12:25:35 -0500363
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500364io_board Present
Rahul Maheshwarif8119102016-10-05 01:15:56 -0500365 [Tags] io_board_Present
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600366 ${uri}= Get System component io_board
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500367 Read The Attribute ${uri} present
368 Response Should Be Equal True
369
370io_board Fault
Rahul Maheshwarif8119102016-10-05 01:15:56 -0500371 [Tags] io_board_Fault
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600372 ${uri}= Get System component io_board
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500373 Read The Attribute ${uri} fault
374 Response Should Be Equal False
Chris Austenb29d2e82016-06-07 12:25:35 -0500375
376*** Keywords ***
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500377
378Setup The Suite
George Keishinga7433222017-03-23 23:47:11 -0500379 [Documentation] Do the initial suite setup.
380 ${current_state}= Get Host State
381 Run Keyword If '${current_state}' == 'Off'
382 ... Initiate Host Boot
383
384 Wait Until Keyword Succeeds
385 ... 10 min 10 sec Is OS Starting
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500386
387 Open Connection And Log In
George Keishingab1bd922016-12-05 05:29:59 -0600388 ${resp}= Read Properties ${OPENBMC_BASE_URI}enumerate timeout=30
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500389 Set Suite Variable ${SYSTEM_INFO} ${resp}
390 log Dictionary ${resp}
391
Rahul Maheshwarica368e52017-05-04 05:01:49 -0500392 ${setting}= Read Turbo Setting Via REST
393 Set Global Variable ${TURBO_SETTING} ${setting}
394
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500395Get System component
396 [Arguments] ${type}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600397 ${list}= Get Dictionary Keys ${SYSTEM_INFO}
398 ${resp}= Get Matches ${list} regexp=^.*[0-9a-z_].${type}[0-9]*$
399 ${url}= Get From List ${resp} 0
Gunnar Millsc9ea9362016-12-13 16:21:13 -0600400 [Return] ${url}
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500401
Chris Austenb29d2e82016-06-07 12:25:35 -0500402Execute new Command
Gunnar Mills38032802016-12-12 13:43:40 -0600403 [Arguments] ${args}
Chris Austenb29d2e82016-06-07 12:25:35 -0500404 ${output}= Execute Command ${args}
405 set test variable ${OUTPUT} "${output}"
406
407response Should Be Equal
Gunnar Mills38032802016-12-12 13:43:40 -0600408 [Arguments] ${args}
Chris Austenb29d2e82016-06-07 12:25:35 -0500409 Should Be Equal ${OUTPUT} ${args}
410
411Response Should Be Empty
412 Should Be Empty ${OUTPUT}
413
Gunnar Mills56b32892016-11-14 13:56:17 -0600414Read the Attribute
Gunnar Mills38032802016-12-12 13:43:40 -0600415 [Arguments] ${uri} ${parm}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600416 ${output}= Read Attribute ${uri} ${parm}
Chris Austenb29d2e82016-06-07 12:25:35 -0500417 set test variable ${OUTPUT} ${output}
418
419Get Sensor Number
Gunnar Mills38032802016-12-12 13:43:40 -0600420 [Arguments] ${name}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600421 ${x}= get sensor ${OPENBMC_MODEL} ${name}
Gunnar Millsc9ea9362016-12-13 16:21:13 -0600422 [Return] ${x}
Chris Austenb29d2e82016-06-07 12:25:35 -0500423
424Get Inventory Sensor Number
Gunnar Mills38032802016-12-12 13:43:40 -0600425 [Arguments] ${name}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600426 ${x}= get inventory sensor ${OPENBMC_MODEL} ${name}
Gunnar Millsc9ea9362016-12-13 16:21:13 -0600427 [Return] ${x}
Rahul Maheshwari06174f22017-03-06 03:17:09 -0600428
Rahul Maheshwarica368e52017-05-04 05:01:49 -0500429Read Turbo Setting Via REST
430 [Documentation] Return turbo allowed setting.
431
432 ${resp}= OpenBMC Get Request ${SENSORS_URI}host/TurboAllowed
433 ${jsondata}= To JSON ${resp.content}
434 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
435 [Return] ${jsondata["data"]["value"]}
436
437Set Turbo Setting Via REST
438 [Documentation] Set turbo setting via REST.
439 [Arguments] ${setting}
440 # Description of argument(s):
441 # setting Value which needs to be set.(i.e. False or True)
442
443 ${valueDict}= Create Dictionary data=${setting}
444 Write Attribute ${SENSORS_URI}host/TurboAllowed value data=${valueDict}
445
Rahul Maheshwari06174f22017-03-06 03:17:09 -0600446Post Test Case Execution
447 [Documentation] Do the post test teardown.
448 ... 1. Capture FFDC on test failure.
449 ... 2. Close all open SSH connections.
450
451 FFDC On Test Case Fail
452 Close All Connections
Rahul Maheshwarica368e52017-05-04 05:01:49 -0500453
454Restore System Configuration
455 [Documentation] Restore System Configuration.
456
457 Open Connection And Log In
458 Set Turbo Setting Via REST ${TURBO_SETTING}
459 Close All Connections