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