blob: acee981d8f1152f2d5078f8e103d3a02478d7224 [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
Rahul Maheshwari908df572017-02-16 04:41:54 -06006Resource ../lib/state_manager.robot
George Keishingd55a4be2016-08-26 03:28:17 -05007Resource ../lib/openbmc_ffdc.robot
Chris Austenb29d2e82016-06-07 12:25:35 -05008Library ../lib/utilities.py
9Library String
10Library Collections
11
12Variables ../data/variables.py
13
Rahul Maheshwari908df572017-02-16 04:41:54 -060014Suite setup Setup The Suite
15Test Teardown FFDC On Test Case Fail
Chris Austenb29d2e82016-06-07 12:25:35 -050016
George Keishing9aa0f652016-11-08 03:28:56 -060017Force Tags chassisboot inventory
Chris Austenb29d2e82016-06-07 12:25:35 -050018
19*** Test Cases ***
20
Rahul Maheshwari908df572017-02-16 04:41:54 -060021Minimal CPU Inventory
22 [Tags] Minimal_CPU_Inventory
Chris Austenb29d2e82016-06-07 12:25:35 -050023
Rahul Maheshwari908df572017-02-16 04:41:54 -060024 ${count}= Get Total Present cpu
25 Should Be True ${count}>${0}
Rahul Maheshwaribb20f732016-10-24 06:27:14 -050026
Rahul Maheshwari908df572017-02-16 04:41:54 -060027Minimal DIMM Inventory
28 [Tags] Minimal DIMM Inventory
Chris Austenb29d2e82016-06-07 12:25:35 -050029
Rahul Maheshwari908df572017-02-16 04:41:54 -060030 ${count}= Get Total Present dimm
31 Should Be True ${count}>=${2}
Chris Austenb29d2e82016-06-07 12:25:35 -050032
Rahul Maheshwari908df572017-02-16 04:41:54 -060033Minimal Core Inventory
34 [Tags] Minimal_Core_Inventory
Rahul Maheshwarif8119102016-10-05 01:15:56 -050035
Rahul Maheshwari908df572017-02-16 04:41:54 -060036 ${count}= Get Total Present core
37 Should Be True ${count}>${0}
Chris Austenb29d2e82016-06-07 12:25:35 -050038
Rahul Maheshwari908df572017-02-16 04:41:54 -060039Minimal Memory Buffer Inventory
40 [Tags] Minimal_Memory_Buffer_Inventory
Chris Austenb29d2e82016-06-07 12:25:35 -050041
Rahul Maheshwari908df572017-02-16 04:41:54 -060042 ${count}= Get Total Present membuf
43 Should Be True ${count}>${0}
Rahul Maheshwarif8119102016-10-05 01:15:56 -050044
Rahul Maheshwari908df572017-02-16 04:41:54 -060045Minimal Fan Inventory
46 [Tags] Minimal_Fan_Inventory
Chris Austenb29d2e82016-06-07 12:25:35 -050047
Rahul Maheshwari908df572017-02-16 04:41:54 -060048 ${count}= Get Total Present fan
49 Should Be True ${count}>${2}
Rahul Maheshwarif8119102016-10-05 01:15:56 -050050
Rahul Maheshwari908df572017-02-16 04:41:54 -060051Minimal Main Planar Inventory
52 [Tags] Minimal_Main_Planar_Inventory
53
54 ${count}= Get Total Present motherboard
55 Should Be True ${count}>${0}
56
57Minimal System Inventory
58 [Tags] Minimal_System_Inventory
59
60 ${count}= Get Total Present system
61 Should Be True ${count}>${0}
Chris Austenb29d2e82016-06-07 12:25:35 -050062
63Verify CPU VPD Properties
Rahul Maheshwari908df572017-02-16 04:41:54 -060064 [Tags] Verify_CPU_VPD_Properties
65
66 Verify Properties CPU
Chris Austenb29d2e82016-06-07 12:25:35 -050067
68Verify DIMM VPD Properties
Rahul Maheshwari908df572017-02-16 04:41:54 -060069 [Tags] Verify_DIMM_VPD_Properties
Rahul Maheshwaribb20f732016-10-24 06:27:14 -050070
Rahul Maheshwari908df572017-02-16 04:41:54 -060071 Verify Properties DIMM
Chris Austenb29d2e82016-06-07 12:25:35 -050072
73Verify Memory Buffer VPD Properties
Rahul Maheshwari908df572017-02-16 04:41:54 -060074 [Tags] Verify_Memory_Buffer_VPD_Properties
75
76 Verify Properties MEMORY_BUFFER
Chris Austenb29d2e82016-06-07 12:25:35 -050077
78Verify Fan VPD Properties
Rahul Maheshwari908df572017-02-16 04:41:54 -060079 [Tags] Verify_Fan_VPD_Properties
80
81 Verify Properties FAN
Chris Austenb29d2e82016-06-07 12:25:35 -050082
83Verify System VPD Properties
George Keishing8c0a4e52016-09-27 11:21:50 -050084 [Tags] Verify_System_VPD_Properties
Rahul Maheshwari908df572017-02-16 04:41:54 -060085
86 Verify Properties SYSTEM
Chris Austenb29d2e82016-06-07 12:25:35 -050087
88
89*** Keywords ***
90
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050091Setup The Suite
Rahul Maheshwari908df572017-02-16 04:41:54 -060092 ${host_state}= Get Host State
93 Run Keyword If '${host_state}' == 'Off' Initiate Host Boot
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050094
Rahul Maheshwari908df572017-02-16 04:41:54 -060095 ${resp}= Read Properties ${INVENTORY_URI}enumerate
96 Set Suite Variable ${SYSTEM_INFO} ${resp}
97 Log Dictionary ${resp}
Chris Austenb29d2e82016-06-07 12:25:35 -050098
99Get Total Present
Rahul Maheshwari908df572017-02-16 04:41:54 -0600100 [Arguments] ${type}
101 ${l}= Create List []
102 ${resp}= Get Dictionary Keys ${SYSTEM_INFO}
103 ${list}= Get Matches ${resp} regexp=^.*[0-9a-z_].${type}[0-9]*$
104 : FOR ${element} IN @{list}
105 \ Append To List ${l} ${SYSTEM_INFO['${element}']['present']}
Chris Austenb29d2e82016-06-07 12:25:35 -0500106
Rahul Maheshwari908df572017-02-16 04:41:54 -0600107 ${sum}= Get Count ${l} True
108 [Return] ${sum}
Chris Austenb29d2e82016-06-07 12:25:35 -0500109
110Verify Properties
Rahul Maheshwari908df572017-02-16 04:41:54 -0600111 [Arguments] ${type}
Chris Austenb29d2e82016-06-07 12:25:35 -0500112
Rahul Maheshwari908df572017-02-16 04:41:54 -0600113 ${list}= Get VPD Inventory List ${OPENBMC_MODEL} ${type}
114 : FOR ${element} IN @{list}
115 \ ${d}= Get From Dictionary ${SYSTEM_INFO} ${element}
116 \ Run Keyword If ${d['present']} == True Verify Present Properties ${d} ${type}
Chris Austenb29d2e82016-06-07 12:25:35 -0500117
118Verify Present Properties
Rahul Maheshwari908df572017-02-16 04:41:54 -0600119 [Arguments] ${d} ${type}
120 ${keys}= Get Dictionary Keys ${d}
121 Log List ${keys}
122 Log List ${INVENTORY_ITEMS['${type}']}
123 Lists Should Be Equal ${INVENTORY_ITEMS['${type}']} ${keys}