blob: 91dc35cb04b5336158ad4de9737efe658462120c [file] [log] [blame]
Chris Austenb29d2e82016-06-07 12:25:35 -05001*** Settings ***
2Documentation This testsuite is for testing inventory
3Suite Teardown Delete All Sessions
4Resource ../lib/rest_client.robot
5Resource ../lib/utils.robot
George Keishingd55a4be2016-08-26 03:28:17 -05006Resource ../lib/openbmc_ffdc.robot
George Keishing1d5ec742016-09-02 05:29:14 -05007Resource ../lib/boot/boot_resource_master.robot
Chris Austenb29d2e82016-06-07 12:25:35 -05008Library ../lib/utilities.py
9Library String
10Library Collections
George Keishingd55a4be2016-08-26 03:28:17 -050011Test Teardown Log FFDC
Chris Austenb29d2e82016-06-07 12:25:35 -050012
13Variables ../data/variables.py
14
15
16Suite setup setup the suite
17
causten147f5752016-08-11 16:24:45 -050018Force Tags chassisboot
Chris Austenb29d2e82016-06-07 12:25:35 -050019
20*** Test Cases ***
21
22minimal cpu inventory
23 ${count} = Get Total Present CPU
24 Should Be True ${count}>${0}
25
26minimal dimm inventory
27 ${count} = Get Total Present DIMM
28 Should Be True ${count}>=${2}
29
30minimal core inventory
31 ${count} = Get Total Present CORE
32 Should Be True ${count}>${0}
33
34minimal memory buffer inventory
35 ${count} = Get Total Present MEMORY_BUFFER
36 Should Be True ${count}>${0}
37
38minimal fan inventory
George Keishing8c0a4e52016-09-27 11:21:50 -050039 [Tags] minimal_fan_inventory
Chris Austenb29d2e82016-06-07 12:25:35 -050040 ${count} = Get Total Present FAN
41 Should Be True ${count}>${2}
42
43minimal main planar inventory
44 ${count} = Get Total Present MAIN_PLANAR
45 Should Be True ${count}>${0}
46
47minimal system inventory
48 ${count} = Get Total Present SYSTEM
49 Should Be True ${count}>${0}
50
51Verify CPU VPD Properties
52 Verify Properties CPU
53
54Verify DIMM VPD Properties
55 Verify Properties DIMM
56
57Verify Memory Buffer VPD Properties
58 Verify Properties MEMORY_BUFFER
59
60Verify Fan VPD Properties
61 Verify Properties FAN
62
63Verify System VPD Properties
George Keishing8c0a4e52016-09-27 11:21:50 -050064 [Tags] Verify_System_VPD_Properties
Chris Austenb29d2e82016-06-07 12:25:35 -050065 Verify Properties SYSTEM
66
67
68*** Keywords ***
69
70Setup The Suite
George Keishing1d5ec742016-09-02 05:29:14 -050071 BMC Power On
Chris Austenb29d2e82016-06-07 12:25:35 -050072
73 @{ret} = Get Inventory List ${OPENBMC_MODEL}
74 Set Suite Variable @{sys_inv} @{ret}
75 ${resp} = Read Properties /org/openbmc/inventory/enumerate
76 Set Suite Variable ${SYSTEM_INFO} ${resp}
77 log Dictionary ${resp}
78
79Get Total Present
80 [arguments] ${type}
81
82 ${l} = Create List []
83 ${list} = Get Inventory Fru Type List ${OPENBMC_MODEL} ${type}
84 : FOR ${element} IN @{list}
85 \ Append To List ${l} ${SYSTEM_INFO['${element}']['present']}
86
87 ${sum} = Get Count ${l} True
88 [return] ${sum}
89
90Verify Properties
91 [arguments] ${type}
92
93 ${list} = Get VPD Inventory List ${OPENBMC_MODEL} ${type}
94 : FOR ${element} IN @{list}
95 \ ${d} = Get From Dictionary ${SYSTEM_INFO} ${element}
96 \ Run Keyword If ${d['present']} == True Verify Present Properties ${d} ${type}
97
98Verify Present Properties
99 [arguments] ${d} ${type}
100 ${keys} = Get Dictionary Keys ${d}
101 Log List ${keys}
102 Log List ${INVENTORY_ITEMS['${type}']}
103 Lists Should Be Equal ${INVENTORY_ITEMS['${type}']} ${keys}