blob: 08ed746cc00e8fb28abe65a269ffbee0f5046940 [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
George Keishinge4e1d272017-11-24 06:05:21 -060056Verify UUID Entry
57 [Documentation] UUID entry should exist in BMC planar property.
58 [Tags] Verify_UUID_Entry
59 # Example:
60 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/boxelder/bmc":
61 # {
62 # "BuildDate": "",
63 # "FieldReplaceable": 0,
64 # "Manufacturer": "IBM",
65 # "Model": "",
66 # "PartNumber": "01DH051",
67 # "Present": 1,
68 # "PrettyName": "BMC PLANAR ",
69 # "SerialNumber": "000000000000"
70 # "UUID": ""
71 # },
72 ${json_data}= Get Inventory system/chassis/motherboard/boxelder/bmc
73 Should Not Be Empty ${json_data["data"]["UUID"]}
74
75
George Keishing3d734312017-07-24 04:10:25 -050076Verify Boxelder MAC Address Property Is Populated
77 [Documentation] Boxelder should be present by default.
78 [Tags] Verify_Boxelder_MAC_Address_Property_Is_Populated
79 # Example:
80 # /xyz/openbmc_project/inventory/system/chassis/motherboard/boxelder/bmc/ethernet
81 # {
82 # "FieldReplaceable": 0,
83 # "MACAddress": "00:00:00:00:00:00",
84 # "Present": 1,
85 # "PrettyName": ""
86 # }
87
88 ${json_data}= Get Inventory
89 ... system/chassis/motherboard/boxelder/bmc/ethernet
90 Should Be True ${json_data["data"]["Present"]}
91 Should Not Be Equal As Strings
92 ... ${json_data["data"]["MACAddress"]} 00:00:00:00:00:00
93
94 # eth0 Link encap:Ethernet HWaddr 70:E2:84:14:23:F9
95 ${mac_addr} ${stderr} ${rc}= BMC Execute Command
96 ... /sbin/ifconfig -a | grep HWaddr | awk -F'HWaddr ' '{print $2}'
97 ... return_stderr=True
98 Should Be Empty ${stderr}
Rahul Maheshwari844dbe72017-09-18 00:24:23 -050099 Should Be Equal As Strings ${json_data["data"]["MACAddress"]}
100 ... ${mac_addr.strip()} msg=MAC address configured incorrectly.
101 ... ignore_case=True
George Keishing3d734312017-07-24 04:10:25 -0500102
103
George Keishingc8166ed2017-02-24 03:53:38 -0600104Verify Chassis Motherboard Properties
105 [Documentation] Check if chassis motherboard properties are
106 ... populated valid.
107 [Tags] Verify_Chassis_Motherboard_Properties
108 # When the host is booted, the following properties should
109 # be populated Manufacturer, PartNumber, SerialNumber and
110 # it should not be zero's.
111 # Example:
112 # "data": {
113 # "/xyz/openbmc_project/inventory/system/chassis/motherboard": {
114 # "BuildDate": "",
115 # "Manufacturer": "0000000000000000",
116 # "Model": "",
117 # "PartNumber": "0000000",
118 # "Present": 0,
119 # "PrettyName": "SYSTEM PLANAR ",
120 # "SerialNumber": "000000000000"
121 # }
122 ${properties}= Get Inventory system/chassis/motherboard
123 Should Not Be Equal As Strings
George Keishingc8166ed2017-02-24 03:53:38 -0600124 ... ${properties["data"]["PartNumber"]} 0000000
125 ... msg=motherboard part number invalid.
126 Should Not Be Equal As Strings
127 ... ${properties["data"]["SerialNumber"]} 000000000000
128 ... msg=motherboard serial number invalid.
Chris Austenb29d2e82016-06-07 12:25:35 -0500129
George Keishingae355302017-03-13 04:34:58 -0500130Verify CPU Present
131 [Documentation] Check if the FRU "Present" is set for CPU's.
132 [Tags] Verify_CPU_Present
133 # System inventory cpu list:
134 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0
135 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1
136 # Example:
137 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0": {
138 # "FieldReplaceable": 1,
139 # "BuildDate": "",
140 # "Cached": 0,
141 # "SerialNumber": "YA3933741574",
142 # "Version": "10",
143 # "Model": "",
144 # "PrettyName": "PROCESSOR MODULE",
145 # "PartNumber": "01HL322",
146 # "Present": 1,
147 # "Manufacturer": "IBM"
148 # },
149 # The CPU properties "Present" should be boolean 1.
150
151 ${cpu_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system cpu
152 :FOR ${cpu_uri} IN @{cpu_list}
153 \ ${present}= Read Attribute ${cpu_uri} Present
154 \ Should Be True ${present}
155
156
157Verify DIMM Present
158 [Documentation] Check if the FRU "Present" is set for DIMM's.
159 [Tags] Verify_DIMM_Present
160 # Example:
161 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0": {
162 # "FieldReplaceable": 1,
163 # "BuildDate": "",
164 # "Cached": 0,
165 # "SerialNumber": "0x0300cf4f",
166 # "Version": "0x00",
167 # "Model": "M393A1G40EB1-CRC ",
168 # "PrettyName": "0x0c",
169 # "PartNumber": "",
170 # "Present": 1,
171 # "Manufacturer": "0xce80"
172 # },
173
174 # The DIMM properties "Present" should be boolean 1.
175
176 ${dimm_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system dimm
177 :FOR ${dimm_uri} IN @{dimm_list}
178 \ ${present}= Read Attribute ${dimm_uri} Present
179 \ Should Be True ${present}
180
181
George Keishingefa97352017-03-13 07:13:03 -0500182Verify FRU Properties
183 [Documentation] Verify the FRU properties fields.
184 [Tags] Verify_FRU_Properties
185 # Example:
186 # A FRU would have "FieldReplaceable" set to boolean 1 and should have
187 # the following entries
188 # "fru": [
189 # "FieldReplaceable"
190 # "BuildDate",
191 # "Cached"
192 # "SerialNumber",
193 # "Version",
194 # "Model",
195 # "PrettyName",
196 # "PartNumber",
197 # "Present",
198 # "Manufacturer",
199 # ]
200 # and FRU which doesn't have one of this fields is an error.
201 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0": {
202 # "FieldReplaceable": 1,
203 # "BuildDate": "",
204 # "Cached": 0,
205 # "SerialNumber": "0x0300cf4f",
206 # "Version": "0x00",
207 # "Model": "M393A1G40EB1-CRC ",
208 # "PrettyName": "0x0c",
209 # "PartNumber": "",
210 # "Present": 1,
211 # "Manufacturer": "0xce80"
212 # },
213
214 ${system_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system *
215 ${fru_list}= Qualified FRU List @{system_list}
216 Validate FRU Properties Fields @{fru_list}
217
George Keishing071d8da2017-03-24 09:13:16 -0500218
219Verify Core Functional State
220 [Documentation] Verify that "Present" core property is set if "Functional"
221 ... core property is set.
222 [Tags] Verify_Core_Functional_State
223 # Example:
224 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core5":{
225 # "Functional": 1,
226 # "Present": 1,
227 # "PrettyName": ""
228 # },
229 ${core_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system core
230 :FOR ${core_uri} IN @{core_list}
231 \ ${status}= Run Keyword And Return Status
232 ... Check URL Property If Functional ${core_uri}
George Keishingc5658392017-04-27 23:05:18 -0500233 \ Continue For Loop If '${status}' == '${False}'
George Keishing071d8da2017-03-24 09:13:16 -0500234 \ ${present}= Read Attribute ${core_uri} Present
235 \ Should Be True ${present}
236 ... msg=${core_uri} is functional but not present.
237
238
239Verify DIMM Functional State
240 [Documentation] Verify that "Present" DIMM property is set if "Functional"
241 ... DIMM property is set.
242 [Tags] Verify_DIMM_Functional_State
243 # Example:
244 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0": {
245 # "BuildDate": "",
246 # "Cached": 0,
247 # "FieldReplaceable": 1,
248 # "Functional": 1,
249 # "Manufacturer": "0xce80",
250 # "Model": "M393A1G40EB1-CRC ",
251 # "PartNumber": "",
252 # "Present": 1,
253 # "PrettyName": "0x0c",
254 # "SerialNumber": "0x0300cf4f",
255 # "Version": "0x00"
256 # },
257
258 ${dimm_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system dimm
259 :FOR ${dimm_uri} IN @{dimm_list}
260 \ ${status}= Run Keyword And Return Status
261 ... Check URL Property If Functional ${dimm_uri}
George Keishingc5658392017-04-27 23:05:18 -0500262 \ Continue For Loop If '${status}' == '${False}'
George Keishing071d8da2017-03-24 09:13:16 -0500263 \ ${present}= Read Attribute ${dimm_uri} Present
264 \ Should Be True ${present}
265 ... msg=${dimm_uri} is functional but not present.
266
George Keishing3c205b12017-05-13 04:09:33 -0500267
268Verify Fan Functional State
269 [Documentation] Verify that "Present" fan property is set if "Functional"
270 ... fan property is set.
271 [Tags] Verify_Fan_Functional_State
272 # Example:
273 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan0": {
274 # "Functional": 1,
275 # "Present": 1,
276 # "PrettyName": "fan0"
277 # },
278
279 ${fan_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system fan*
280 Should Not Be Empty ${fan_list}
281 :FOR ${fan_uri} IN @{fan_list}
282 \ ${status}= Run Keyword And Return Status
283 ... Check URL Property If Functional ${fan_uri}
284 \ Continue For Loop If '${status}' == '${False}'
285 \ ${present}= Read Attribute ${fan_uri} Present
286 \ Should Be True ${present}
287 ... msg=${fan_uri} is functional but "Present" is not set.
288
Sweta Potthuri56631f52017-11-10 02:19:38 -0600289Verify CPU Functional State
290 [Documentation] Verify that "Present" CPU property is set if "Functional"
291 ... CPU property is set.
292 [Tags] Verify_CPU_Functional_State
293
294 # Example of cpu* endpoint data:
295 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0": {
296 # "Functional": 1,
297 # "Present": 1,
298 # "PrettyName": "cpu0"
299 # },
300
301 ${cpu_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system cpu*
302 Should Not Be Empty ${cpu_list}
303 :FOR ${cpu_uri} IN @{cpu_list}
304 \ ${status}= Run Keyword And Return Status
305 ... Check URL Property If Functional ${cpu_uri}
306 \ Continue For Loop If '${status}' == '${False}'
307 \ ${present}= Read Attribute ${cpu_uri} Present
308 \ Should Be True ${present}
309 ... msg=${cpu_uri} is functional but "Present" is not set.
George Keishing3c205b12017-05-13 04:09:33 -0500310
George Keishing53a75f72017-11-17 12:50:30 -0600311
312Verify GPU Functional State
313 [Documentation] Verify that "Functional" GPU property is set if "Present"
314 ... GPU property is set
315 [Tags] Verify_GPU_Functional_State
316
317 # Example of gv* endpoint data:
318 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card4": {
319 # "Functional": 1,
320 # "Present": 1,
321 # "PrettyName": ""
322 # },
323
324
325 ${gpu_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system gv*
326 Should Not Be Empty ${gpu_list}
327 :FOR ${gpu_uri} IN @{gpu_list}
328 \ ${status}= Run Keyword And Return Status
329 ... Check URL Property If Functional ${gpu_uri}
330 \ Continue For Loop If '${status}' == '${False}'
331 \ ${present}= Read Attribute ${gpu_uri} Present
332 \ Should Be True ${present}
333 ... msg=${gpu_uri} is functional but "Present" is not set.
334
335
George Keishing04c6b2c2017-06-15 12:33:59 -0500336Check Air Or Water Cooled
337 [Documentation] Check if this system is Air or water cooled.
338 [Tags] Check_Air_Or_Water_Cooled
339 # Example:
340 # "/xyz/openbmc_project/inventory/system/chassis": {
341 # "AirCooled": 1,
342 # "WaterCooled": 0
343 # },
344
345 ${air_cooled}= Read Attribute
346 ... /xyz/openbmc_project/inventory/system/chassis AirCooled
347 Log AirCooled:${air_cooled}
348
349 ${water_cooled}= Read Attribute
350 ... /xyz/openbmc_project/inventory/system/chassis WaterCooled
351 Log WaterCooled:${water_cooled}
352
353 Run Keyword If ${air_cooled}==${0} and ${water_cooled}==${0}
354 ... Fail Neither AirCooled or WaterCooled.
355
Sweta Potthuri1a640de2017-07-18 11:09:59 -0500356Verify Minimal CPU Inventory
357 [Documentation] Verify minimal CPU inventory.
358 [Tags] Verify_Minimal_CPU_Inventory
359
360 # item minimum_count
361 cpu 1
362 [Template] Minimum Inventory
363
364Verify Minimal DIMM Inventory
365 [Documentation] Verify minimal DIMM inventory.
366 [Tags] Verify_Minimal_DIMM_Inventory
367
368 # item minimum_count
369 dimm 2
370 [Template] Minimum Inventory
371
372Verify Minimal Core Inventory
373 [Documentation] Verify minimal core inventory.
374 [Tags] Verify_Minimal_Core_Inventory
375
376 # item minimum_count
377 core 1
378 [Template] Minimum Inventory
379
380Verify Minimal Memory Buffer Inventory
381 [Documentation] Verify minimal memory buffer inventory.
382 [Tags] Verify_Minimal_Memory_Buffer_Inventory
383
384 # item minimum_count
385 memory_buffer 1
386 [Template] Minimum Inventory
387
388Verify Minimal Fan Inventory
389 [Documentation] Verify minimal fan inventory.
390 [Tags] Verify_Minimal_Fan_Inventory
391
392 # item minimum_count
393 fan 2
394 [Template] Minimum Inventory
395
396Verify Minimal Main Planar Inventory
397 [Documentation] Verify minimal main planar inventory.
398 [Tags] Verify_Minimal_Main_Planar_Inventory
399
400 # item minimum_count
401 main_planar 1
402 [Template] Minimum Inventory
403
404Verify Minimal System Inventory
405 [Documentation] Verify minimal system inventory.
406 [Tags] Verify_Minimal_System_Inventory
407
408 # item minimum_count
409 system 1
410 [Template] Minimum Inventory
George Keishing04c6b2c2017-06-15 12:33:59 -0500411
George Keishing03ebc292017-08-02 01:22:02 -0500412Verify Minimal Power Supply Inventory
413 [Documentation] Verify minimal power supply inventory.
414 [Tags] Verify_Minimal_Power_Supply_Inventory
415 # Example:
George Keishing1b71f222017-11-23 14:02:49 -0600416 # "/xyz/openbmc_project/inventory/system/chassis/powersupply0",
417 # "/xyz/openbmc_project/inventory/system/chassis/powersupply1",
George Keishing03ebc292017-08-02 01:22:02 -0500418
419 # item minimum_count
George Keishing1b71f222017-11-23 14:02:49 -0600420 powersupply 1
George Keishing03ebc292017-08-02 01:22:02 -0500421 [Template] Minimum Inventory
422
George Keishingfafbfdb2017-08-30 23:51:23 -0500423
424Verify Inventory List After Reboot
425 [Documentation] Verify inventory list after reboot.
426 [Tags] Verify_Inventory_List_After_Reboot
427
428 Repeat Keyword ${LOOP_COUNT} times Choose Boot Option reboot
429
430
431Verify Inventory List After Reset
432 [Documentation] Verify inventory list after reset.
433 [Tags] Verify_Inventory_List_After_Reset
434
435 Repeat Keyword ${LOOP_COUNT} times Choose Boot Option reset
436
Chris Austenb29d2e82016-06-07 12:25:35 -0500437*** Keywords ***
438
George Keishingc8166ed2017-02-24 03:53:38 -0600439Test Suite Setup
440 [Documentation] Do the initial suite setup.
George Keishing25577a22017-07-12 05:18:46 -0500441
Sweta Potthuriaf741cb2017-07-04 09:41:17 -0500442 # Boot Host.
443 REST Power On
George Keishingcaac9f32017-03-09 02:14:27 -0600444
George Keishingc8166ed2017-02-24 03:53:38 -0600445Get Inventory
446 [Documentation] Get the properties of an endpoint.
447 [Arguments] ${endpoint}
448 # Description of arguments:
449 # endpoint string for which url path ending.
450 # Example: "system" is the endpoint for url
451 # /xyz/openbmc_project/inventory/system
452 ${resp}= OpenBMC Get Request ${HOST_INVENTORY_URI}${endpoint}
453 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
454 ${jsondata}= To JSON ${resp.content}
455 [Return] ${jsondata}
George Keishingefa97352017-03-13 07:13:03 -0500456
457
458Qualified FRU List
459 [Documentation] Build the list of valid FRUs.
460 [Arguments] @{system_list}
461 # Description of arguments:
462 # system_list List of system inventory URLs.
463 # Example:
464 # /xyz/openbmc_project/inventory/system/chassis/motherboard
465 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0
466 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1
467 # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0
468 # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm1
469 # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm2
470 # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm3
471 # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm4
472 # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm5
473 # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm6
474 # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm7
475
476 ${fru_list}= Create List
477 :FOR ${fru_uri} IN @{system_list}
George Keishingdf5ab122017-04-17 04:01:11 -0500478 \ ${resp}= OpenBMC Get Request ${fru_uri}/attr/FieldReplaceable
479 \ ${jsondata}= To JSON ${resp.content}
480 \ ${status}= Run Keyword And Return Status
481 ... Should Be True ${jsondata['data']} == ${1}
George Keishingefa97352017-03-13 07:13:03 -0500482 \ Run Keyword If '${status}' == '${True}'
483 ... Append To List ${fru_list} ${fru_uri}
484
485 [Return] ${fru_list}
486
487
488Validate FRU Properties Fields
489 [Documentation] Compare valid FRUs from system vs expected FRU set.
490 [Arguments] @{fru_list}
491 # Description of arguments:
492 # fru_list List of qualified FRU URLs.
493
494 # Build the pre-defined set list from data/inventory.py derived from
495 # a group of YAML files.
496 # Example:
497 # set(['Version', 'PartNumber', 'SerialNumber', 'FieldReplaceable',
498 # 'BuildDate', 'Present', 'Manufacturer', 'PrettyName', 'Cached', 'Model'])
499 ${fru_set}= List To Set ${inventory_dict['fru']}
500
501 # Iterate through the FRU's url and compare the set dictionary keys
502 # with the pre-define inventory data.
503 :FOR ${fru_url_path} IN @{fru_list}
504 \ ${fru_field}= Read Properties ${fru_url_path}
505 # ------------------------------------------------------------
506 # ${fru_field.viewkeys()} extracts the list of keys from the
507 # JSON dictionary as a set.
508 # ------------------------------------------------------------
509 \ Should Be Equal ${fru_field.viewkeys()} ${fru_set}
510
George Keishing071d8da2017-03-24 09:13:16 -0500511
512Check URL Property If Functional
513 [Arguments] ${url_path}
514 # Description of arguments:
515 # url_path Full url path of the inventory object.
516 # Example: DIMM / core property url's
517 # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0
518 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core0
519 ${state}= Read Attribute ${url_path} Functional
520 Should Be True ${state}
Sweta Potthuri654cbc02017-06-15 10:10:55 -0500521
George Keishingfafbfdb2017-08-30 23:51:23 -0500522Choose Boot Option
523 [Documentation] Choose BMC reset or host reboot.
524 [Arguments] ${option}
Sweta Potthuri654cbc02017-06-15 10:10:55 -0500525
George Keishingfafbfdb2017-08-30 23:51:23 -0500526 Run Keyword If '${option}' == 'reboot'
527 ... Verify Inventory List Before And After Reboot
528 ... ELSE
529 ... Verify Inventory List Before And After Reset
530
531
532Verify Inventory List Before And After Reboot
533 [Documentation] Verify inventory list before and after reboot.
534
535 REST Power On
536 Delete Error Logs
537 ${inventory_before}= Get URL List ${HOST_INVENTORY_URI}
Sweta Potthuri654cbc02017-06-15 10:10:55 -0500538 Initiate Host Reboot
George Keishingf0680ee2017-08-19 15:22:53 -0500539 Wait Until Keyword Succeeds 10 min 10 sec Is OS Booted
George Keishingfafbfdb2017-08-30 23:51:23 -0500540 Delete Error Logs
541 ${inventory_after}= Get URL List ${HOST_INVENTORY_URI}
542 Lists Should Be Equal ${inventory_before} ${inventory_after}
543
544
545Verify Inventory List Before And After Reset
546 [Documentation] Verify inventory list before and after BMC reset.
547
548 REST Power On
549 Delete Error Logs
550 ${inventory_before}= Get URL List ${HOST_INVENTORY_URI}
551 OBMC Reboot (run)
552 Delete Error Logs
553 ${inventory_after}= Get URL List ${HOST_INVENTORY_URI}
554 Lists Should Be Equal ${inventory_before} ${inventory_after}
555
Sweta Potthuri1a640de2017-07-18 11:09:59 -0500556
557Minimum Inventory
558 [Documentation] Check for minimum inventory.
559 [Arguments] ${item} ${minimum_count}
560
561 # Description of argument(s):
562 # item Inventory name (example: "fan/cpu/dimm/etc").
563 # minimum_count The minimum number of the given item.
564
565 ${count}= Get Number Hardware Items ${item}
566 Should Be True ${count}>=${minimum_count}
567
568Get Number Hardware Items
569 [Documentation] Get the count of the total present currently on inventory.
570 [Arguments] ${item}
571
572 # Description of argument(s):
573 # item Inventory name (example: "fan/cpu/dimm/etc").
574
575 ${count_inventory} Set Variable ${0}
576 ${list}= Get Endpoint Paths ${HOST_INVENTORY_URI}/system/
577 ... ${item}
578
579 : FOR ${element} IN @{list}
580 \ ${present}= Read Properties ${element}
581 \ ${count_inventory}= Set Variable if ${present['Present']} == 1
582 \ ... ${count_inventory+1} ${count_inventory}
583 [return] ${count_inventory}