blob: cfa18e1a873c4267fbb4aa118f69ccfd490a3c15 [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
8Resource ../lib/rest_client.robot
9Resource ../lib/ipmi_client.robot
George Keishingd55a4be2016-08-26 03:28:17 -050010Resource ../lib/openbmc_ffdc.robot
Chris Austenb29d2e82016-06-07 12:25:35 -050011Library ../data/model.py
12
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050013Suite setup Setup The Suite
Chris Austenb29d2e82016-06-07 12:25:35 -050014Suite Teardown Close All Connections
Gunnar Millseac1af22016-11-14 15:30:09 -060015Test Teardown FFDC On Test Case Fail
Chris Austenb29d2e82016-06-07 12:25:35 -050016
17
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
31Execute Set Sensor boot count
Gunnar Mills1cd544d2016-12-06 11:19:22 -060032 ${uri}= Get System component BootCount
33 ${x}= Get Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -050034
35 Run IPMI command 0x04 0x30 ${x} 0x01 0x00 0x35 0x00 0x00 0x00 0x00 0x00 0x00
36 Read the Attribute ${uri} value
Gunnar Mills1cd544d2016-12-06 11:19:22 -060037 ${val}= convert to integer 53
Chris Austenb29d2e82016-06-07 12:25:35 -050038 Response Should Be Equal ${val}
39
40Set Sensor Boot progress
Gunnar Mills1cd544d2016-12-06 11:19:22 -060041 ${uri}= Get System component BootProgress
42 ${x}= Get Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -050043
44 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x04 0x00 0x00 0x00 0x00 0x14 0x00
45 Read the Attribute ${uri} value
46 Response Should Be Equal FW Progress, Baseboard Init
47
48Set Sensor Boot progress Longest string
Gunnar Mills1cd544d2016-12-06 11:19:22 -060049 ${uri}= Get System component BootProgress
50 ${x}= Get Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -050051
52 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x04 0x00 0x00 0x00 0x00 0x0e 0x00
53 Read The Attribute ${uri} value
54 Response Should Be Equal FW Progress, Docking station attachment
55
56BootProgress sensor FW Hang unspecified Error
Gunnar Mills1cd544d2016-12-06 11:19:22 -060057 ${uri}= Get System component BootProgress
58 ${x}= Get Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -050059
60 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x02 0x00 0x00 0x00 0x00 0x00 0x00
61 Read The Attribute ${uri} value
62 Response Should Be Equal FW Hang, Unspecified
63
64BootProgress fw hang state
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 0x01 0x00 0x00 0x00 0x00 0x20 0x00
69 Read The Attribute ${uri} value
70 Response Should Be Equal POST Error, unknown
71
72OperatingSystemStatus Sensor boot completed progress
Gunnar Mills1cd544d2016-12-06 11:19:22 -060073 ${uri}= Get System component OperatingSystemStatus
74 ${x}= Get Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -050075
76 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x20 0x00
77 Read The Attribute ${uri} value
78 Response Should Be Equal Boot completed (00)
79
80OperatingSystemStatus Sensor progress
Gunnar Mills1cd544d2016-12-06 11:19:22 -060081 ${uri}= Get System component OperatingSystemStatus
82 ${x}= Get Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -050083
84 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x04 0x00 0x00 0x00 0x00 0x20 0x00
85 Read The Attribute ${uri} value
86 Response Should Be Equal PXE boot completed
87
88OCC Active sensor on enabled
Gunnar Mills1cd544d2016-12-06 11:19:22 -060089 ${uri}= Get System component OccStatus
90 ${x}= Get Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -050091
92 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x20 0x00
93 Read The Attribute ${uri} value
94 Response Should Be Equal Enabled
95
96OCC Active sensor on disabled
Gunnar Mills1cd544d2016-12-06 11:19:22 -060097 ${uri}= Get System component OccStatus
98 ${x}= Get Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -050099
100 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x20 0x00
101 Read The Attribute ${uri} value
102 Response Should Be Equal Disabled
103
104CPU Present
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500105
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600106 ${uri}= Get System component cpu
107 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500108
109 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x80 0x00 0x00 0x00 0x00 0x20 0x00
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500110 Read The Attribute ${uri} present
Chris Austenb29d2e82016-06-07 12:25:35 -0500111 Response Should Be Equal True
112
113CPU not Present
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600114 ${uri}= Get System component cpu
115 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500116
117 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x00 0x00 0x80 0x00 0x00 0x20 0x00
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500118 Read The Attribute ${uri} present
Chris Austenb29d2e82016-06-07 12:25:35 -0500119 Response Should Be Equal False
120
121CPU fault
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600122 ${uri}= Get System component cpu
123 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500124
125 Run IPMI command 0x04 0x30 ${x} 0xa9 0xff 0x00 0x01 0x00 0x00 0x00 0x20 0x00
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500126 Read The Attribute ${uri} fault
Chris Austenb29d2e82016-06-07 12:25:35 -0500127 Response Should Be Equal True
128
129CPU no fault
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600130 ${uri}= Get System component cpu
131 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500132
133 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x20 0x00
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500134 Read The Attribute ${uri} fault
Chris Austenb29d2e82016-06-07 12:25:35 -0500135 Response Should Be Equal False
136
137core Present
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600138 ${uri}= Get System component core11
139 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500140
141 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x80 0x00 0x00 0x00 0x00 0x20 0x00
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500142 Read The Attribute ${uri} present
Chris Austenb29d2e82016-06-07 12:25:35 -0500143 Response Should Be Equal True
144
145core not Present
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600146 ${uri}= Get System component core11
147 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500148
149 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x00 0x00 0x80 0x00 0x00 0x20 0x00
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500150 Read The Attribute ${uri} present
Chris Austenb29d2e82016-06-07 12:25:35 -0500151 Response Should Be Equal False
152
153core fault
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600154 ${uri}= Get System component core11
155 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500156
157 Run IPMI command 0x04 0x30 ${x} 0xa9 0xff 0x00 0x01 0x00 0x00 0x00 0x20 0x00
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500158 Read The Attribute ${uri} fault
Chris Austenb29d2e82016-06-07 12:25:35 -0500159 Response Should Be Equal True
160
161core no fault
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600162 ${uri}= Get System component core11
163 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500164
165 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x20 0x00
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500166 Read The Attribute ${uri} fault
Chris Austenb29d2e82016-06-07 12:25:35 -0500167 Response Should Be Equal False
168
169DIMM3 Present
Rahul Maheshwaribb20f732016-10-24 06:27:14 -0500170 [Tags] DIMM3_Present
171
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600172 ${uri}= Get System component dimm3
173 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500174
175 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x40 0x00 0x00 0x00 0x00 0x20 0x00
176 Read The Attribute ${uri} present
177 Response Should Be Equal True
178
179DIMM3 not Present
Rahul Maheshwaribb20f732016-10-24 06:27:14 -0500180 [Tags] DIMM3_not_Present
181
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600182 ${uri}= Get System component dimm3
183 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500184
185 Run IPMI command 0x04 0x30 ${x} 0xa9 0xff 0x00 0x00 0x40 0x00 0x00 0x20 0x00
186 Read The Attribute ${uri} present
187 Response Should Be Equal False
188
189DIMM0 fault
Rahul Maheshwaribb20f732016-10-24 06:27:14 -0500190 [Tags] DIMM0_fault
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600191 ${uri}= Get System component dimm0
192 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500193
194 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x10 0x00 0x00 0x00 0x00 0x20 0x00
195 Read The Attribute ${uri} fault
196 Response Should Be Equal True
197
198DIMM0 no fault
Rahul Maheshwaribb20f732016-10-24 06:27:14 -0500199 [Tags] DIMM0_no_fault
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600200 ${uri}= Get System component dimm0
201 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500202
203 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x10 0x00 0x00 0x20 0x00
204 Read The Attribute ${uri} fault
205 Response Should Be Equal False
206
207Centaur0 Present
Rahul Maheshwarif8119102016-10-05 01:15:56 -0500208 [Tags] Centaur0_Present
209
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600210 ${uri}= Get System component membuf
211 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500212
213 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x40 0x00 0x00 0x00 0x00 0x20 0x00
214 Read The Attribute ${uri} present
215 Response Should Be Equal True
216
217Centaur0 not Present
Rahul Maheshwarif8119102016-10-05 01:15:56 -0500218 [Tags] Centaur0_not_Present
219
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600220 ${uri}= Get System component membuf
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 0x40 0x00 0x00 0x20 0x00
224 Read The Attribute ${uri} present
225 Response Should Be Equal False
226
227Centaur0 fault
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600228 ${uri}= Get System component membuf
229 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500230
231 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x10 0x00 0x00 0x00 0x00 0x20 0x00
232 Read The Attribute ${uri} fault
233 Response Should Be Equal True
234
235Centaur0 no fault
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600236 ${uri}= Get System component membuf
237 ${x}= Get Inventory Sensor Number ${uri}
Chris Austenb29d2e82016-06-07 12:25:35 -0500238
239 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x10 0x00 0x00 0x20 0x00
240 Read The Attribute ${uri} fault
241 Response Should Be Equal False
242
243System Present
Rahul Maheshwarif8119102016-10-05 01:15:56 -0500244 [Tags] System_Present
245
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600246 ${uri}= Get System component system
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500247 Read The Attribute ${uri} present
Chris Austenb29d2e82016-06-07 12:25:35 -0500248 Response Should Be Equal True
Rahul Maheshwarif8119102016-10-05 01:15:56 -0500249
Chris Austenb29d2e82016-06-07 12:25:35 -0500250System Fault
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600251 ${uri}= Get System component system
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500252 Read The Attribute ${uri} fault
Chris Austenb29d2e82016-06-07 12:25:35 -0500253 Response Should Be Equal False
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500254
Chris Austenb29d2e82016-06-07 12:25:35 -0500255Chassis Present
Rahul Maheshwarif8119102016-10-05 01:15:56 -0500256 [Tags] Chassis_Present
257
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600258 ${uri}= Get System component chassis
Chris Austenb29d2e82016-06-07 12:25:35 -0500259 Read The Attribute /org/openbmc/inventory/system/chassis present
260 Response Should Be Equal True
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500261
Chris Austenb29d2e82016-06-07 12:25:35 -0500262Chassis Fault
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600263 ${uri}= Get System component chassis
Chris Austenb29d2e82016-06-07 12:25:35 -0500264 Read The Attribute /org/openbmc/inventory/system/chassis fault
265 Response Should Be Equal False
Chris Austenb29d2e82016-06-07 12:25:35 -0500266
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500267io_board Present
Rahul Maheshwarif8119102016-10-05 01:15:56 -0500268 [Tags] io_board_Present
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600269 ${uri}= Get System component io_board
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500270 Read The Attribute ${uri} present
271 Response Should Be Equal True
272
273io_board Fault
Rahul Maheshwarif8119102016-10-05 01:15:56 -0500274 [Tags] io_board_Fault
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600275 ${uri}= Get System component io_board
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500276 Read The Attribute ${uri} fault
277 Response Should Be Equal False
Chris Austenb29d2e82016-06-07 12:25:35 -0500278
279*** Keywords ***
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500280
281Setup The Suite
282
283 Open Connection And Log In
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600284 ${resp}= Read Properties /org/openbmc/enumerate timeout=30
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500285 Set Suite Variable ${SYSTEM_INFO} ${resp}
286 log Dictionary ${resp}
287
288Get System component
289 [Arguments] ${type}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600290 ${list}= Get Dictionary Keys ${SYSTEM_INFO}
291 ${resp}= Get Matches ${list} regexp=^.*[0-9a-z_].${type}[0-9]*$
292 ${url}= Get From List ${resp} 0
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500293 [return] ${url}
294
Chris Austenb29d2e82016-06-07 12:25:35 -0500295Execute new Command
296 [arguments] ${args}
297 ${output}= Execute Command ${args}
298 set test variable ${OUTPUT} "${output}"
299
300response Should Be Equal
301 [arguments] ${args}
302 Should Be Equal ${OUTPUT} ${args}
303
304Response Should Be Empty
305 Should Be Empty ${OUTPUT}
306
Gunnar Mills56b32892016-11-14 13:56:17 -0600307Read the Attribute
Chris Austenb29d2e82016-06-07 12:25:35 -0500308 [arguments] ${uri} ${parm}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600309 ${output}= Read Attribute ${uri} ${parm}
Chris Austenb29d2e82016-06-07 12:25:35 -0500310 set test variable ${OUTPUT} ${output}
311
312Get Sensor Number
313 [arguments] ${name}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600314 ${x}= get sensor ${OPENBMC_MODEL} ${name}
Chris Austenb29d2e82016-06-07 12:25:35 -0500315 [return] ${x}
316
317Get Inventory Sensor Number
318 [arguments] ${name}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600319 ${x}= get inventory sensor ${OPENBMC_MODEL} ${name}
Chris Austenb29d2e82016-06-07 12:25:35 -0500320 [return] ${x}