blob: 32c88fd510911e1f30a8b3cc54648bdc39c8f7c4 [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
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
32 ${uri} = Set Variable /org/openbmc/sensors/host/BootCount
33 ${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
41 ${uri} = Set Variable /org/openbmc/sensors/host/BootProgress
42 ${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
49 ${uri} = Set Variable /org/openbmc/sensors/host/BootProgress
50 ${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
57 ${uri} = Set Variable /org/openbmc/sensors/host/BootProgress
58 ${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
65 ${uri} = Set Variable /org/openbmc/sensors/host/BootProgress
66 ${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
73 ${uri} = Set Variable /org/openbmc/sensors/host/OperatingSystemStatus
74 ${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
81 ${uri} = Set Variable /org/openbmc/sensors/host/OperatingSystemStatus
82 ${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
89 ${uri} = Set Variable /org/openbmc/sensors/host/cpu0/OccStatus
90 ${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
97 ${uri} = Set Variable /org/openbmc/sensors/host/cpu0/OccStatus
98 ${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
105 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/cpu0
106 ${x} = Get Inventory Sensor Number ${uri}
107
108 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x80 0x00 0x00 0x00 0x00 0x20 0x00
109 Read The Attribute ${uri} present
110 Response Should Be Equal True
111
112CPU not Present
113 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/cpu0
114 ${x} = Get Inventory Sensor Number ${uri}
115
116 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x00 0x00 0x80 0x00 0x00 0x20 0x00
117 Read The Attribute ${uri} present
118 Response Should Be Equal False
119
120CPU fault
121 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/cpu0
122 ${x} = Get Inventory Sensor Number ${uri}
123
124 Run IPMI command 0x04 0x30 ${x} 0xa9 0xff 0x00 0x01 0x00 0x00 0x00 0x20 0x00
125 Read The Attribute ${uri} fault
126 Response Should Be Equal True
127
128CPU no fault
129 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/cpu0
130 ${x} = Get Inventory Sensor Number ${uri}
131
132 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x20 0x00
133 Read The Attribute ${uri} fault
134 Response Should Be Equal False
135
136core Present
137 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/cpu0/core11
138 ${x} = Get Inventory Sensor Number ${uri}
139
140 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x80 0x00 0x00 0x00 0x00 0x20 0x00
141 Read The Attribute ${uri} present
142 Response Should Be Equal True
143
144core not Present
145 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/cpu0/core11
146 ${x} = Get Inventory Sensor Number ${uri}
147
148 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x00 0x00 0x80 0x00 0x00 0x20 0x00
149 Read The Attribute ${uri} present
150 Response Should Be Equal False
151
152core fault
153 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/cpu0/core11
154 ${x} = Get Inventory Sensor Number ${uri}
155
156 Run IPMI command 0x04 0x30 ${x} 0xa9 0xff 0x00 0x01 0x00 0x00 0x00 0x20 0x00
157 Read The Attribute ${uri} fault
158 Response Should Be Equal True
159
160core no fault
161 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/cpu0/core11
162 ${x} = Get Inventory Sensor Number ${uri}
163
164 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x20 0x00
165 Read The Attribute ${uri} fault
166 Response Should Be Equal False
167
168DIMM3 Present
169 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/dimm3
170 ${x} = Get Inventory Sensor Number ${uri}
171
172 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x40 0x00 0x00 0x00 0x00 0x20 0x00
173 Read The Attribute ${uri} present
174 Response Should Be Equal True
175
176DIMM3 not Present
177 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/dimm3
178 ${x} = Get Inventory Sensor Number ${uri}
179
180 Run IPMI command 0x04 0x30 ${x} 0xa9 0xff 0x00 0x00 0x40 0x00 0x00 0x20 0x00
181 Read The Attribute ${uri} present
182 Response Should Be Equal False
183
184DIMM0 fault
185 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/dimm0
186 ${x} = Get Inventory Sensor Number ${uri}
187
188 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x10 0x00 0x00 0x00 0x00 0x20 0x00
189 Read The Attribute ${uri} fault
190 Response Should Be Equal True
191
192DIMM0 no fault
193 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/dimm0
194 ${x} = Get Inventory Sensor Number ${uri}
195
196 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x10 0x00 0x00 0x20 0x00
197 Read The Attribute ${uri} fault
198 Response Should Be Equal False
199
200Centaur0 Present
201 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/membuf0
202 ${x} = Get Inventory Sensor Number ${uri}
203
204 Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x40 0x00 0x00 0x00 0x00 0x20 0x00
205 Read The Attribute ${uri} present
206 Response Should Be Equal True
207
208Centaur0 not Present
209 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/membuf0
210 ${x} = Get Inventory Sensor Number ${uri}
211
212 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x40 0x00 0x00 0x20 0x00
213 Read The Attribute ${uri} present
214 Response Should Be Equal False
215
216Centaur0 fault
217 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/membuf0
218 ${x} = Get Inventory Sensor Number ${uri}
219
220 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x10 0x00 0x00 0x00 0x00 0x20 0x00
221 Read The Attribute ${uri} fault
222 Response Should Be Equal True
223
224Centaur0 no fault
225 ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/membuf0
226 ${x} = Get Inventory Sensor Number ${uri}
227
228 Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x10 0x00 0x00 0x20 0x00
229 Read The Attribute ${uri} fault
230 Response Should Be Equal False
231
232System Present
233 Read The Attribute /org/openbmc/inventory/system present
234 Response Should Be Equal True
235
236System Fault
237 Read The Attribute /org/openbmc/inventory/system fault
238 Response Should Be Equal False
239
240Chassis Present
241 Read The Attribute /org/openbmc/inventory/system/chassis present
242 Response Should Be Equal True
243
244Chassis Fault
245 Read The Attribute /org/openbmc/inventory/system/chassis fault
246 Response Should Be Equal False
247
248io_board Present
249 Read The Attribute /org/openbmc/inventory/system/chassis/io_board present
250 Response Should Be Equal True
251
252io_board Fault
253 Read The Attribute /org/openbmc/inventory/system/chassis/io_board fault
254 Response Should Be Equal False
255
256
257
258*** Keywords ***
259Execute new Command
260 [arguments] ${args}
261 ${output}= Execute Command ${args}
262 set test variable ${OUTPUT} "${output}"
263
264response Should Be Equal
265 [arguments] ${args}
266 Should Be Equal ${OUTPUT} ${args}
267
268Response Should Be Empty
269 Should Be Empty ${OUTPUT}
270
271Read the Attribute
272 [arguments] ${uri} ${parm}
273 ${output} = Read Attribute ${uri} ${parm}
274 set test variable ${OUTPUT} ${output}
275
276Get Sensor Number
277 [arguments] ${name}
278 ${x} = get sensor ${OPENBMC_MODEL} ${name}
279 [return] ${x}
280
281Get Inventory Sensor Number
282 [arguments] ${name}
283 ${x} = get inventory sensor ${OPENBMC_MODEL} ${name}
284 [return] ${x}