blob: 025eb2c06b9061733987acde8dce80c8b976133b [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
George Keishingefa97352017-03-13 07:13:03 -050010Library ../lib/utilities.py
Chris Austenb29d2e82016-06-07 12:25:35 -050011
12Variables ../data/variables.py
George Keishingc8166ed2017-02-24 03:53:38 -060013Variables ../data/inventory.py
Chris Austenb29d2e82016-06-07 12:25:35 -050014
George Keishingc8166ed2017-02-24 03:53:38 -060015Suite setup Test Suite Setup
Rahul Maheshwari908df572017-02-16 04:41:54 -060016Test Teardown FFDC On Test Case Fail
Chris Austenb29d2e82016-06-07 12:25:35 -050017
Rahul Maheshwari3e9b0de2017-03-20 06:25:44 -050018Force Tags Inventory
19
Sweta Potthuri654cbc02017-06-15 10:10:55 -050020***Variables***
21
22${LOOP_COUNT} ${1}
23
Chris Austenb29d2e82016-06-07 12:25:35 -050024*** Test Cases ***
25
George Keishingc8166ed2017-02-24 03:53:38 -060026Verify System Inventory Path
27 [Documentation] Check if system inventory path exist.
28 [Tags] Verify_System_Inventory_Path
29 # When the host is booted, system inventory path should exist.
30 # Example: /xyz/openbmc_project/inventory/system
31 Get Inventory system
Chris Austenb29d2e82016-06-07 12:25:35 -050032
Rahul Maheshwaribb20f732016-10-24 06:27:14 -050033
George Keishing3d734312017-07-24 04:10:25 -050034Verify Boxelder Present Property
35 [Documentation] Boxelder should be present by default.
George Keishing01b59ac2017-11-24 10:43:58 -060036 [Tags] Verify_Boxelder_Present_Property
George Keishing3d734312017-07-24 04:10:25 -050037 # Example:
38 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/boxelder/bmc":
39 # {
40 # "BuildDate": "",
41 # "FieldReplaceable": 0,
42 # "Manufacturer": "IBM",
43 # "Model": "",
44 # "PartNumber": "01DH051",
45 # "Present": 1,
46 # "PrettyName": "BMC PLANAR ",
47 # "SerialNumber": "000000000000"
48 # },
49 ${json_data}= Get Inventory system/chassis/motherboard/boxelder/bmc
50 Should Be True ${json_data["data"]["Present"]}
George Keishing33dd4432017-09-13 01:48:26 -050051 Should Not Be Equal As Strings
52 ... ${json_data["data"]["SerialNumber"]} 000000000000
53 ... msg=BMC planar serial number invalid.
George Keishing3d734312017-07-24 04:10:25 -050054
55
56Verify Boxelder MAC Address Property Is Populated
57 [Documentation] Boxelder should be present by default.
58 [Tags] Verify_Boxelder_MAC_Address_Property_Is_Populated
59 # Example:
60 # /xyz/openbmc_project/inventory/system/chassis/motherboard/boxelder/bmc/ethernet
61 # {
62 # "FieldReplaceable": 0,
63 # "MACAddress": "00:00:00:00:00:00",
64 # "Present": 1,
65 # "PrettyName": ""
66 # }
67
68 ${json_data}= Get Inventory
69 ... system/chassis/motherboard/boxelder/bmc/ethernet
70 Should Be True ${json_data["data"]["Present"]}
71 Should Not Be Equal As Strings
72 ... ${json_data["data"]["MACAddress"]} 00:00:00:00:00:00
73
74 # eth0 Link encap:Ethernet HWaddr 70:E2:84:14:23:F9
75 ${mac_addr} ${stderr} ${rc}= BMC Execute Command
76 ... /sbin/ifconfig -a | grep HWaddr | awk -F'HWaddr ' '{print $2}'
77 ... return_stderr=True
78 Should Be Empty ${stderr}
Rahul Maheshwari844dbe72017-09-18 00:24:23 -050079 Should Be Equal As Strings ${json_data["data"]["MACAddress"]}
80 ... ${mac_addr.strip()} msg=MAC address configured incorrectly.
81 ... ignore_case=True
George Keishing3d734312017-07-24 04:10:25 -050082
83
George Keishingc8166ed2017-02-24 03:53:38 -060084Verify Chassis Motherboard Properties
85 [Documentation] Check if chassis motherboard properties are
86 ... populated valid.
87 [Tags] Verify_Chassis_Motherboard_Properties
88 # When the host is booted, the following properties should
89 # be populated Manufacturer, PartNumber, SerialNumber and
90 # it should not be zero's.
91 # Example:
92 # "data": {
93 # "/xyz/openbmc_project/inventory/system/chassis/motherboard": {
94 # "BuildDate": "",
95 # "Manufacturer": "0000000000000000",
96 # "Model": "",
97 # "PartNumber": "0000000",
98 # "Present": 0,
99 # "PrettyName": "SYSTEM PLANAR ",
100 # "SerialNumber": "000000000000"
101 # }
102 ${properties}= Get Inventory system/chassis/motherboard
103 Should Not Be Equal As Strings
George Keishingc8166ed2017-02-24 03:53:38 -0600104 ... ${properties["data"]["PartNumber"]} 0000000
105 ... msg=motherboard part number invalid.
106 Should Not Be Equal As Strings
107 ... ${properties["data"]["SerialNumber"]} 000000000000
108 ... msg=motherboard serial number invalid.
Chris Austenb29d2e82016-06-07 12:25:35 -0500109
George Keishingae355302017-03-13 04:34:58 -0500110Verify CPU Present
111 [Documentation] Check if the FRU "Present" is set for CPU's.
112 [Tags] Verify_CPU_Present
113 # System inventory cpu list:
114 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0
115 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1
116 # Example:
117 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0": {
118 # "FieldReplaceable": 1,
119 # "BuildDate": "",
120 # "Cached": 0,
121 # "SerialNumber": "YA3933741574",
122 # "Version": "10",
123 # "Model": "",
124 # "PrettyName": "PROCESSOR MODULE",
125 # "PartNumber": "01HL322",
126 # "Present": 1,
127 # "Manufacturer": "IBM"
128 # },
129 # The CPU properties "Present" should be boolean 1.
130
131 ${cpu_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system cpu
132 :FOR ${cpu_uri} IN @{cpu_list}
133 \ ${present}= Read Attribute ${cpu_uri} Present
134 \ Should Be True ${present}
135
136
137Verify DIMM Present
138 [Documentation] Check if the FRU "Present" is set for DIMM's.
139 [Tags] Verify_DIMM_Present
140 # Example:
141 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0": {
142 # "FieldReplaceable": 1,
143 # "BuildDate": "",
144 # "Cached": 0,
145 # "SerialNumber": "0x0300cf4f",
146 # "Version": "0x00",
147 # "Model": "M393A1G40EB1-CRC ",
148 # "PrettyName": "0x0c",
149 # "PartNumber": "",
150 # "Present": 1,
151 # "Manufacturer": "0xce80"
152 # },
153
154 # The DIMM properties "Present" should be boolean 1.
155
156 ${dimm_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system dimm
157 :FOR ${dimm_uri} IN @{dimm_list}
158 \ ${present}= Read Attribute ${dimm_uri} Present
159 \ Should Be True ${present}
160
161
George Keishingefa97352017-03-13 07:13:03 -0500162Verify FRU Properties
163 [Documentation] Verify the FRU properties fields.
164 [Tags] Verify_FRU_Properties
165 # Example:
166 # A FRU would have "FieldReplaceable" set to boolean 1 and should have
167 # the following entries
168 # "fru": [
169 # "FieldReplaceable"
170 # "BuildDate",
171 # "Cached"
172 # "SerialNumber",
173 # "Version",
174 # "Model",
175 # "PrettyName",
176 # "PartNumber",
177 # "Present",
178 # "Manufacturer",
179 # ]
180 # and FRU which doesn't have one of this fields is an error.
181 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0": {
182 # "FieldReplaceable": 1,
183 # "BuildDate": "",
184 # "Cached": 0,
185 # "SerialNumber": "0x0300cf4f",
186 # "Version": "0x00",
187 # "Model": "M393A1G40EB1-CRC ",
188 # "PrettyName": "0x0c",
189 # "PartNumber": "",
190 # "Present": 1,
191 # "Manufacturer": "0xce80"
192 # },
193
194 ${system_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system *
195 ${fru_list}= Qualified FRU List @{system_list}
196 Validate FRU Properties Fields @{fru_list}
197
George Keishing071d8da2017-03-24 09:13:16 -0500198
199Verify Core Functional State
200 [Documentation] Verify that "Present" core property is set if "Functional"
201 ... core property is set.
202 [Tags] Verify_Core_Functional_State
203 # Example:
204 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core5":{
205 # "Functional": 1,
206 # "Present": 1,
207 # "PrettyName": ""
208 # },
209 ${core_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system core
210 :FOR ${core_uri} IN @{core_list}
211 \ ${status}= Run Keyword And Return Status
212 ... Check URL Property If Functional ${core_uri}
George Keishingc5658392017-04-27 23:05:18 -0500213 \ Continue For Loop If '${status}' == '${False}'
George Keishing071d8da2017-03-24 09:13:16 -0500214 \ ${present}= Read Attribute ${core_uri} Present
215 \ Should Be True ${present}
216 ... msg=${core_uri} is functional but not present.
217
218
219Verify DIMM Functional State
220 [Documentation] Verify that "Present" DIMM property is set if "Functional"
221 ... DIMM property is set.
222 [Tags] Verify_DIMM_Functional_State
223 # Example:
224 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0": {
225 # "BuildDate": "",
226 # "Cached": 0,
227 # "FieldReplaceable": 1,
228 # "Functional": 1,
229 # "Manufacturer": "0xce80",
230 # "Model": "M393A1G40EB1-CRC ",
231 # "PartNumber": "",
232 # "Present": 1,
233 # "PrettyName": "0x0c",
234 # "SerialNumber": "0x0300cf4f",
235 # "Version": "0x00"
236 # },
237
238 ${dimm_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system dimm
239 :FOR ${dimm_uri} IN @{dimm_list}
240 \ ${status}= Run Keyword And Return Status
241 ... Check URL Property If Functional ${dimm_uri}
George Keishingc5658392017-04-27 23:05:18 -0500242 \ Continue For Loop If '${status}' == '${False}'
George Keishing071d8da2017-03-24 09:13:16 -0500243 \ ${present}= Read Attribute ${dimm_uri} Present
244 \ Should Be True ${present}
245 ... msg=${dimm_uri} is functional but not present.
246
George Keishing3c205b12017-05-13 04:09:33 -0500247
248Verify Fan Functional State
249 [Documentation] Verify that "Present" fan property is set if "Functional"
250 ... fan property is set.
251 [Tags] Verify_Fan_Functional_State
252 # Example:
253 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan0": {
254 # "Functional": 1,
255 # "Present": 1,
256 # "PrettyName": "fan0"
257 # },
258
259 ${fan_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system fan*
260 Should Not Be Empty ${fan_list}
261 :FOR ${fan_uri} IN @{fan_list}
262 \ ${status}= Run Keyword And Return Status
263 ... Check URL Property If Functional ${fan_uri}
264 \ Continue For Loop If '${status}' == '${False}'
265 \ ${present}= Read Attribute ${fan_uri} Present
266 \ Should Be True ${present}
267 ... msg=${fan_uri} is functional but "Present" is not set.
268
Sweta Potthuri56631f52017-11-10 02:19:38 -0600269Verify CPU Functional State
270 [Documentation] Verify that "Present" CPU property is set if "Functional"
271 ... CPU property is set.
272 [Tags] Verify_CPU_Functional_State
273
274 # Example of cpu* endpoint data:
275 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0": {
276 # "Functional": 1,
277 # "Present": 1,
278 # "PrettyName": "cpu0"
279 # },
280
281 ${cpu_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system cpu*
282 Should Not Be Empty ${cpu_list}
283 :FOR ${cpu_uri} IN @{cpu_list}
284 \ ${status}= Run Keyword And Return Status
285 ... Check URL Property If Functional ${cpu_uri}
286 \ Continue For Loop If '${status}' == '${False}'
287 \ ${present}= Read Attribute ${cpu_uri} Present
288 \ Should Be True ${present}
289 ... msg=${cpu_uri} is functional but "Present" is not set.
George Keishing3c205b12017-05-13 04:09:33 -0500290
George Keishing53a75f72017-11-17 12:50:30 -0600291
292Verify GPU Functional State
293 [Documentation] Verify that "Functional" GPU property is set if "Present"
294 ... GPU property is set
295 [Tags] Verify_GPU_Functional_State
296
297 # Example of gv* endpoint data:
298 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card4": {
299 # "Functional": 1,
300 # "Present": 1,
301 # "PrettyName": ""
302 # },
303
304
305 ${gpu_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system gv*
306 Should Not Be Empty ${gpu_list}
307 :FOR ${gpu_uri} IN @{gpu_list}
308 \ ${status}= Run Keyword And Return Status
309 ... Check URL Property If Functional ${gpu_uri}
310 \ Continue For Loop If '${status}' == '${False}'
311 \ ${present}= Read Attribute ${gpu_uri} Present
312 \ Should Be True ${present}
313 ... msg=${gpu_uri} is functional but "Present" is not set.
314
315
George Keishing04c6b2c2017-06-15 12:33:59 -0500316Check Air Or Water Cooled
317 [Documentation] Check if this system is Air or water cooled.
318 [Tags] Check_Air_Or_Water_Cooled
319 # Example:
320 # "/xyz/openbmc_project/inventory/system/chassis": {
321 # "AirCooled": 1,
322 # "WaterCooled": 0
323 # },
324
325 ${air_cooled}= Read Attribute
326 ... /xyz/openbmc_project/inventory/system/chassis AirCooled
327 Log AirCooled:${air_cooled}
328
329 ${water_cooled}= Read Attribute
330 ... /xyz/openbmc_project/inventory/system/chassis WaterCooled
331 Log WaterCooled:${water_cooled}
332
333 Run Keyword If ${air_cooled}==${0} and ${water_cooled}==${0}
334 ... Fail Neither AirCooled or WaterCooled.
335
Sweta Potthuri1a640de2017-07-18 11:09:59 -0500336Verify Minimal CPU Inventory
337 [Documentation] Verify minimal CPU inventory.
338 [Tags] Verify_Minimal_CPU_Inventory
339
340 # item minimum_count
341 cpu 1
342 [Template] Minimum Inventory
343
344Verify Minimal DIMM Inventory
345 [Documentation] Verify minimal DIMM inventory.
346 [Tags] Verify_Minimal_DIMM_Inventory
347
348 # item minimum_count
349 dimm 2
350 [Template] Minimum Inventory
351
352Verify Minimal Core Inventory
353 [Documentation] Verify minimal core inventory.
354 [Tags] Verify_Minimal_Core_Inventory
355
356 # item minimum_count
357 core 1
358 [Template] Minimum Inventory
359
360Verify Minimal Memory Buffer Inventory
361 [Documentation] Verify minimal memory buffer inventory.
362 [Tags] Verify_Minimal_Memory_Buffer_Inventory
363
364 # item minimum_count
365 memory_buffer 1
366 [Template] Minimum Inventory
367
368Verify Minimal Fan Inventory
369 [Documentation] Verify minimal fan inventory.
370 [Tags] Verify_Minimal_Fan_Inventory
371
372 # item minimum_count
373 fan 2
374 [Template] Minimum Inventory
375
376Verify Minimal Main Planar Inventory
377 [Documentation] Verify minimal main planar inventory.
378 [Tags] Verify_Minimal_Main_Planar_Inventory
379
380 # item minimum_count
381 main_planar 1
382 [Template] Minimum Inventory
383
384Verify Minimal System Inventory
385 [Documentation] Verify minimal system inventory.
386 [Tags] Verify_Minimal_System_Inventory
387
388 # item minimum_count
389 system 1
390 [Template] Minimum Inventory
George Keishing04c6b2c2017-06-15 12:33:59 -0500391
George Keishing03ebc292017-08-02 01:22:02 -0500392Verify Minimal Power Supply Inventory
393 [Documentation] Verify minimal power supply inventory.
394 [Tags] Verify_Minimal_Power_Supply_Inventory
395 # Example:
George Keishing1b71f222017-11-23 14:02:49 -0600396 # "/xyz/openbmc_project/inventory/system/chassis/powersupply0",
397 # "/xyz/openbmc_project/inventory/system/chassis/powersupply1",
George Keishing03ebc292017-08-02 01:22:02 -0500398
399 # item minimum_count
George Keishing1b71f222017-11-23 14:02:49 -0600400 powersupply 1
George Keishing03ebc292017-08-02 01:22:02 -0500401 [Template] Minimum Inventory
402
George Keishingfafbfdb2017-08-30 23:51:23 -0500403
404Verify Inventory List After Reboot
405 [Documentation] Verify inventory list after reboot.
406 [Tags] Verify_Inventory_List_After_Reboot
407
408 Repeat Keyword ${LOOP_COUNT} times Choose Boot Option reboot
409
410
411Verify Inventory List After Reset
412 [Documentation] Verify inventory list after reset.
413 [Tags] Verify_Inventory_List_After_Reset
414
415 Repeat Keyword ${LOOP_COUNT} times Choose Boot Option reset
416
Chris Austenb29d2e82016-06-07 12:25:35 -0500417*** Keywords ***
418
George Keishingc8166ed2017-02-24 03:53:38 -0600419Test Suite Setup
420 [Documentation] Do the initial suite setup.
George Keishing25577a22017-07-12 05:18:46 -0500421
Sweta Potthuriaf741cb2017-07-04 09:41:17 -0500422 # Boot Host.
423 REST Power On
George Keishingcaac9f32017-03-09 02:14:27 -0600424
George Keishingc8166ed2017-02-24 03:53:38 -0600425Get Inventory
426 [Documentation] Get the properties of an endpoint.
427 [Arguments] ${endpoint}
428 # Description of arguments:
429 # endpoint string for which url path ending.
430 # Example: "system" is the endpoint for url
431 # /xyz/openbmc_project/inventory/system
432 ${resp}= OpenBMC Get Request ${HOST_INVENTORY_URI}${endpoint}
433 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
434 ${jsondata}= To JSON ${resp.content}
435 [Return] ${jsondata}
George Keishingefa97352017-03-13 07:13:03 -0500436
437
438Qualified FRU List
439 [Documentation] Build the list of valid FRUs.
440 [Arguments] @{system_list}
441 # Description of arguments:
442 # system_list List of system inventory URLs.
443 # Example:
444 # /xyz/openbmc_project/inventory/system/chassis/motherboard
445 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0
446 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1
447 # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0
448 # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm1
449 # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm2
450 # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm3
451 # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm4
452 # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm5
453 # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm6
454 # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm7
455
456 ${fru_list}= Create List
457 :FOR ${fru_uri} IN @{system_list}
George Keishingdf5ab122017-04-17 04:01:11 -0500458 \ ${resp}= OpenBMC Get Request ${fru_uri}/attr/FieldReplaceable
459 \ ${jsondata}= To JSON ${resp.content}
460 \ ${status}= Run Keyword And Return Status
461 ... Should Be True ${jsondata['data']} == ${1}
George Keishingefa97352017-03-13 07:13:03 -0500462 \ Run Keyword If '${status}' == '${True}'
463 ... Append To List ${fru_list} ${fru_uri}
464
465 [Return] ${fru_list}
466
467
468Validate FRU Properties Fields
469 [Documentation] Compare valid FRUs from system vs expected FRU set.
470 [Arguments] @{fru_list}
471 # Description of arguments:
472 # fru_list List of qualified FRU URLs.
473
474 # Build the pre-defined set list from data/inventory.py derived from
475 # a group of YAML files.
476 # Example:
477 # set(['Version', 'PartNumber', 'SerialNumber', 'FieldReplaceable',
478 # 'BuildDate', 'Present', 'Manufacturer', 'PrettyName', 'Cached', 'Model'])
479 ${fru_set}= List To Set ${inventory_dict['fru']}
480
481 # Iterate through the FRU's url and compare the set dictionary keys
482 # with the pre-define inventory data.
483 :FOR ${fru_url_path} IN @{fru_list}
484 \ ${fru_field}= Read Properties ${fru_url_path}
485 # ------------------------------------------------------------
486 # ${fru_field.viewkeys()} extracts the list of keys from the
487 # JSON dictionary as a set.
488 # ------------------------------------------------------------
489 \ Should Be Equal ${fru_field.viewkeys()} ${fru_set}
490
George Keishing071d8da2017-03-24 09:13:16 -0500491
492Check URL Property If Functional
493 [Arguments] ${url_path}
494 # Description of arguments:
495 # url_path Full url path of the inventory object.
496 # Example: DIMM / core property url's
497 # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0
498 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core0
499 ${state}= Read Attribute ${url_path} Functional
500 Should Be True ${state}
Sweta Potthuri654cbc02017-06-15 10:10:55 -0500501
George Keishingfafbfdb2017-08-30 23:51:23 -0500502Choose Boot Option
503 [Documentation] Choose BMC reset or host reboot.
504 [Arguments] ${option}
Sweta Potthuri654cbc02017-06-15 10:10:55 -0500505
George Keishingfafbfdb2017-08-30 23:51:23 -0500506 Run Keyword If '${option}' == 'reboot'
507 ... Verify Inventory List Before And After Reboot
508 ... ELSE
509 ... Verify Inventory List Before And After Reset
510
511
512Verify Inventory List Before And After Reboot
513 [Documentation] Verify inventory list before and after reboot.
514
515 REST Power On
516 Delete Error Logs
517 ${inventory_before}= Get URL List ${HOST_INVENTORY_URI}
Sweta Potthuri654cbc02017-06-15 10:10:55 -0500518 Initiate Host Reboot
George Keishingf0680ee2017-08-19 15:22:53 -0500519 Wait Until Keyword Succeeds 10 min 10 sec Is OS Booted
George Keishingfafbfdb2017-08-30 23:51:23 -0500520 Delete Error Logs
521 ${inventory_after}= Get URL List ${HOST_INVENTORY_URI}
522 Lists Should Be Equal ${inventory_before} ${inventory_after}
523
524
525Verify Inventory List Before And After Reset
526 [Documentation] Verify inventory list before and after BMC reset.
527
528 REST Power On
529 Delete Error Logs
530 ${inventory_before}= Get URL List ${HOST_INVENTORY_URI}
531 OBMC Reboot (run)
532 Delete Error Logs
533 ${inventory_after}= Get URL List ${HOST_INVENTORY_URI}
534 Lists Should Be Equal ${inventory_before} ${inventory_after}
535
Sweta Potthuri1a640de2017-07-18 11:09:59 -0500536
537Minimum Inventory
538 [Documentation] Check for minimum inventory.
539 [Arguments] ${item} ${minimum_count}
540
541 # Description of argument(s):
542 # item Inventory name (example: "fan/cpu/dimm/etc").
543 # minimum_count The minimum number of the given item.
544
545 ${count}= Get Number Hardware Items ${item}
546 Should Be True ${count}>=${minimum_count}
547
548Get Number Hardware Items
549 [Documentation] Get the count of the total present currently on inventory.
550 [Arguments] ${item}
551
552 # Description of argument(s):
553 # item Inventory name (example: "fan/cpu/dimm/etc").
554
555 ${count_inventory} Set Variable ${0}
556 ${list}= Get Endpoint Paths ${HOST_INVENTORY_URI}/system/
557 ... ${item}
558
559 : FOR ${element} IN @{list}
560 \ ${present}= Read Properties ${element}
561 \ ${count_inventory}= Set Variable if ${present['Present']} == 1
562 \ ... ${count_inventory+1} ${count_inventory}
563 [return] ${count_inventory}