blob: 1907cebed9e4401c9ce30d97c85a2e0203c7b376 [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
Gunnar Mills1cd544d2016-12-06 11:19:22 -060023 ${count}= Get Total Present cpu
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050024 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
Gunnar Mills1cd544d2016-12-06 11:19:22 -060029 ${count}= Get Total Present dimm
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050030 Should Be True ${count}>=${2}
Chris Austenb29d2e82016-06-07 12:25:35 -050031
32minimal core inventory
Gunnar Mills1cd544d2016-12-06 11:19:22 -060033 ${count}= Get Total Present core
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050034 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
Gunnar Mills1cd544d2016-12-06 11:19:22 -060039 ${count}= Get Total Present membuf
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050040 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
Gunnar Mills1cd544d2016-12-06 11:19:22 -060044 ${count}= Get Total Present fan
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050045 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
Gunnar Mills1cd544d2016-12-06 11:19:22 -060050 ${count}= Get Total Present motherboard
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050051 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
Gunnar Mills1cd544d2016-12-06 11:19:22 -060056 ${count}= Get Total Present system
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050057 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
George Keishingec807372016-12-05 03:54:51 -060084 ${resp}= Read Properties ${INVENTORY_URI}enumerate
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050085 Set Suite Variable ${SYSTEM_INFO} ${resp}
86 log Dictionary ${resp}
Chris Austenb29d2e82016-06-07 12:25:35 -050087
88Get Total Present
Gunnar Mills38032802016-12-12 13:43:40 -060089 [Arguments] ${type}
Gunnar Mills1cd544d2016-12-06 11:19:22 -060090 ${l}= Create List []
91 ${resp}= Get Dictionary Keys ${SYSTEM_INFO}
92 ${list}= Get Matches ${resp} regexp=^.*[0-9a-z_].${type}[0-9]*$
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050093 : FOR ${element} IN @{list}
94 \ Append To List ${l} ${SYSTEM_INFO['${element}']['present']}
Chris Austenb29d2e82016-06-07 12:25:35 -050095
Gunnar Mills1cd544d2016-12-06 11:19:22 -060096 ${sum}= Get Count ${l} True
Gunnar Millsc9ea9362016-12-13 16:21:13 -060097 [Return] ${sum}
Chris Austenb29d2e82016-06-07 12:25:35 -050098
99Verify Properties
Gunnar Mills38032802016-12-12 13:43:40 -0600100 [Arguments] ${type}
Chris Austenb29d2e82016-06-07 12:25:35 -0500101
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600102 ${list}= Get VPD Inventory List ${OPENBMC_MODEL} ${type}
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500103 : FOR ${element} IN @{list}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600104 \ ${d}= Get From Dictionary ${SYSTEM_INFO} ${element}
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500105 \ Run Keyword If ${d['present']} == True Verify Present Properties ${d} ${type}
Chris Austenb29d2e82016-06-07 12:25:35 -0500106
107Verify Present Properties
Gunnar Mills38032802016-12-12 13:43:40 -0600108 [Arguments] ${d} ${type}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600109 ${keys}= Get Dictionary Keys ${d}
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500110 Log List ${keys}
111 Log List ${INVENTORY_ITEMS['${type}']}
112 Lists Should Be Equal ${INVENTORY_ITEMS['${type}']} ${keys}