blob: 933fa98400198c8b90cfb519673d5af5654f9b21 [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
39 ${count} = Get Total Present FAN
40 Should Be True ${count}>${2}
41
42minimal main planar inventory
43 ${count} = Get Total Present MAIN_PLANAR
44 Should Be True ${count}>${0}
45
46minimal system inventory
47 ${count} = Get Total Present SYSTEM
48 Should Be True ${count}>${0}
49
50Verify CPU VPD Properties
51 Verify Properties CPU
52
53Verify DIMM VPD Properties
54 Verify Properties DIMM
55
56Verify Memory Buffer VPD Properties
57 Verify Properties MEMORY_BUFFER
58
59Verify Fan VPD Properties
60 Verify Properties FAN
61
62Verify System VPD Properties
63 Verify Properties SYSTEM
64
65
66*** Keywords ***
67
68Setup The Suite
George Keishing1d5ec742016-09-02 05:29:14 -050069 BMC Power On
Chris Austenb29d2e82016-06-07 12:25:35 -050070
71 @{ret} = Get Inventory List ${OPENBMC_MODEL}
72 Set Suite Variable @{sys_inv} @{ret}
73 ${resp} = Read Properties /org/openbmc/inventory/enumerate
74 Set Suite Variable ${SYSTEM_INFO} ${resp}
75 log Dictionary ${resp}
76
77Get Total Present
78 [arguments] ${type}
79
80 ${l} = Create List []
81 ${list} = Get Inventory Fru Type List ${OPENBMC_MODEL} ${type}
82 : FOR ${element} IN @{list}
83 \ Append To List ${l} ${SYSTEM_INFO['${element}']['present']}
84
85 ${sum} = Get Count ${l} True
86 [return] ${sum}
87
88Verify Properties
89 [arguments] ${type}
90
91 ${list} = Get VPD Inventory List ${OPENBMC_MODEL} ${type}
92 : FOR ${element} IN @{list}
93 \ ${d} = Get From Dictionary ${SYSTEM_INFO} ${element}
94 \ Run Keyword If ${d['present']} == True Verify Present Properties ${d} ${type}
95
96Verify Present Properties
97 [arguments] ${d} ${type}
98 ${keys} = Get Dictionary Keys ${d}
99 Log List ${keys}
100 Log List ${INVENTORY_ITEMS['${type}']}
101 Lists Should Be Equal ${INVENTORY_ITEMS['${type}']} ${keys}