blob: 213d22f07bb98e0a45523cf370e617c1a57f4dc9 [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
13Suite Setup Open Connection And Log In
14Suite 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
27 Run IPMI command 0x06 0x36
28 response Should Be Equal " 01 40 40 0a 01"
29
30Execute Set Sensor boot count
31 ${uri} = Set Variable /org/openbmc/sensors/host/BootCount
32 ${x} = Get Sensor Number ${uri}
33
34 Run IPMI command 0x04 0x30 ${x} 0x01 0x00 0x35 0x00 0x00 0x00 0x00 0x00 0x00
35 Read the Attribute ${uri} value
36 ${val} = convert to integer 53
37 Response Should Be Equal ${val}
38
39Set Sensor Boot progress
40 ${uri} = Set Variable /org/openbmc/sensors/host/BootProgress
41 ${x} = Get Sensor Number ${uri}
42
43 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x04 0x00 0x00 0x00 0x00 0x14 0x00
44 Read the Attribute ${uri} value
45 Response Should Be Equal FW Progress, Baseboard Init
46
47Set Sensor Boot progress Longest string
48 ${uri} = Set Variable /org/openbmc/sensors/host/BootProgress
49 ${x} = Get Sensor Number ${uri}
50
51 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x04 0x00 0x00 0x00 0x00 0x0e 0x00
52 Read The Attribute ${uri} value
53 Response Should Be Equal FW Progress, Docking station attachment
54
55BootProgress sensor FW Hang unspecified Error
56 ${uri} = Set Variable /org/openbmc/sensors/host/BootProgress
57 ${x} = Get Sensor Number ${uri}
58
59 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x02 0x00 0x00 0x00 0x00 0x00 0x00
60 Read The Attribute ${uri} value
61 Response Should Be Equal FW Hang, Unspecified
62
63BootProgress fw hang state
64 ${uri} = Set Variable /org/openbmc/sensors/host/BootProgress
65 ${x} = Get Sensor Number ${uri}
66
67 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x01 0x00 0x00 0x00 0x00 0x20 0x00
68 Read The Attribute ${uri} value
69 Response Should Be Equal POST Error, unknown
70
71OperatingSystemStatus Sensor boot completed progress
72 ${uri} = Set Variable /org/openbmc/sensors/host/OperatingSystemStatus
73 ${x} = Get Sensor Number ${uri}
74
75 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x20 0x00
76 Read The Attribute ${uri} value
77 Response Should Be Equal Boot completed (00)
78
79OperatingSystemStatus Sensor progress
80 ${uri} = Set Variable /org/openbmc/sensors/host/OperatingSystemStatus
81 ${x} = Get Sensor Number ${uri}
82
83 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x04 0x00 0x00 0x00 0x00 0x20 0x00
84 Read The Attribute ${uri} value
85 Response Should Be Equal PXE boot completed
86
87OCC Active sensor on enabled
88 ${uri} = Set Variable /org/openbmc/sensors/host/cpu0/OccStatus
89 ${x} = Get Sensor Number ${uri}
90
91 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x20 0x00
92 Read The Attribute ${uri} value
93 Response Should Be Equal Enabled
94
95OCC Active sensor on disabled
96 ${uri} = Set Variable /org/openbmc/sensors/host/cpu0/OccStatus
97 ${x} = Get Sensor Number ${uri}
98
99 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x20 0x00
100 Read The Attribute ${uri} value
101 Response Should Be Equal Disabled
102
103CPU Present
104 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/cpu0
105 ${x} = Get Inventory Sensor Number ${uri}
106
107 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x80 0x00 0x00 0x00 0x00 0x20 0x00
108 Read The Attribute ${uri} present
109 Response Should Be Equal True
110
111CPU not Present
112 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/cpu0
113 ${x} = Get Inventory Sensor Number ${uri}
114
115 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x00 0x00 0x80 0x00 0x00 0x20 0x00
116 Read The Attribute ${uri} present
117 Response Should Be Equal False
118
119CPU fault
120 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/cpu0
121 ${x} = Get Inventory Sensor Number ${uri}
122
123 Run IPMI command 0x04 0x30 ${x} 0xa9 0xff 0x00 0x01 0x00 0x00 0x00 0x20 0x00
124 Read The Attribute ${uri} fault
125 Response Should Be Equal True
126
127CPU no fault
128 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/cpu0
129 ${x} = Get Inventory Sensor Number ${uri}
130
131 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x20 0x00
132 Read The Attribute ${uri} fault
133 Response Should Be Equal False
134
135core Present
136 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/cpu0/core11
137 ${x} = Get Inventory Sensor Number ${uri}
138
139 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x80 0x00 0x00 0x00 0x00 0x20 0x00
140 Read The Attribute ${uri} present
141 Response Should Be Equal True
142
143core not Present
144 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/cpu0/core11
145 ${x} = Get Inventory Sensor Number ${uri}
146
147 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x00 0x00 0x80 0x00 0x00 0x20 0x00
148 Read The Attribute ${uri} present
149 Response Should Be Equal False
150
151core fault
152 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/cpu0/core11
153 ${x} = Get Inventory Sensor Number ${uri}
154
155 Run IPMI command 0x04 0x30 ${x} 0xa9 0xff 0x00 0x01 0x00 0x00 0x00 0x20 0x00
156 Read The Attribute ${uri} fault
157 Response Should Be Equal True
158
159core no fault
160 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/cpu0/core11
161 ${x} = Get Inventory Sensor Number ${uri}
162
163 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x20 0x00
164 Read The Attribute ${uri} fault
165 Response Should Be Equal False
166
167DIMM3 Present
168 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/dimm3
169 ${x} = Get Inventory Sensor Number ${uri}
170
171 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x40 0x00 0x00 0x00 0x00 0x20 0x00
172 Read The Attribute ${uri} present
173 Response Should Be Equal True
174
175DIMM3 not Present
176 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/dimm3
177 ${x} = Get Inventory Sensor Number ${uri}
178
179 Run IPMI command 0x04 0x30 ${x} 0xa9 0xff 0x00 0x00 0x40 0x00 0x00 0x20 0x00
180 Read The Attribute ${uri} present
181 Response Should Be Equal False
182
183DIMM0 fault
184 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/dimm0
185 ${x} = Get Inventory Sensor Number ${uri}
186
187 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x10 0x00 0x00 0x00 0x00 0x20 0x00
188 Read The Attribute ${uri} fault
189 Response Should Be Equal True
190
191DIMM0 no fault
192 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/dimm0
193 ${x} = Get Inventory Sensor Number ${uri}
194
195 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x10 0x00 0x00 0x20 0x00
196 Read The Attribute ${uri} fault
197 Response Should Be Equal False
198
199Centaur0 Present
200 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/membuf0
201 ${x} = Get Inventory Sensor Number ${uri}
202
203 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x40 0x00 0x00 0x00 0x00 0x20 0x00
204 Read The Attribute ${uri} present
205 Response Should Be Equal True
206
207Centaur0 not Present
208 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/membuf0
209 ${x} = Get Inventory Sensor Number ${uri}
210
211 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x40 0x00 0x00 0x20 0x00
212 Read The Attribute ${uri} present
213 Response Should Be Equal False
214
215Centaur0 fault
216 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/membuf0
217 ${x} = Get Inventory Sensor Number ${uri}
218
219 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x10 0x00 0x00 0x00 0x00 0x20 0x00
220 Read The Attribute ${uri} fault
221 Response Should Be Equal True
222
223Centaur0 no fault
224 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/membuf0
225 ${x} = Get Inventory Sensor Number ${uri}
226
227 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x10 0x00 0x00 0x20 0x00
228 Read The Attribute ${uri} fault
229 Response Should Be Equal False
230
231System Present
232 Read The Attribute /org/openbmc/inventory/system present
233 Response Should Be Equal True
234
235System Fault
236 Read The Attribute /org/openbmc/inventory/system fault
237 Response Should Be Equal False
238
239Chassis Present
240 Read The Attribute /org/openbmc/inventory/system/chassis present
241 Response Should Be Equal True
242
243Chassis Fault
244 Read The Attribute /org/openbmc/inventory/system/chassis fault
245 Response Should Be Equal False
246
247io_board Present
248 Read The Attribute /org/openbmc/inventory/system/chassis/io_board present
249 Response Should Be Equal True
250
251io_board Fault
252 Read The Attribute /org/openbmc/inventory/system/chassis/io_board fault
253 Response Should Be Equal False
254
255
256
257*** Keywords ***
258Execute new Command
259 [arguments] ${args}
260 ${output}= Execute Command ${args}
261 set test variable ${OUTPUT} "${output}"
262
263response Should Be Equal
264 [arguments] ${args}
265 Should Be Equal ${OUTPUT} ${args}
266
267Response Should Be Empty
268 Should Be Empty ${OUTPUT}
269
270Read the Attribute
271 [arguments] ${uri} ${parm}
272 ${output} = Read Attribute ${uri} ${parm}
273 set test variable ${OUTPUT} ${output}
274
275Get Sensor Number
276 [arguments] ${name}
277 ${x} = get sensor ${OPENBMC_MODEL} ${name}
278 [return] ${x}
279
280Get Inventory Sensor Number
281 [arguments] ${name}
282 ${x} = get inventory sensor ${OPENBMC_MODEL} ${name}
283 [return] ${x}