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