blob: d00763834d316b1253f7bf2bb16d950b61b3ee9c [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
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050016Suite setup setup the suite
Chris Austenb29d2e82016-06-07 12:25:35 -050017
causten147f5752016-08-11 16:24:45 -050018Force Tags chassisboot
Chris Austenb29d2e82016-06-07 12:25:35 -050019
20*** Test Cases ***
21
22minimal cpu inventory
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050023 ${count} = Get Total Present cpu
24 Should Be True ${count}>${0}
Chris Austenb29d2e82016-06-07 12:25:35 -050025
26minimal dimm inventory
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050027 ${count} = Get Total Present dimm
28 Should Be True ${count}>=${2}
Chris Austenb29d2e82016-06-07 12:25:35 -050029
30minimal core inventory
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050031 ${count} = Get Total Present core
32 Should Be True ${count}>${0}
Chris Austenb29d2e82016-06-07 12:25:35 -050033
34minimal memory buffer inventory
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050035 ${count} = Get Total Present membuf
36 Should Be True ${count}>${0}
Chris Austenb29d2e82016-06-07 12:25:35 -050037
38minimal fan inventory
George Keishing8c0a4e52016-09-27 11:21:50 -050039 [Tags] minimal_fan_inventory
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050040 ${count} = Get Total Present fan
41 Should Be True ${count}>${2}
Chris Austenb29d2e82016-06-07 12:25:35 -050042
43minimal main planar inventory
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050044 ${count} = Get Total Present motherboard
45 Should Be True ${count}>${0}
Chris Austenb29d2e82016-06-07 12:25:35 -050046
47minimal system inventory
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050048 ${count} = Get Total Present system
49 Should Be True ${count}>${0}
Chris Austenb29d2e82016-06-07 12:25:35 -050050
51Verify CPU VPD Properties
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050052 Verify Properties CPU
Chris Austenb29d2e82016-06-07 12:25:35 -050053
54Verify DIMM VPD Properties
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050055 Verify Properties DIMM
Chris Austenb29d2e82016-06-07 12:25:35 -050056
57Verify Memory Buffer VPD Properties
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050058 Verify Properties MEMORY_BUFFER
Chris Austenb29d2e82016-06-07 12:25:35 -050059
60Verify Fan VPD Properties
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050061 Verify Properties FAN
Chris Austenb29d2e82016-06-07 12:25:35 -050062
63Verify System VPD Properties
George Keishing8c0a4e52016-09-27 11:21:50 -050064 [Tags] Verify_System_VPD_Properties
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050065 Verify Properties SYSTEM
Chris Austenb29d2e82016-06-07 12:25:35 -050066
67
68*** Keywords ***
69
Chris Austenb29d2e82016-06-07 12:25:35 -050070
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050071Setup The Suite
72 BMC Power On
73
74 ${resp} = Read Properties /org/openbmc/inventory/enumerate
75 Set Suite Variable ${SYSTEM_INFO} ${resp}
76 log Dictionary ${resp}
Chris Austenb29d2e82016-06-07 12:25:35 -050077
78Get Total Present
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050079 [arguments] ${type}
80 ${l} = Create List []
81 ${resp} = Get Dictionary Keys ${SYSTEM_INFO}
82 ${list} = Get Matches ${resp} regexp=^.*[0-9a-z_].${type}[0-9]*$
83 : FOR ${element} IN @{list}
84 \ Append To List ${l} ${SYSTEM_INFO['${element}']['present']}
Chris Austenb29d2e82016-06-07 12:25:35 -050085
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050086 ${sum} = Get Count ${l} True
87 [return] ${sum}
Chris Austenb29d2e82016-06-07 12:25:35 -050088
89Verify Properties
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050090 [arguments] ${type}
Chris Austenb29d2e82016-06-07 12:25:35 -050091
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050092 ${list} = Get VPD Inventory List ${OPENBMC_MODEL} ${type}
93 : FOR ${element} IN @{list}
94 \ ${d} = Get From Dictionary ${SYSTEM_INFO} ${element}
95 \ Run Keyword If ${d['present']} == True Verify Present Properties ${d} ${type}
Chris Austenb29d2e82016-06-07 12:25:35 -050096
97Verify Present Properties
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050098 [arguments] ${d} ${type}
99 ${keys} = Get Dictionary Keys ${d}
100 Log List ${keys}
101 Log List ${INVENTORY_ITEMS['${type}']}
102 Lists Should Be Equal ${INVENTORY_ITEMS['${type}']} ${keys}