blob: e851931f4adf93eac5181706a790622174e0ae10 [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
6Library ../lib/utilities.py
7Library String
8Library Collections
9
10Variables ../data/variables.py
11
12
13Suite setup setup the suite
14
causten147f5752016-08-11 16:24:45 -050015Force Tags chassisboot
Chris Austenb29d2e82016-06-07 12:25:35 -050016
17*** Test Cases ***
18
19minimal cpu inventory
20 ${count} = Get Total Present CPU
21 Should Be True ${count}>${0}
22
23minimal dimm inventory
24 ${count} = Get Total Present DIMM
25 Should Be True ${count}>=${2}
26
27minimal core inventory
28 ${count} = Get Total Present CORE
29 Should Be True ${count}>${0}
30
31minimal memory buffer inventory
32 ${count} = Get Total Present MEMORY_BUFFER
33 Should Be True ${count}>${0}
34
35minimal fan inventory
36 ${count} = Get Total Present FAN
37 Should Be True ${count}>${2}
38
39minimal main planar inventory
40 ${count} = Get Total Present MAIN_PLANAR
41 Should Be True ${count}>${0}
42
43minimal system inventory
44 ${count} = Get Total Present SYSTEM
45 Should Be True ${count}>${0}
46
47Verify CPU VPD Properties
48 Verify Properties CPU
49
50Verify DIMM VPD Properties
51 Verify Properties DIMM
52
53Verify Memory Buffer VPD Properties
54 Verify Properties MEMORY_BUFFER
55
56Verify Fan VPD Properties
57 Verify Properties FAN
58
59Verify System VPD Properties
60 Verify Properties SYSTEM
61
62
63*** Keywords ***
64
65Setup The Suite
root442f0ef2016-08-04 20:23:05 +000066 Initiate Power On
Chris Austenb29d2e82016-06-07 12:25:35 -050067
68 @{ret} = Get Inventory List ${OPENBMC_MODEL}
69 Set Suite Variable @{sys_inv} @{ret}
70 ${resp} = Read Properties /org/openbmc/inventory/enumerate
71 Set Suite Variable ${SYSTEM_INFO} ${resp}
72 log Dictionary ${resp}
73
74Get Total Present
75 [arguments] ${type}
76
77 ${l} = Create List []
78 ${list} = Get Inventory Fru Type List ${OPENBMC_MODEL} ${type}
79 : FOR ${element} IN @{list}
80 \ Append To List ${l} ${SYSTEM_INFO['${element}']['present']}
81
82 ${sum} = Get Count ${l} True
83 [return] ${sum}
84
85Verify Properties
86 [arguments] ${type}
87
88 ${list} = Get VPD Inventory List ${OPENBMC_MODEL} ${type}
89 : FOR ${element} IN @{list}
90 \ ${d} = Get From Dictionary ${SYSTEM_INFO} ${element}
91 \ Run Keyword If ${d['present']} == True Verify Present Properties ${d} ${type}
92
93Verify Present Properties
94 [arguments] ${d} ${type}
95 ${keys} = Get Dictionary Keys ${d}
96 Log List ${keys}
97 Log List ${INVENTORY_ITEMS['${type}']}
98 Lists Should Be Equal ${INVENTORY_ITEMS['${type}']} ${keys}