blob: 2722a8380fc2473cbac2783fbb89316c1225d08f [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
Chris Austenb29d2e82016-06-07 12:25:35 -0500179CPU Present
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600180 [Tags] CPU_Present
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500181
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600182 ${uri}= Get System component cpu
183 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500184
185 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x80 0x00 0x00 0x00 0x00 0x20 0x00
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500186 Read The Attribute ${uri} present
Chris Austenb29d2e82016-06-07 12:25:35 -0500187 Response Should Be Equal True
188
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600189CPU Not Present
190 [Tags] CPU_Not_Present
191
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600192 ${uri}= Get System component cpu
193 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500194
195 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x00 0x00 0x80 0x00 0x00 0x20 0x00
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500196 Read The Attribute ${uri} present
Chris Austenb29d2e82016-06-07 12:25:35 -0500197 Response Should Be Equal False
198
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600199CPU No Fault
200 [Tags] CPU_No_Fault
201
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} 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x20 0x00
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500206 Read The Attribute ${uri} fault
Chris Austenb29d2e82016-06-07 12:25:35 -0500207 Response Should Be Equal False
208
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600209Core Present
210 [Tags] Core_Present
211
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600212 ${uri}= Get System component core11
213 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500214
215 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x80 0x00 0x00 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 True
218
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600219Core Not Present
220 [Tags] Core_Not_Present
221
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600222 ${uri}= Get System component core11
223 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500224
225 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x00 0x00 0x80 0x00 0x00 0x20 0x00
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500226 Read The Attribute ${uri} present
Chris Austenb29d2e82016-06-07 12:25:35 -0500227 Response Should Be Equal False
228
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600229Core Fault
230 [Tags] Core_Fault
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 0xff 0x00 0x01 0x00 0x00 0x00 0x20 0x00
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500236 Read The Attribute ${uri} fault
Chris Austenb29d2e82016-06-07 12:25:35 -0500237 Response Should Be Equal True
238
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600239Core No Fault
240 [Tags] Core_No_Fault
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} 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x20 0x00
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500246 Read The Attribute ${uri} fault
Chris Austenb29d2e82016-06-07 12:25:35 -0500247 Response Should Be Equal False
248
249DIMM3 Present
Rahul Maheshwaribb20f732016-10-24 06:27:14 -0500250 [Tags] DIMM3_Present
251
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600252 ${uri}= Get System component dimm3
253 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500254
255 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x40 0x00 0x00 0x00 0x00 0x20 0x00
256 Read The Attribute ${uri} present
257 Response Should Be Equal True
258
259DIMM3 not Present
Rahul Maheshwaribb20f732016-10-24 06:27:14 -0500260 [Tags] DIMM3_not_Present
261
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600262 ${uri}= Get System component dimm3
263 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500264
265 Run IPMI command 0x04 0x30 ${x} 0xa9 0xff 0x00 0x00 0x40 0x00 0x00 0x20 0x00
266 Read The Attribute ${uri} present
267 Response Should Be Equal False
268
Chris Austenb29d2e82016-06-07 12:25:35 -0500269DIMM0 no fault
Rahul Maheshwaribb20f732016-10-24 06:27:14 -0500270 [Tags] DIMM0_no_fault
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600271 ${uri}= Get System component dimm0
272 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500273
274 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x10 0x00 0x00 0x20 0x00
275 Read The Attribute ${uri} fault
276 Response Should Be Equal False
277
278Centaur0 Present
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600279 [Tags] Centaur0_Present
Rahul Maheshwarif8119102016-10-05 01:15:56 -0500280
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600281 ${uri}= Get System component membuf
282 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500283
284 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x40 0x00 0x00 0x00 0x00 0x20 0x00
285 Read The Attribute ${uri} present
286 Response Should Be Equal True
287
288Centaur0 not Present
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600289 [Tags] Centaur0_not_Present
Rahul Maheshwarif8119102016-10-05 01:15:56 -0500290
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600291 ${uri}= Get System component membuf
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 0x40 0x00 0x00 0x20 0x00
295 Read The Attribute ${uri} present
296 Response Should Be Equal False
297
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600298Centaur0 Fault
299 [Tags] Centaur0_Fault
300
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} 0x00 0x00 0x10 0x00 0x00 0x00 0x00 0x20 0x00
305 Read The Attribute ${uri} fault
306 Response Should Be Equal True
307
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600308Centaur0 No Fault
309 [Tags] Centaur0_No_Fault
310
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 0x10 0x00 0x00 0x20 0x00
315 Read The Attribute ${uri} fault
316 Response Should Be Equal False
317
318System Present
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600319 [Tags] System_Present
Rahul Maheshwarif8119102016-10-05 01:15:56 -0500320
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600321 ${uri}= Get System component system
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500322 Read The Attribute ${uri} present
Chris Austenb29d2e82016-06-07 12:25:35 -0500323 Response Should Be Equal True
Rahul Maheshwarif8119102016-10-05 01:15:56 -0500324
Chris Austenb29d2e82016-06-07 12:25:35 -0500325System Fault
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600326 [Tags] System_Fault
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600327 ${uri}= Get System component system
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500328 Read The Attribute ${uri} fault
Chris Austenb29d2e82016-06-07 12:25:35 -0500329 Response Should Be Equal False
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500330
Chris Austenb29d2e82016-06-07 12:25:35 -0500331Chassis Present
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600332 [Tags] Chassis_Present
Rahul Maheshwarif8119102016-10-05 01:15:56 -0500333
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600334 ${uri}= Get System component chassis
George Keishingab1bd922016-12-05 05:29:59 -0600335 Read The Attribute
336 ... ${INVENTORY_URI}system/chassis present
Chris Austenb29d2e82016-06-07 12:25:35 -0500337 Response Should Be Equal True
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500338
Chris Austenb29d2e82016-06-07 12:25:35 -0500339Chassis Fault
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600340 [Tags] Chassis_Fault
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600341 ${uri}= Get System component chassis
George Keishingab1bd922016-12-05 05:29:59 -0600342 Read The Attribute
343 ... ${INVENTORY_URI}system/chassis fault
Chris Austenb29d2e82016-06-07 12:25:35 -0500344 Response Should Be Equal False
Chris Austenb29d2e82016-06-07 12:25:35 -0500345
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500346io_board Present
Rahul Maheshwarif8119102016-10-05 01:15:56 -0500347 [Tags] io_board_Present
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600348 ${uri}= Get System component io_board
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500349 Read The Attribute ${uri} present
350 Response Should Be Equal True
351
352io_board Fault
Rahul Maheshwarif8119102016-10-05 01:15:56 -0500353 [Tags] io_board_Fault
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600354 ${uri}= Get System component io_board
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500355 Read The Attribute ${uri} fault
356 Response Should Be Equal False
Chris Austenb29d2e82016-06-07 12:25:35 -0500357
358*** Keywords ***
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500359
360Setup The Suite
George Keishinga7433222017-03-23 23:47:11 -0500361 [Documentation] Do the initial suite setup.
362 ${current_state}= Get Host State
363 Run Keyword If '${current_state}' == 'Off'
364 ... Initiate Host Boot
365
366 Wait Until Keyword Succeeds
367 ... 10 min 10 sec Is OS Starting
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500368
369 Open Connection And Log In
George Keishingab1bd922016-12-05 05:29:59 -0600370 ${resp}= Read Properties ${OPENBMC_BASE_URI}enumerate timeout=30
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500371 Set Suite Variable ${SYSTEM_INFO} ${resp}
372 log Dictionary ${resp}
373
Rahul Maheshwarica368e52017-05-04 05:01:49 -0500374 ${setting}= Read Turbo Setting Via REST
375 Set Global Variable ${TURBO_SETTING} ${setting}
376
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500377Get System component
378 [Arguments] ${type}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600379 ${list}= Get Dictionary Keys ${SYSTEM_INFO}
380 ${resp}= Get Matches ${list} regexp=^.*[0-9a-z_].${type}[0-9]*$
381 ${url}= Get From List ${resp} 0
Gunnar Millsc9ea9362016-12-13 16:21:13 -0600382 [Return] ${url}
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500383
Chris Austenb29d2e82016-06-07 12:25:35 -0500384Execute new Command
Gunnar Mills38032802016-12-12 13:43:40 -0600385 [Arguments] ${args}
Chris Austenb29d2e82016-06-07 12:25:35 -0500386 ${output}= Execute Command ${args}
387 set test variable ${OUTPUT} "${output}"
388
389response Should Be Equal
Gunnar Mills38032802016-12-12 13:43:40 -0600390 [Arguments] ${args}
Chris Austenb29d2e82016-06-07 12:25:35 -0500391 Should Be Equal ${OUTPUT} ${args}
392
393Response Should Be Empty
394 Should Be Empty ${OUTPUT}
395
Gunnar Mills56b32892016-11-14 13:56:17 -0600396Read the Attribute
Gunnar Mills38032802016-12-12 13:43:40 -0600397 [Arguments] ${uri} ${parm}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600398 ${output}= Read Attribute ${uri} ${parm}
Chris Austenb29d2e82016-06-07 12:25:35 -0500399 set test variable ${OUTPUT} ${output}
400
401Get Sensor Number
Gunnar Mills38032802016-12-12 13:43:40 -0600402 [Arguments] ${name}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600403 ${x}= get sensor ${OPENBMC_MODEL} ${name}
Gunnar Millsc9ea9362016-12-13 16:21:13 -0600404 [Return] ${x}
Chris Austenb29d2e82016-06-07 12:25:35 -0500405
406Get Inventory Sensor Number
Gunnar Mills38032802016-12-12 13:43:40 -0600407 [Arguments] ${name}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600408 ${x}= get inventory sensor ${OPENBMC_MODEL} ${name}
Gunnar Millsc9ea9362016-12-13 16:21:13 -0600409 [Return] ${x}
Rahul Maheshwari06174f22017-03-06 03:17:09 -0600410
Rahul Maheshwarica368e52017-05-04 05:01:49 -0500411Read Turbo Setting Via REST
412 [Documentation] Return turbo allowed setting.
413
414 ${resp}= OpenBMC Get Request ${SENSORS_URI}host/TurboAllowed
415 ${jsondata}= To JSON ${resp.content}
416 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
417 [Return] ${jsondata["data"]["value"]}
418
419Set Turbo Setting Via REST
420 [Documentation] Set turbo setting via REST.
421 [Arguments] ${setting}
422 # Description of argument(s):
423 # setting Value which needs to be set.(i.e. False or True)
424
425 ${valueDict}= Create Dictionary data=${setting}
426 Write Attribute ${SENSORS_URI}host/TurboAllowed value data=${valueDict}
427
Rahul Maheshwari06174f22017-03-06 03:17:09 -0600428Post Test Case Execution
429 [Documentation] Do the post test teardown.
430 ... 1. Capture FFDC on test failure.
431 ... 2. Close all open SSH connections.
432
433 FFDC On Test Case Fail
434 Close All Connections
Rahul Maheshwarica368e52017-05-04 05:01:49 -0500435
436Restore System Configuration
437 [Documentation] Restore System Configuration.
438
439 Open Connection And Log In
440 Set Turbo Setting Via REST ${TURBO_SETTING}
441 Close All Connections