blob: 48bf97dffb2e10ba3e15f10fa1a721cc1c709dda [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
George Keishingd55a4be2016-08-26 03:28:17 -050015Test Teardown Log FFDC
Chris Austenb29d2e82016-06-07 12:25:35 -050016
17
18*** Variables ***
19${model} = ${OPENBMC_MODEL}
20
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
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050032 ${uri} = Get System component BootCount
Chris Austenb29d2e82016-06-07 12:25:35 -050033 ${x} = Get Sensor Number ${uri}
34
35 Run IPMI command 0x04 0x30 ${x} 0x01 0x00 0x35 0x00 0x00 0x00 0x00 0x00 0x00
36 Read the Attribute ${uri} value
37 ${val} = convert to integer 53
38 Response Should Be Equal ${val}
39
40Set Sensor Boot progress
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050041 ${uri} = Get System component BootProgress
Chris Austenb29d2e82016-06-07 12:25:35 -050042 ${x} = Get Sensor Number ${uri}
43
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
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050049 ${uri} = Get System component BootProgress
Chris Austenb29d2e82016-06-07 12:25:35 -050050 ${x} = Get Sensor Number ${uri}
51
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
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050057 ${uri} = Get System component BootProgress
Chris Austenb29d2e82016-06-07 12:25:35 -050058 ${x} = Get Sensor Number ${uri}
59
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
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050065 ${uri} = Get System component BootProgress
Chris Austenb29d2e82016-06-07 12:25:35 -050066 ${x} = Get Sensor Number ${uri}
67
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
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050073 ${uri} = Get System component OperatingSystemStatus
Chris Austenb29d2e82016-06-07 12:25:35 -050074 ${x} = Get Sensor Number ${uri}
75
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
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050081 ${uri} = Get System component OperatingSystemStatus
Chris Austenb29d2e82016-06-07 12:25:35 -050082 ${x} = Get Sensor Number ${uri}
83
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
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050089 ${uri} = Get System component OccStatus
Chris Austenb29d2e82016-06-07 12:25:35 -050090 ${x} = Get Sensor Number ${uri}
91
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
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050097 ${uri} = Get System component OccStatus
Chris Austenb29d2e82016-06-07 12:25:35 -050098 ${x} = Get Sensor Number ${uri}
99
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
106 ${uri} = Get System component cpu
Chris Austenb29d2e82016-06-07 12:25:35 -0500107 ${x} = Get Inventory Sensor Number ${uri}
108
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
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500114 ${uri} = Get System component cpu
Chris Austenb29d2e82016-06-07 12:25:35 -0500115 ${x} = Get Inventory Sensor Number ${uri}
116
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
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500122 ${uri} = Get System component cpu
Chris Austenb29d2e82016-06-07 12:25:35 -0500123 ${x} = Get Inventory Sensor Number ${uri}
124
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
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500130 ${uri} = Get System component cpu
Chris Austenb29d2e82016-06-07 12:25:35 -0500131 ${x} = Get Inventory Sensor Number ${uri}
132
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
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500138 ${uri} = Get System component core11
Chris Austenb29d2e82016-06-07 12:25:35 -0500139 ${x} = Get Inventory Sensor Number ${uri}
140
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
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500146 ${uri} = Get System component core11
Chris Austenb29d2e82016-06-07 12:25:35 -0500147 ${x} = Get Inventory Sensor Number ${uri}
148
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
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500154 ${uri} = Get System component core11
Chris Austenb29d2e82016-06-07 12:25:35 -0500155 ${x} = Get Inventory Sensor Number ${uri}
156
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
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500162 ${uri} = Get System component core11
Chris Austenb29d2e82016-06-07 12:25:35 -0500163 ${x} = Get Inventory Sensor Number ${uri}
164
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 Maheshwari4a4eb6e2016-09-24 01:06:36 -0500170 ${uri} = Get System component dimm3
Chris Austenb29d2e82016-06-07 12:25:35 -0500171 ${x} = Get Inventory Sensor Number ${uri}
172
173 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x40 0x00 0x00 0x00 0x00 0x20 0x00
174 Read The Attribute ${uri} present
175 Response Should Be Equal True
176
177DIMM3 not Present
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500178 ${uri} = Get System component dimm3
Chris Austenb29d2e82016-06-07 12:25:35 -0500179 ${x} = Get Inventory Sensor Number ${uri}
180
181 Run IPMI command 0x04 0x30 ${x} 0xa9 0xff 0x00 0x00 0x40 0x00 0x00 0x20 0x00
182 Read The Attribute ${uri} present
183 Response Should Be Equal False
184
185DIMM0 fault
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500186 ${uri} = Get System component dimm0
Chris Austenb29d2e82016-06-07 12:25:35 -0500187 ${x} = Get Inventory Sensor Number ${uri}
188
189 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x10 0x00 0x00 0x00 0x00 0x20 0x00
190 Read The Attribute ${uri} fault
191 Response Should Be Equal True
192
193DIMM0 no fault
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500194 ${uri} = Get System component dimm0
Chris Austenb29d2e82016-06-07 12:25:35 -0500195 ${x} = Get Inventory Sensor Number ${uri}
196
197 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x10 0x00 0x00 0x20 0x00
198 Read The Attribute ${uri} fault
199 Response Should Be Equal False
200
201Centaur0 Present
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500202 ${uri} = Get System component membuf
Chris Austenb29d2e82016-06-07 12:25:35 -0500203 ${x} = Get Inventory Sensor Number ${uri}
204
205 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x40 0x00 0x00 0x00 0x00 0x20 0x00
206 Read The Attribute ${uri} present
207 Response Should Be Equal True
208
209Centaur0 not Present
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500210 ${uri} = Get System component membuf
Chris Austenb29d2e82016-06-07 12:25:35 -0500211 ${x} = Get Inventory Sensor Number ${uri}
212
213 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x40 0x00 0x00 0x20 0x00
214 Read The Attribute ${uri} present
215 Response Should Be Equal False
216
217Centaur0 fault
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500218 ${uri} = Get System component membuf
Chris Austenb29d2e82016-06-07 12:25:35 -0500219 ${x} = Get Inventory Sensor Number ${uri}
220
221 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x10 0x00 0x00 0x00 0x00 0x20 0x00
222 Read The Attribute ${uri} fault
223 Response Should Be Equal True
224
225Centaur0 no fault
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500226 ${uri} = Get System component membuf
Chris Austenb29d2e82016-06-07 12:25:35 -0500227 ${x} = Get Inventory Sensor Number ${uri}
228
229 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x10 0x00 0x00 0x20 0x00
230 Read The Attribute ${uri} fault
231 Response Should Be Equal False
232
233System Present
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500234 ${uri} = Get System component system
235 Read The Attribute ${uri} present
Chris Austenb29d2e82016-06-07 12:25:35 -0500236 Response Should Be Equal True
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500237
Chris Austenb29d2e82016-06-07 12:25:35 -0500238System Fault
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500239 ${uri} = Get System component system
240 Read The Attribute ${uri} fault
Chris Austenb29d2e82016-06-07 12:25:35 -0500241 Response Should Be Equal False
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500242
Chris Austenb29d2e82016-06-07 12:25:35 -0500243Chassis Present
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500244 ${uri} = Get System component chassis
Chris Austenb29d2e82016-06-07 12:25:35 -0500245 Read The Attribute /org/openbmc/inventory/system/chassis present
246 Response Should Be Equal True
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500247
Chris Austenb29d2e82016-06-07 12:25:35 -0500248Chassis Fault
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500249 ${uri} = Get System component chassis
Chris Austenb29d2e82016-06-07 12:25:35 -0500250 Read The Attribute /org/openbmc/inventory/system/chassis fault
251 Response Should Be Equal False
Chris Austenb29d2e82016-06-07 12:25:35 -0500252
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500253io_board Present
254 ${uri} = Get System component io_board
255 Read The Attribute ${uri} present
256 Response Should Be Equal True
257
258io_board Fault
259 ${uri} = Get System component io_board
260 Read The Attribute ${uri} fault
261 Response Should Be Equal False
Chris Austenb29d2e82016-06-07 12:25:35 -0500262
263*** Keywords ***
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500264
265Setup The Suite
266
267 Open Connection And Log In
268 ${resp} = Read Properties /org/openbmc/enumerate
269 Set Suite Variable ${SYSTEM_INFO} ${resp}
270 log Dictionary ${resp}
271
272Get System component
273 [Arguments] ${type}
274 ${list} = Get Dictionary Keys ${SYSTEM_INFO}
275 ${resp} = Get Matches ${list} regexp=^.*[0-9a-z_].${type}[0-9]*$
276 ${url} = Get From List ${resp} 0
277 [return] ${url}
278
Chris Austenb29d2e82016-06-07 12:25:35 -0500279Execute new Command
280 [arguments] ${args}
281 ${output}= Execute Command ${args}
282 set test variable ${OUTPUT} "${output}"
283
284response Should Be Equal
285 [arguments] ${args}
286 Should Be Equal ${OUTPUT} ${args}
287
288Response Should Be Empty
289 Should Be Empty ${OUTPUT}
290
291Read the Attribute
292 [arguments] ${uri} ${parm}
293 ${output} = Read Attribute ${uri} ${parm}
294 set test variable ${OUTPUT} ${output}
295
296Get Sensor Number
297 [arguments] ${name}
298 ${x} = get sensor ${OPENBMC_MODEL} ${name}
299 [return] ${x}
300
301Get Inventory Sensor Number
302 [arguments] ${name}
303 ${x} = get inventory sensor ${OPENBMC_MODEL} ${name}
304 [return] ${x}