blob: 1d3667c06eed6ab68ec97f452cd9aeb696312798 [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
Gunnar Millseac1af22016-11-14 15:30:09 -060011Test Teardown FFDC On Test Case Fail
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
George Keishing9aa0f652016-11-08 03:28:56 -060018Force Tags chassisboot inventory
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 Maheshwaribb20f732016-10-24 06:27:14 -050027 [Tags] minimal_dimm_inventory
28
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050029 ${count} = Get Total Present dimm
30 Should Be True ${count}>=${2}
Chris Austenb29d2e82016-06-07 12:25:35 -050031
32minimal core inventory
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050033 ${count} = Get Total Present core
34 Should Be True ${count}>${0}
Chris Austenb29d2e82016-06-07 12:25:35 -050035
36minimal memory buffer inventory
Rahul Maheshwarif8119102016-10-05 01:15:56 -050037 [Tags] minimal_memory_buffer_inventory
38
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050039 ${count} = Get Total Present membuf
40 Should Be True ${count}>${0}
Chris Austenb29d2e82016-06-07 12:25:35 -050041
42minimal fan inventory
George Keishing8c0a4e52016-09-27 11:21:50 -050043 [Tags] minimal_fan_inventory
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050044 ${count} = Get Total Present fan
45 Should Be True ${count}>${2}
Chris Austenb29d2e82016-06-07 12:25:35 -050046
47minimal main planar inventory
Rahul Maheshwarif8119102016-10-05 01:15:56 -050048 [Tags] minimal_main_planar_inventory
49
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050050 ${count} = Get Total Present motherboard
51 Should Be True ${count}>${0}
Chris Austenb29d2e82016-06-07 12:25:35 -050052
53minimal system inventory
Rahul Maheshwarif8119102016-10-05 01:15:56 -050054 [Tags] minimal_system_inventory
55
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050056 ${count} = Get Total Present system
57 Should Be True ${count}>${0}
Chris Austenb29d2e82016-06-07 12:25:35 -050058
59Verify CPU VPD Properties
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050060 Verify Properties CPU
Chris Austenb29d2e82016-06-07 12:25:35 -050061
62Verify DIMM VPD Properties
Rahul Maheshwaribb20f732016-10-24 06:27:14 -050063 [Tags] Verify_DIMM_VPD_Properties
64
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050065 Verify Properties DIMM
Chris Austenb29d2e82016-06-07 12:25:35 -050066
67Verify Memory Buffer VPD Properties
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050068 Verify Properties MEMORY_BUFFER
Chris Austenb29d2e82016-06-07 12:25:35 -050069
70Verify Fan VPD Properties
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050071 Verify Properties FAN
Chris Austenb29d2e82016-06-07 12:25:35 -050072
73Verify System VPD Properties
George Keishing8c0a4e52016-09-27 11:21:50 -050074 [Tags] Verify_System_VPD_Properties
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050075 Verify Properties SYSTEM
Chris Austenb29d2e82016-06-07 12:25:35 -050076
77
78*** Keywords ***
79
Chris Austenb29d2e82016-06-07 12:25:35 -050080
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050081Setup The Suite
82 BMC Power On
83
84 ${resp} = Read Properties /org/openbmc/inventory/enumerate
85 Set Suite Variable ${SYSTEM_INFO} ${resp}
86 log Dictionary ${resp}
Chris Austenb29d2e82016-06-07 12:25:35 -050087
88Get Total Present
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050089 [arguments] ${type}
90 ${l} = Create List []
91 ${resp} = Get Dictionary Keys ${SYSTEM_INFO}
92 ${list} = Get Matches ${resp} regexp=^.*[0-9a-z_].${type}[0-9]*$
93 : FOR ${element} IN @{list}
94 \ Append To List ${l} ${SYSTEM_INFO['${element}']['present']}
Chris Austenb29d2e82016-06-07 12:25:35 -050095
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050096 ${sum} = Get Count ${l} True
97 [return] ${sum}
Chris Austenb29d2e82016-06-07 12:25:35 -050098
99Verify Properties
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500100 [arguments] ${type}
Chris Austenb29d2e82016-06-07 12:25:35 -0500101
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500102 ${list} = Get VPD Inventory List ${OPENBMC_MODEL} ${type}
103 : FOR ${element} IN @{list}
104 \ ${d} = Get From Dictionary ${SYSTEM_INFO} ${element}
105 \ Run Keyword If ${d['present']} == True Verify Present Properties ${d} ${type}
Chris Austenb29d2e82016-06-07 12:25:35 -0500106
107Verify Present Properties
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500108 [arguments] ${d} ${type}
109 ${keys} = Get Dictionary Keys ${d}
110 Log List ${keys}
111 Log List ${INVENTORY_ITEMS['${type}']}
112 Lists Should Be Equal ${INVENTORY_ITEMS['${type}']} ${keys}