blob: 00985a20b5ed6532cc0787d7fcca56bfb929ffea [file] [log] [blame]
Chris Austenb29d2e82016-06-07 12:25:35 -05001*** Settings ***
George Keishingc8166ed2017-02-24 03:53:38 -06002Documentation System inventory related test.
3
Chris Austenb29d2e82016-06-07 12:25:35 -05004Resource ../lib/rest_client.robot
5Resource ../lib/utils.robot
Rahul Maheshwari908df572017-02-16 04:41:54 -06006Resource ../lib/state_manager.robot
George Keishingd55a4be2016-08-26 03:28:17 -05007Resource ../lib/openbmc_ffdc.robot
Sweta Potthuri654cbc02017-06-15 10:10:55 -05008Resource ../lib/list_utils.robot
Sweta Potthuriaf741cb2017-07-04 09:41:17 -05009Resource ../lib/boot_utils.robot
Steven Sombar0d0d1112018-10-09 16:09:59 -050010Resource ../lib/fan_utils.robot
George Keishingefa97352017-03-13 07:13:03 -050011Library ../lib/utilities.py
George Keishing8c9efed2018-02-28 10:45:26 -060012Library Collections
Chris Austenb29d2e82016-06-07 12:25:35 -050013
14Variables ../data/variables.py
George Keishingc8166ed2017-02-24 03:53:38 -060015Variables ../data/inventory.py
Chris Austenb29d2e82016-06-07 12:25:35 -050016
George Keishingda0aa882017-12-05 06:44:03 -060017Suite Setup Suite Setup Execution
Rahul Maheshwari908df572017-02-16 04:41:54 -060018Test Teardown FFDC On Test Case Fail
Chris Austenb29d2e82016-06-07 12:25:35 -050019
Rahul Maheshwari3e9b0de2017-03-20 06:25:44 -050020Force Tags Inventory
21
Sweta Potthuri654cbc02017-06-15 10:10:55 -050022***Variables***
23
24${LOOP_COUNT} ${1}
25
Chris Austenb29d2e82016-06-07 12:25:35 -050026*** Test Cases ***
27
George Keishingc8166ed2017-02-24 03:53:38 -060028Verify System Inventory Path
29 [Documentation] Check if system inventory path exist.
30 [Tags] Verify_System_Inventory_Path
31 # When the host is booted, system inventory path should exist.
32 # Example: /xyz/openbmc_project/inventory/system
33 Get Inventory system
Chris Austenb29d2e82016-06-07 12:25:35 -050034
Rahul Maheshwaribb20f732016-10-24 06:27:14 -050035
George Keishing3d734312017-07-24 04:10:25 -050036Verify Boxelder Present Property
37 [Documentation] Boxelder should be present by default.
George Keishing01b59ac2017-11-24 10:43:58 -060038 [Tags] Verify_Boxelder_Present_Property
George Keishing3d734312017-07-24 04:10:25 -050039 # Example:
40 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/boxelder/bmc":
41 # {
42 # "BuildDate": "",
43 # "FieldReplaceable": 0,
George Keishinge0a81282018-06-08 10:02:30 -050044 # "Manufacturer": "<Manufacturer Name>",
George Keishing3d734312017-07-24 04:10:25 -050045 # "Model": "",
46 # "PartNumber": "01DH051",
47 # "Present": 1,
48 # "PrettyName": "BMC PLANAR ",
49 # "SerialNumber": "000000000000"
50 # },
51 ${json_data}= Get Inventory system/chassis/motherboard/boxelder/bmc
52 Should Be True ${json_data["data"]["Present"]}
George Keishing33dd4432017-09-13 01:48:26 -050053 Should Not Be Equal As Strings
54 ... ${json_data["data"]["SerialNumber"]} 000000000000
55 ... msg=BMC planar serial number invalid.
George Keishing3d734312017-07-24 04:10:25 -050056
57
George Keishinge4e1d272017-11-24 06:05:21 -060058Verify UUID Entry
59 [Documentation] UUID entry should exist in BMC planar property.
60 [Tags] Verify_UUID_Entry
61 # Example:
62 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/boxelder/bmc":
63 # {
64 # "BuildDate": "",
65 # "FieldReplaceable": 0,
George Keishinge0a81282018-06-08 10:02:30 -050066 # "Manufacturer": "<Manufacturer Name>",
George Keishinge4e1d272017-11-24 06:05:21 -060067 # "Model": "",
68 # "PartNumber": "01DH051",
69 # "Present": 1,
70 # "PrettyName": "BMC PLANAR ",
71 # "SerialNumber": "000000000000"
72 # "UUID": ""
73 # },
George Keishingfa239972017-12-11 06:45:05 -060074 ${resp}= OpenBMC Get Request
75 ... ${HOST_INVENTORY_URI}system/chassis/motherboard/boxelder/bmc/attr/UUID
76 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
George Keishinge4e1d272017-11-24 06:05:21 -060077
78
George Keishing3d734312017-07-24 04:10:25 -050079Verify Boxelder MAC Address Property Is Populated
80 [Documentation] Boxelder should be present by default.
81 [Tags] Verify_Boxelder_MAC_Address_Property_Is_Populated
82 # Example:
83 # /xyz/openbmc_project/inventory/system/chassis/motherboard/boxelder/bmc/ethernet
84 # {
85 # "FieldReplaceable": 0,
86 # "MACAddress": "00:00:00:00:00:00",
87 # "Present": 1,
88 # "PrettyName": ""
89 # }
90
91 ${json_data}= Get Inventory
92 ... system/chassis/motherboard/boxelder/bmc/ethernet
93 Should Be True ${json_data["data"]["Present"]}
94 Should Not Be Equal As Strings
95 ... ${json_data["data"]["MACAddress"]} 00:00:00:00:00:00
96
97 # eth0 Link encap:Ethernet HWaddr 70:E2:84:14:23:F9
98 ${mac_addr} ${stderr} ${rc}= BMC Execute Command
99 ... /sbin/ifconfig -a | grep HWaddr | awk -F'HWaddr ' '{print $2}'
100 ... return_stderr=True
101 Should Be Empty ${stderr}
Rahul Maheshwari844dbe72017-09-18 00:24:23 -0500102 Should Be Equal As Strings ${json_data["data"]["MACAddress"]}
103 ... ${mac_addr.strip()} msg=MAC address configured incorrectly.
104 ... ignore_case=True
George Keishing3d734312017-07-24 04:10:25 -0500105
106
George Keishingc8166ed2017-02-24 03:53:38 -0600107Verify Chassis Motherboard Properties
108 [Documentation] Check if chassis motherboard properties are
109 ... populated valid.
110 [Tags] Verify_Chassis_Motherboard_Properties
111 # When the host is booted, the following properties should
112 # be populated Manufacturer, PartNumber, SerialNumber and
113 # it should not be zero's.
114 # Example:
115 # "data": {
116 # "/xyz/openbmc_project/inventory/system/chassis/motherboard": {
117 # "BuildDate": "",
118 # "Manufacturer": "0000000000000000",
119 # "Model": "",
120 # "PartNumber": "0000000",
121 # "Present": 0,
122 # "PrettyName": "SYSTEM PLANAR ",
123 # "SerialNumber": "000000000000"
124 # }
125 ${properties}= Get Inventory system/chassis/motherboard
126 Should Not Be Equal As Strings
George Keishingc8166ed2017-02-24 03:53:38 -0600127 ... ${properties["data"]["PartNumber"]} 0000000
128 ... msg=motherboard part number invalid.
129 Should Not Be Equal As Strings
130 ... ${properties["data"]["SerialNumber"]} 000000000000
131 ... msg=motherboard serial number invalid.
Chris Austenb29d2e82016-06-07 12:25:35 -0500132
George Keishingae355302017-03-13 04:34:58 -0500133Verify CPU Present
134 [Documentation] Check if the FRU "Present" is set for CPU's.
135 [Tags] Verify_CPU_Present
136 # System inventory cpu list:
137 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0
138 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1
139 # Example:
140 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0": {
141 # "FieldReplaceable": 1,
142 # "BuildDate": "",
143 # "Cached": 0,
144 # "SerialNumber": "YA3933741574",
145 # "Version": "10",
146 # "Model": "",
147 # "PrettyName": "PROCESSOR MODULE",
148 # "PartNumber": "01HL322",
149 # "Present": 1,
George Keishinge0a81282018-06-08 10:02:30 -0500150 # "Manufacturer": "<Manufacturer Name>"
George Keishingae355302017-03-13 04:34:58 -0500151 # },
152 # The CPU properties "Present" should be boolean 1.
153
154 ${cpu_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system cpu
155 :FOR ${cpu_uri} IN @{cpu_list}
156 \ ${present}= Read Attribute ${cpu_uri} Present
157 \ Should Be True ${present}
158
159
160Verify DIMM Present
161 [Documentation] Check if the FRU "Present" is set for DIMM's.
162 [Tags] Verify_DIMM_Present
163 # Example:
164 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0": {
165 # "FieldReplaceable": 1,
166 # "BuildDate": "",
167 # "Cached": 0,
168 # "SerialNumber": "0x0300cf4f",
169 # "Version": "0x00",
170 # "Model": "M393A1G40EB1-CRC ",
171 # "PrettyName": "0x0c",
172 # "PartNumber": "",
173 # "Present": 1,
174 # "Manufacturer": "0xce80"
175 # },
176
177 # The DIMM properties "Present" should be boolean 1.
178
179 ${dimm_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system dimm
180 :FOR ${dimm_uri} IN @{dimm_list}
181 \ ${present}= Read Attribute ${dimm_uri} Present
182 \ Should Be True ${present}
183
184
George Keishingefa97352017-03-13 07:13:03 -0500185Verify FRU Properties
186 [Documentation] Verify the FRU properties fields.
187 [Tags] Verify_FRU_Properties
188 # Example:
189 # A FRU would have "FieldReplaceable" set to boolean 1 and should have
190 # the following entries
191 # "fru": [
192 # "FieldReplaceable"
193 # "BuildDate",
194 # "Cached"
195 # "SerialNumber",
196 # "Version",
197 # "Model",
198 # "PrettyName",
199 # "PartNumber",
200 # "Present",
201 # "Manufacturer",
202 # ]
203 # and FRU which doesn't have one of this fields is an error.
204 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0": {
205 # "FieldReplaceable": 1,
206 # "BuildDate": "",
207 # "Cached": 0,
208 # "SerialNumber": "0x0300cf4f",
209 # "Version": "0x00",
210 # "Model": "M393A1G40EB1-CRC ",
211 # "PrettyName": "0x0c",
212 # "PartNumber": "",
213 # "Present": 1,
214 # "Manufacturer": "0xce80"
215 # },
216
217 ${system_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system *
218 ${fru_list}= Qualified FRU List @{system_list}
Steven Sombar0d0d1112018-10-09 16:09:59 -0500219 Validate FRU Properties Fields fru EQU @{fru_list}
George Keishingda0aa882017-12-05 06:44:03 -0600220
221
222Verify GPU Properties
223 [Documentation] Verify the GPU properties fields.
224 [Tags] Verify_GPU_Properties
225 # Example:
226 # A GPU property should have the following entries:
227 # "gpu":[
George Keishing0219da62018-03-26 03:24:40 -0500228 # "FieldReplaceable",
George Keishingda0aa882017-12-05 06:44:03 -0600229 # "PrettyName",
230 # "Present",
231 # "Functional"
232 # ]
233 # GPU inventory:
234 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card2": {
George Keishing0219da62018-03-26 03:24:40 -0500235 # "FieldReplaceable": 1,
George Keishingda0aa882017-12-05 06:44:03 -0600236 # "Functional": 1,
237 # "Present": 1,
238 # "PrettyName": ""
239 # },
240
241
242 ${system_list}= Get Endpoint Paths
243 ... ${HOST_INVENTORY_URI}system/chassis/motherboard gv*
Steven Sombar0d0d1112018-10-09 16:09:59 -0500244 Validate FRU Properties Fields gpu EQU @{system_list}
George Keishingda0aa882017-12-05 06:44:03 -0600245
246
247Verify Core Properties
248 [Documentation] Verify the core property fields.
249 [Tags] Verify_Core_Properties
250 # Example:
251 # A core property should have the following entries:
252 # "core":[
253 # "PrettyName",
254 # "Present",
255 # "Functional"
256 # ]
257 # core inventory:
258 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1/core0": {
259 # "Functional": 1,
260 # "Present": 1,
261 # "PrettyName": ""
262 # },
263
264 ${system_list}= Get Endpoint Paths
265 ... ${HOST_INVENTORY_URI}system/chassis/motherboard core*
Steven Sombar0d0d1112018-10-09 16:09:59 -0500266 Validate FRU Properties Fields core EQU @{system_list}
George Keishingda0aa882017-12-05 06:44:03 -0600267
George Keishingefa97352017-03-13 07:13:03 -0500268
George Keishingca8c61b2017-12-11 11:48:00 -0600269Verify Fan Properties
270 [Documentation] Verify the fan property fields.
271 [Tags] Verify_Fan_Properties
272 # Example:
273 # A fan property should have the following entries:
274 # "core":[
275 # "PrettyName",
276 # "Present",
277 # "MeetsMinimumShipLevel",
278 # "Functional"
279 # ]
280 # fan inventory:
281 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan0": {
282 # "Functional": 1,
283 # "MeetsMinimumShipLevel": 1,
284 # "Present": 1,
285 # "PrettyName": "fan0"
286 # },
287
Steven Sombar0d0d1112018-10-09 16:09:59 -0500288 ${water_cooled}= Is Water Cooled
289
George Keishingca8c61b2017-12-11 11:48:00 -0600290 ${system_list}= Get Endpoint Paths
291 ... ${HOST_INVENTORY_URI}system/chassis/motherboard fan*
Steven Sombar0d0d1112018-10-09 16:09:59 -0500292
293 Rprintn
294 Rprint Vars water_cooled system_list
295
296 Run Keyword If ${water_cooled}
297 ... Validate FRU Properties Fields fan_wc SUBSET @{system_list}
298 ... ELSE
299 ... Validate FRU Properties Fields fan EQU @{system_list}
George Keishingca8c61b2017-12-11 11:48:00 -0600300
George Keishing071d8da2017-03-24 09:13:16 -0500301
302Verify Core Functional State
303 [Documentation] Verify that "Present" core property is set if "Functional"
304 ... core property is set.
305 [Tags] Verify_Core_Functional_State
306 # Example:
307 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core5":{
308 # "Functional": 1,
309 # "Present": 1,
310 # "PrettyName": ""
311 # },
312 ${core_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system core
313 :FOR ${core_uri} IN @{core_list}
314 \ ${status}= Run Keyword And Return Status
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500315 ... Check URL Property Is Functional ${core_uri}
George Keishingc5658392017-04-27 23:05:18 -0500316 \ Continue For Loop If '${status}' == '${False}'
George Keishing071d8da2017-03-24 09:13:16 -0500317 \ ${present}= Read Attribute ${core_uri} Present
318 \ Should Be True ${present}
319 ... msg=${core_uri} is functional but not present.
320
321
322Verify DIMM Functional State
323 [Documentation] Verify that "Present" DIMM property is set if "Functional"
324 ... DIMM property is set.
325 [Tags] Verify_DIMM_Functional_State
326 # Example:
327 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0": {
328 # "BuildDate": "",
329 # "Cached": 0,
330 # "FieldReplaceable": 1,
331 # "Functional": 1,
332 # "Manufacturer": "0xce80",
333 # "Model": "M393A1G40EB1-CRC ",
334 # "PartNumber": "",
335 # "Present": 1,
336 # "PrettyName": "0x0c",
337 # "SerialNumber": "0x0300cf4f",
338 # "Version": "0x00"
339 # },
340
341 ${dimm_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system dimm
342 :FOR ${dimm_uri} IN @{dimm_list}
343 \ ${status}= Run Keyword And Return Status
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500344 ... Check URL Property Is Functional ${dimm_uri}
George Keishingc5658392017-04-27 23:05:18 -0500345 \ Continue For Loop If '${status}' == '${False}'
George Keishing071d8da2017-03-24 09:13:16 -0500346 \ ${present}= Read Attribute ${dimm_uri} Present
347 \ Should Be True ${present}
348 ... msg=${dimm_uri} is functional but not present.
349
George Keishing3c205b12017-05-13 04:09:33 -0500350
351Verify Fan Functional State
352 [Documentation] Verify that "Present" fan property is set if "Functional"
353 ... fan property is set.
354 [Tags] Verify_Fan_Functional_State
355 # Example:
356 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan0": {
357 # "Functional": 1,
358 # "Present": 1,
359 # "PrettyName": "fan0"
360 # },
361
362 ${fan_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system fan*
363 Should Not Be Empty ${fan_list}
364 :FOR ${fan_uri} IN @{fan_list}
365 \ ${status}= Run Keyword And Return Status
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500366 ... Check URL Property Is Functional ${fan_uri}
George Keishing3c205b12017-05-13 04:09:33 -0500367 \ Continue For Loop If '${status}' == '${False}'
368 \ ${present}= Read Attribute ${fan_uri} Present
369 \ Should Be True ${present}
370 ... msg=${fan_uri} is functional but "Present" is not set.
371
Sweta Potthuri56631f52017-11-10 02:19:38 -0600372Verify CPU Functional State
373 [Documentation] Verify that "Present" CPU property is set if "Functional"
374 ... CPU property is set.
375 [Tags] Verify_CPU_Functional_State
376
377 # Example of cpu* endpoint data:
378 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0": {
379 # "Functional": 1,
380 # "Present": 1,
381 # "PrettyName": "cpu0"
382 # },
383
384 ${cpu_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system cpu*
385 Should Not Be Empty ${cpu_list}
386 :FOR ${cpu_uri} IN @{cpu_list}
387 \ ${status}= Run Keyword And Return Status
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500388 ... Check URL Property Is Functional ${cpu_uri}
Sweta Potthuri56631f52017-11-10 02:19:38 -0600389 \ Continue For Loop If '${status}' == '${False}'
390 \ ${present}= Read Attribute ${cpu_uri} Present
391 \ Should Be True ${present}
392 ... msg=${cpu_uri} is functional but "Present" is not set.
George Keishing3c205b12017-05-13 04:09:33 -0500393
George Keishing53a75f72017-11-17 12:50:30 -0600394
395Verify GPU Functional State
396 [Documentation] Verify that "Functional" GPU property is set if "Present"
397 ... GPU property is set
398 [Tags] Verify_GPU_Functional_State
399
400 # Example of gv* endpoint data:
401 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card4": {
402 # "Functional": 1,
403 # "Present": 1,
404 # "PrettyName": ""
405 # },
406
407
George Keishingc7b161b2017-12-01 09:58:12 -0600408 ${gpu_list}= Get Endpoint Paths
409 ... ${HOST_INVENTORY_URI}system/chassis/motherboard gv*
George Keishing53a75f72017-11-17 12:50:30 -0600410 Should Not Be Empty ${gpu_list}
411 :FOR ${gpu_uri} IN @{gpu_list}
412 \ ${status}= Run Keyword And Return Status
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500413 ... Check URL Property Is Functional ${gpu_uri}
George Keishing53a75f72017-11-17 12:50:30 -0600414 \ Continue For Loop If '${status}' == '${False}'
415 \ ${present}= Read Attribute ${gpu_uri} Present
416 \ Should Be True ${present}
417 ... msg=${gpu_uri} is functional but "Present" is not set.
418
419
George Keishing04c6b2c2017-06-15 12:33:59 -0500420Check Air Or Water Cooled
421 [Documentation] Check if this system is Air or water cooled.
422 [Tags] Check_Air_Or_Water_Cooled
423 # Example:
424 # "/xyz/openbmc_project/inventory/system/chassis": {
425 # "AirCooled": 1,
426 # "WaterCooled": 0
427 # },
428
429 ${air_cooled}= Read Attribute
430 ... /xyz/openbmc_project/inventory/system/chassis AirCooled
431 Log AirCooled:${air_cooled}
432
433 ${water_cooled}= Read Attribute
434 ... /xyz/openbmc_project/inventory/system/chassis WaterCooled
435 Log WaterCooled:${water_cooled}
436
437 Run Keyword If ${air_cooled}==${0} and ${water_cooled}==${0}
438 ... Fail Neither AirCooled or WaterCooled.
439
Sweta Potthuri1a640de2017-07-18 11:09:59 -0500440Verify Minimal CPU Inventory
441 [Documentation] Verify minimal CPU inventory.
442 [Tags] Verify_Minimal_CPU_Inventory
George Keishing5abfe602018-07-05 11:54:37 -0500443 [Template] Minimum Inventory
Sweta Potthuri1a640de2017-07-18 11:09:59 -0500444
445 # item minimum_count
446 cpu 1
Sweta Potthuri1a640de2017-07-18 11:09:59 -0500447
448Verify Minimal DIMM Inventory
449 [Documentation] Verify minimal DIMM inventory.
450 [Tags] Verify_Minimal_DIMM_Inventory
George Keishing5abfe602018-07-05 11:54:37 -0500451 [Template] Minimum Inventory
Sweta Potthuri1a640de2017-07-18 11:09:59 -0500452
453 # item minimum_count
454 dimm 2
Sweta Potthuri1a640de2017-07-18 11:09:59 -0500455
456Verify Minimal Core Inventory
457 [Documentation] Verify minimal core inventory.
458 [Tags] Verify_Minimal_Core_Inventory
George Keishing5abfe602018-07-05 11:54:37 -0500459 [Template] Minimum Inventory
Sweta Potthuri1a640de2017-07-18 11:09:59 -0500460
461 # item minimum_count
462 core 1
Sweta Potthuri1a640de2017-07-18 11:09:59 -0500463
464Verify Minimal Memory Buffer Inventory
465 [Documentation] Verify minimal memory buffer inventory.
466 [Tags] Verify_Minimal_Memory_Buffer_Inventory
George Keishing5abfe602018-07-05 11:54:37 -0500467 [Template] Minimum Inventory
Sweta Potthuri1a640de2017-07-18 11:09:59 -0500468
469 # item minimum_count
470 memory_buffer 1
Sweta Potthuri1a640de2017-07-18 11:09:59 -0500471
472Verify Minimal Fan Inventory
473 [Documentation] Verify minimal fan inventory.
474 [Tags] Verify_Minimal_Fan_Inventory
George Keishing5abfe602018-07-05 11:54:37 -0500475 [Template] Minimum Inventory
Sweta Potthuri1a640de2017-07-18 11:09:59 -0500476
477 # item minimum_count
478 fan 2
Sweta Potthuri1a640de2017-07-18 11:09:59 -0500479
480Verify Minimal Main Planar Inventory
481 [Documentation] Verify minimal main planar inventory.
482 [Tags] Verify_Minimal_Main_Planar_Inventory
George Keishing5abfe602018-07-05 11:54:37 -0500483 [Template] Minimum Inventory
Sweta Potthuri1a640de2017-07-18 11:09:59 -0500484
485 # item minimum_count
486 main_planar 1
Sweta Potthuri1a640de2017-07-18 11:09:59 -0500487
488Verify Minimal System Inventory
489 [Documentation] Verify minimal system inventory.
490 [Tags] Verify_Minimal_System_Inventory
George Keishing5abfe602018-07-05 11:54:37 -0500491 [Template] Minimum Inventory
Sweta Potthuri1a640de2017-07-18 11:09:59 -0500492
493 # item minimum_count
494 system 1
George Keishing04c6b2c2017-06-15 12:33:59 -0500495
George Keishing03ebc292017-08-02 01:22:02 -0500496Verify Minimal Power Supply Inventory
497 [Documentation] Verify minimal power supply inventory.
498 [Tags] Verify_Minimal_Power_Supply_Inventory
George Keishing5abfe602018-07-05 11:54:37 -0500499 [Template] Minimum Inventory
George Keishing03ebc292017-08-02 01:22:02 -0500500 # Example:
Matt Spinler6a1e5ed2018-02-14 09:05:07 -0600501 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0",
502 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply1",
George Keishing03ebc292017-08-02 01:22:02 -0500503
504 # item minimum_count
George Keishing1b71f222017-11-23 14:02:49 -0600505 powersupply 1
George Keishing03ebc292017-08-02 01:22:02 -0500506
George Keishingfafbfdb2017-08-30 23:51:23 -0500507
508Verify Inventory List After Reboot
509 [Documentation] Verify inventory list after reboot.
510 [Tags] Verify_Inventory_List_After_Reboot
511
512 Repeat Keyword ${LOOP_COUNT} times Choose Boot Option reboot
513
514
515Verify Inventory List After Reset
516 [Documentation] Verify inventory list after reset.
517 [Tags] Verify_Inventory_List_After_Reset
518
519 Repeat Keyword ${LOOP_COUNT} times Choose Boot Option reset
520
Chris Austenb29d2e82016-06-07 12:25:35 -0500521*** Keywords ***
522
George Keishingda0aa882017-12-05 06:44:03 -0600523Suite Setup Execution
George Keishingc8166ed2017-02-24 03:53:38 -0600524 [Documentation] Do the initial suite setup.
George Keishing25577a22017-07-12 05:18:46 -0500525
George Keishing4f5260b2017-12-14 12:28:31 -0600526 Smart Power Off
527 REST Power On
George Keishing8b13fd22018-07-20 12:28:52 -0500528 Delete All Error Logs
George Keishingcaac9f32017-03-09 02:14:27 -0600529
George Keishingc8166ed2017-02-24 03:53:38 -0600530Get Inventory
531 [Documentation] Get the properties of an endpoint.
532 [Arguments] ${endpoint}
533 # Description of arguments:
534 # endpoint string for which url path ending.
535 # Example: "system" is the endpoint for url
536 # /xyz/openbmc_project/inventory/system
537 ${resp}= OpenBMC Get Request ${HOST_INVENTORY_URI}${endpoint}
538 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
539 ${jsondata}= To JSON ${resp.content}
540 [Return] ${jsondata}
George Keishingefa97352017-03-13 07:13:03 -0500541
542
543Qualified FRU List
544 [Documentation] Build the list of valid FRUs.
545 [Arguments] @{system_list}
546 # Description of arguments:
547 # system_list List of system inventory URLs.
548 # Example:
549 # /xyz/openbmc_project/inventory/system/chassis/motherboard
550 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0
551 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1
552 # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0
553 # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm1
554 # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm2
555 # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm3
556 # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm4
557 # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm5
558 # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm6
559 # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm7
560
561 ${fru_list}= Create List
562 :FOR ${fru_uri} IN @{system_list}
George Keishingdf5ab122017-04-17 04:01:11 -0500563 \ ${resp}= OpenBMC Get Request ${fru_uri}/attr/FieldReplaceable
George Keishingda0aa882017-12-05 06:44:03 -0600564 ... quiet=${1}
George Keishingdf5ab122017-04-17 04:01:11 -0500565 \ ${jsondata}= To JSON ${resp.content}
566 \ ${status}= Run Keyword And Return Status
567 ... Should Be True ${jsondata['data']} == ${1}
George Keishingefa97352017-03-13 07:13:03 -0500568 \ Run Keyword If '${status}' == '${True}'
569 ... Append To List ${fru_list} ${fru_uri}
570
George Keishing8c9efed2018-02-28 10:45:26 -0600571 ${fru_valid_list}= Filter GPU FRU Entries ${fru_list}
572
573 [Return] ${fru_valid_list}
574
575
576Filter GPU FRU Entries
577 [Documentation] Remove GPU entries from FRU list and return the result.
578 [Arguments] ${fru_list}
579
580 # Description of arguments:
581 # fru_list List of FRU system inventory URIs.
582 # Example FRUs list:
583 # [u'/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0',
584 # u'/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1',
585 # u'/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0',
586 # u'/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm1',
587 # u'/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card0',
588 # u'/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card1',
589 # u'/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card3',
590 # u'/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card4']
591
592 # Example of the matched GPU FRUs entries:
593 # [u'/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card0',
594 # u'/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card1',
595 # u'/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card3',
596 # u'/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card4']
597
598 ${gpu_matches}= Get Matches ${fru_list} *gv*
599
600 Remove Values From List ${fru_list} @{gpu_matches}
George Keishingefa97352017-03-13 07:13:03 -0500601 [Return] ${fru_list}
602
603
604Validate FRU Properties Fields
Steven Sombar0d0d1112018-10-09 16:09:59 -0500605 [Documentation] Compare valid FRUs from system to expected FRU set.
606 [Arguments] ${fru_type} ${comparison_type} @{fru_list}
George Keishingda0aa882017-12-05 06:44:03 -0600607
Steven Sombar0d0d1112018-10-09 16:09:59 -0500608 # Description of argument(s):
609 # fru_type FRU type name (e.g. "gpu", "fru", "fan", etc.).
610 # comparison_type A string indicating the comparison method.
611 # "EQU" for equality, "SUBSET" for subset comparison.
612 # fru_list List of FRU URLs.
George Keishingefa97352017-03-13 07:13:03 -0500613
Steven Sombar0d0d1112018-10-09 16:09:59 -0500614 # Get the pre-defined fru_type attributes from the inventory dictionary
615 # for the fru_type. Example:
George Keishingefa97352017-03-13 07:13:03 -0500616 # set(['Version', 'PartNumber', 'SerialNumber', 'FieldReplaceable',
617 # 'BuildDate', 'Present', 'Manufacturer', 'PrettyName', 'Cached', 'Model'])
George Keishingda0aa882017-12-05 06:44:03 -0600618 ${fru_set}= List To Set ${inventory_dict['${fru_type}']}
George Keishingefa97352017-03-13 07:13:03 -0500619
Steven Sombar0d0d1112018-10-09 16:09:59 -0500620 Rprint Vars fru_set
621
622 # Iterate through the url of the FRU and compare its attributes with
623 # the pre-defined fru_type attributes.
George Keishingefa97352017-03-13 07:13:03 -0500624 :FOR ${fru_url_path} IN @{fru_list}
625 \ ${fru_field}= Read Properties ${fru_url_path}
Steven Sombar0d0d1112018-10-09 16:09:59 -0500626 \ ${fru_keys}= List To Set ${fru_field.viewkeys()}
627 \ Rprint Vars fru_keys
628 \ Run Keyword If '${comparison_type}' == 'EQU'
629 ... Should Be Equal ${fru_keys} ${fru_set}
630 ... ELSE
631 ... Should Be True $fru_set.issubset($fru_keys)
George Keishingefa97352017-03-13 07:13:03 -0500632
George Keishing071d8da2017-03-24 09:13:16 -0500633
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500634Check URL Property Is Functional
635 [Documentation] Verify that the given url property is functional.
George Keishing071d8da2017-03-24 09:13:16 -0500636 [Arguments] ${url_path}
637 # Description of arguments:
638 # url_path Full url path of the inventory object.
639 # Example: DIMM / core property url's
640 # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0
641 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core0
642 ${state}= Read Attribute ${url_path} Functional
643 Should Be True ${state}
Sweta Potthuri654cbc02017-06-15 10:10:55 -0500644
George Keishingfafbfdb2017-08-30 23:51:23 -0500645Choose Boot Option
646 [Documentation] Choose BMC reset or host reboot.
647 [Arguments] ${option}
Sweta Potthuri654cbc02017-06-15 10:10:55 -0500648
George Keishingfafbfdb2017-08-30 23:51:23 -0500649 Run Keyword If '${option}' == 'reboot'
650 ... Verify Inventory List Before And After Reboot
651 ... ELSE
652 ... Verify Inventory List Before And After Reset
653
654
655Verify Inventory List Before And After Reboot
656 [Documentation] Verify inventory list before and after reboot.
657
George Keishingda0aa882017-12-05 06:44:03 -0600658 REST Power On stack_mode=skip quiet=1
George Keishing32fe4e12018-07-13 05:06:47 -0500659 Delete All Error Logs
George Keishingfafbfdb2017-08-30 23:51:23 -0500660 ${inventory_before}= Get URL List ${HOST_INVENTORY_URI}
George Keishinga58775d2018-09-06 10:01:27 -0500661 Host Reboot
George Keishing32fe4e12018-07-13 05:06:47 -0500662 Delete All Error Logs
George Keishingfafbfdb2017-08-30 23:51:23 -0500663 ${inventory_after}= Get URL List ${HOST_INVENTORY_URI}
664 Lists Should Be Equal ${inventory_before} ${inventory_after}
665
666
667Verify Inventory List Before And After Reset
668 [Documentation] Verify inventory list before and after BMC reset.
669
George Keishingda0aa882017-12-05 06:44:03 -0600670 REST Power On stack_mode=skip quiet=1
George Keishing32fe4e12018-07-13 05:06:47 -0500671 Delete All Error Logs
George Keishingfafbfdb2017-08-30 23:51:23 -0500672 ${inventory_before}= Get URL List ${HOST_INVENTORY_URI}
673 OBMC Reboot (run)
George Keishing32fe4e12018-07-13 05:06:47 -0500674 Delete All Error Logs
George Keishingfafbfdb2017-08-30 23:51:23 -0500675 ${inventory_after}= Get URL List ${HOST_INVENTORY_URI}
676 Lists Should Be Equal ${inventory_before} ${inventory_after}
677
Sweta Potthuri1a640de2017-07-18 11:09:59 -0500678
679Minimum Inventory
680 [Documentation] Check for minimum inventory.
681 [Arguments] ${item} ${minimum_count}
682
683 # Description of argument(s):
684 # item Inventory name (example: "fan/cpu/dimm/etc").
685 # minimum_count The minimum number of the given item.
686
687 ${count}= Get Number Hardware Items ${item}
688 Should Be True ${count}>=${minimum_count}
689
690Get Number Hardware Items
691 [Documentation] Get the count of the total present currently on inventory.
692 [Arguments] ${item}
693
694 # Description of argument(s):
695 # item Inventory name (example: "fan/cpu/dimm/etc").
696
697 ${count_inventory} Set Variable ${0}
698 ${list}= Get Endpoint Paths ${HOST_INVENTORY_URI}/system/
699 ... ${item}
700
701 : FOR ${element} IN @{list}
702 \ ${present}= Read Properties ${element}
703 \ ${count_inventory}= Set Variable if ${present['Present']} == 1
704 \ ... ${count_inventory+1} ${count_inventory}
705 [return] ${count_inventory}