blob: 99dce58a778be8d30f1a893e87f23040ee7cb28c [file] [log] [blame]
Rahul Maheshwari037407d2021-05-12 23:54:11 -05001*** Settings ***
2Documentation This suite tests Vital Product Data (VPD) using Redfish.
3
4Resource ../../lib/openbmc_ffdc.robot
5Library ../../lib/vpd_utils.py
6
Rahul Maheshwari8e72e3e2021-07-22 05:07:00 -05007Suite Setup Redfish.Login
8Suite Teardown Redfish.Logout
9Test Teardown FFDC On Test Case Fail
Rahul Maheshwari037407d2021-05-12 23:54:11 -050010
11
12*** Test Cases ***
13
Rahul Maheshwari3d8a9682021-08-23 07:53:41 -050014Verify BMC VPD Data Via Redfish
15 [Documentation] Verify BMC VPD details via Redfish output.
16 [Tags] Verify_BMC_VPD_Data_Via_Redfish
Rahul Maheshwari037407d2021-05-12 23:54:11 -050017 [Template] Verify Redfish VPD Data
18
Rahul Maheshwari3d8a9682021-08-23 07:53:41 -050019 # Component Field
20 BMC Model
21 BMC PartNumber
22 BMC SerialNumber
23 BMC SparePartNumber
24 BMC Location
25
26
27Verify Chassis VPD Data Via Redfish
28 [Documentation] Verify Chassis VPD details via Redfish output.
29 [Tags] Verify_Chassis_VPD_Data_Via_Redfish
30 [Template] Verify Redfish VPD Data
31
32 # Skipping chassis's spare part number test because it has issue.
33 # Component Field
34 Chassis Model
35 Chassis PartNumber
36 Chassis SerialNumber
37 #Chassis SparePartNumber
38 Chassis Location
39
40
41Verify CPU VPD Data Via Redfish
42 [Documentation] Verify CPU VPD details via Redfish output.
43 [Tags] Verify_CPU_VPD_Data_Via_Redfish
44 [Template] Verify Redfish VPD Data
45
46 # Component Field
47 CPU Model
48 CPU PartNumber
49 CPU SerialNumber
50 CPU SparePartNumber
51 CPU Location
Rahul Maheshwari037407d2021-05-12 23:54:11 -050052
53
Rahul Maheshwari369e0cd2021-09-08 00:03:33 -050054Verify TPM VPD Data Via Redfish
55 [Documentation] Verify TPM VPD details via Redfish output.
56 [Tags] Verify_TPM_VPD_Data_Via_Redfish
57 [Template] Verify Redfish VPD Data
58
59 # Component Field
60 TPM Model
61 TPM PartNumber
62 TPM SerialNumber
63 TPM SparePartNumber
64 TPM Location
65
66
67Verify TOD Battery VPD Data Via Redfish
68 [Documentation] Verify TOD battery VPD details via Redfish output.
69 [Tags] Verify_TOD_Battery_VPD_Data_Via_Redfish
70 [Template] Verify Redfish VPD Data
71
72 # Component Field
73 TOD Battery Model
74 TOD Battery PartNumber
75 TOD Battery SerialNumber
76 TOD Battery SparePartNumber
77 TOD Battery Location
78
79
80Verify VRM VPD Data Via Redfish
81 [Documentation] Verify voltage regulator module VPD details via Redfish output.
82 [Tags] Verify_VRM_VPD_Data_Via_Redfish
83 [Template] Verify Redfish VPD Data
84
85 # Component Field
86 VRM Model
87 VRM PartNumber
88 VRM SerialNumber
89 VRM SparePartNumber
90 VRM Location
91
92
93Verify OP Panel VPD Data Via Redfish
94 [Documentation] Verify operator panel VPD details via Redfish output.
95 [Tags] Verify_OP_Panel_VPD_Data_Via_Redfish
96 [Template] Verify Redfish VPD Data
97
98 # Component Field
99 OP Panel Model
100 OP Panel PartNumber
101 OP Panel SerialNumber
102 OP Panel SparePartNumber
103 OP Panel Location
104
105
106Verify OP Panel LCD VPD Data Via Redfish
107 [Documentation] Verify operator panel LCD VPD details via Redfish output.
108 [Tags] Verify_OP_Panel_LCD_VPD_Data_Via_Redfish
109 [Template] Verify Redfish VPD Data
110
111 # Component Field
112 OP Panel LCD Model
113 OP Panel LCD PartNumber
114 OP Panel LCD SerialNumber
115 OP Panel LCD SparePartNumber
116 OP Panel LCD Location
117
118
119Verify Disk Backplane VPD Data Via Redfish
120 [Documentation] Verify disk backplane VPD details via Redfish output.
121 [Tags] Verify_Disk_Backplane_VPD_Data_Via_Redfish
122 [Template] Verify Redfish VPD Data
123
124 # Component Field
125 Disk Backplane Model
126 Disk Backplane PartNumber
127 Disk Backplane SerialNumber
128 Disk Backplane SparePartNumber
129 Disk Backplane Location
130
131
dnirmalad5a41a12023-01-12 01:02:46 -0600132Verify System VPD Data Via Redfish
133 [Documentation] Verify system Model and SN via Redfish output.
134 [Tags] Verify_System_VPD_Data_Via_Redfish
135 [Template] Verify Redfish VPD Data
136
137 # Component Field
138 System Model
139 System SerialNumber
140
141
dnirmalaed070102023-01-19 03:08:23 -0600142Verify Power Supply VPD Data Via Redfish
143 [Documentation] Verify power supply VPD details via Redfish output.
144 [Tags] Verify_Power_Supply_VPD_Data_Via_Redfish
145 [Template] Verify All Redfish VPD Data
146
147 # Component Field
148 Power Supply Model
149 Power Supply PartNumber
150 Power Supply SerialNumber
151 Power Supply SparePartNumber
152 Power Supply Location
153
154
Rahul Maheshwari037407d2021-05-12 23:54:11 -0500155*** Keywords ***
156
157Verify Redfish VPD Data
158 [Documentation] Verify Redfish VPD data of given component.
Rahul Maheshwari3d8a9682021-08-23 07:53:41 -0500159 [Arguments] ${component} ${field}
Rahul Maheshwari369e0cd2021-09-08 00:03:33 -0500160
Rahul Maheshwari037407d2021-05-12 23:54:11 -0500161 # Description of arguments:
162 # component VPD component (e.g. /system/chassis/motherboard/vdd_vrm1).
Rahul Maheshwari3d8a9682021-08-23 07:53:41 -0500163 # field VPD field (e.g. Model, PartNumber etc.).
Rahul Maheshwari037407d2021-05-12 23:54:11 -0500164
Rahul Maheshwari369e0cd2021-09-08 00:03:33 -0500165 ${redfish_component_uri} ${redfish_component_name}= Run Keyword If
166 ... '${component}' == 'BMC' Set Variable /redfish/v1/Managers/bmc OpenBmc Manager
167 ... ELSE IF '${component}' == 'Chassis'
168 ... Set Variable /redfish/v1/Chassis/chassis RackMount
169 ... ELSE IF '${component}' == 'CPU'
170 ... Set Variable /redfish/v1/Systems/system/Processors/cpu0 Processor
171 ... ELSE IF '${component}' == 'TPM'
Rahul Maheshwari58229e42022-08-18 07:02:59 -0500172 ... Set Variable /redfish/v1/Chassis/chassis/Assembly TPM Card
Rahul Maheshwari369e0cd2021-09-08 00:03:33 -0500173 ... ELSE IF '${component}' == 'TOD Battery'
Rahul Maheshwari58229e42022-08-18 07:02:59 -0500174 ... Set Variable /redfish/v1/Chassis/chassis/Assembly Time Of Day Battery
Rahul Maheshwari369e0cd2021-09-08 00:03:33 -0500175 ... ELSE IF '${component}' == 'VRM'
Rahul Maheshwari58229e42022-08-18 07:02:59 -0500176 ... Set Variable /redfish/v1/Chassis/chassis/Assembly Voltage Regulator Module
Rahul Maheshwari369e0cd2021-09-08 00:03:33 -0500177 ... ELSE IF '${component}' == 'OP Panel'
Rahul Maheshwari58229e42022-08-18 07:02:59 -0500178 ... Set Variable /redfish/v1/Chassis/chassis/Assembly Operator Panel Base
Rahul Maheshwari369e0cd2021-09-08 00:03:33 -0500179 ... ELSE IF '${component}' == 'OP Panel LCD'
Rahul Maheshwari58229e42022-08-18 07:02:59 -0500180 ... Set Variable /redfish/v1/Chassis/chassis/Assembly Operator Panel LCD
Rahul Maheshwari369e0cd2021-09-08 00:03:33 -0500181 ... ELSE IF '${component}' == 'Disk Backplane'
Rahul Maheshwari58229e42022-08-18 07:02:59 -0500182 ... Set Variable /redfish/v1/Chassis/chassis/Assembly NVMe Backplane
dnirmalad5a41a12023-01-12 01:02:46 -0600183 ... ELSE IF '${component}' == 'System'
184 ... Set Variable /redfish/v1/Systems/system System
Rahul Maheshwari037407d2021-05-12 23:54:11 -0500185
Rahul Maheshwari369e0cd2021-09-08 00:03:33 -0500186 ${resp}= Run Keyword If '${redfish_component_uri}' == '/redfish/v1/Chassis/chassis/Assembly'
187 ... Get Assembly Component VPD ${redfish_component_name}
188 ... ELSE Redfish.Get Properties ${redfish_component_uri}
189
Rahul Maheshwari037407d2021-05-12 23:54:11 -0500190 ${vpd_field}= Set Variable If
191 ... '${field}' == 'Model' CC
192 ... '${field}' == 'PartNumber' PN
193 ... '${field}' == 'SerialNumber' SN
194 ... '${field}' == 'SparePartNumber' FN
195 ... '${field}' == 'Location' LocationCode
196
197 ${vpd_component}= Set Variable If
Rahul Maheshwari3ac51c92021-09-07 00:30:17 -0500198 ... '${component}' == 'CPU' /system/chassis/motherboard/dcm0/cpu0
Rahul Maheshwari037407d2021-05-12 23:54:11 -0500199 ... '${component}' == 'Chassis' /system/chassis
Rahul Maheshwari58229e42022-08-18 07:02:59 -0500200 ... '${component}' == 'BMC' /system/chassis/motherboard/bmc
201 ... '${component}' == 'TPM' /system/chassis/motherboard/tpm
202 ... '${component}' == 'TOD Battery' /system/chassis/motherboard/bmc/tod_battery
203 ... '${component}' == 'VRM' /system/chassis/motherboard/vrm0
204 ... '${component}' == 'OP Panel' /system/chassis/motherboard/dasd_backplane/panel0
205 ... '${component}' == 'OP Panel LCD' /system/chassis/motherboard/dasd_backplane/panel1
206 ... '${component}' == 'Disk Backplane' /system/chassis/motherboard/dasd_backplane
dnirmalad5a41a12023-01-12 01:02:46 -0600207 ... '${component}' == 'System' /system
Rahul Maheshwari037407d2021-05-12 23:54:11 -0500208
Rahul Maheshwari3d8a9682021-08-23 07:53:41 -0500209 ${vpd_records}= Vpdtool -o -O ${vpd_component}
210
211 Run Keyword if '${field}' == 'Location'
212 ... Should Be Equal As Strings ${resp["Location"]["PartLocation"]["ServiceLabel"]}
213 ... ${vpd_records['${vpd_component}']['${vpd_field}']}
dnirmalad5a41a12023-01-12 01:02:46 -0600214
215 # Check whether the vpd details from redfish and vpdtool are the same.
216 ... ELSE IF '${component}' == 'System'
217 ... Should Be Equal As Strings ${resp["${field}"]} ${vpd_records['${vpd_component}']['${field}']}
Rahul Maheshwari3d8a9682021-08-23 07:53:41 -0500218 ... ELSE
219 ... Should Be Equal As Strings ${resp["${field}"]} ${vpd_records['${vpd_component}']['${vpd_field}']}
Rahul Maheshwari369e0cd2021-09-08 00:03:33 -0500220
221
222Get Assembly Component VPD
223 [Documentation] Returns Redfish VPD data of given assembly component.
224 [Arguments] ${component_name}
225
226 # Description of argument(s):
227 # component_name Assembly's component name (e.g. tpm_wilson, tod_battery).
228
229 ${resp}= Redfish.Get Properties /redfish/v1/Chassis/chassis/Assembly
230 FOR ${assembly_component} IN @{resp["Assemblies"]}
231 ${output}= Set Variable If
232 ... "${component_name}" == "${assembly_component["Name"]}" ${assembly_component}
233 Exit For Loop IF "${component_name}" == "${assembly_component["Name"]}"
234 END
235 [Return] ${output}
dnirmalaed070102023-01-19 03:08:23 -0600236
237
238Verify All Redfish VPD Data
239 [Documentation] Verify Redfish VPD data using all the inventory URIs of given component.
240 [Arguments] ${component} ${field}
241
242 # Description of arguments:
243 # component VPD component (TPM Card, Power Supply).
244 # field VPD field (e.g. Model, PartNumber etc.).
245
246 ${redfish_component_uri}= Set Variable /redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies
247
248 ${redfish_uri_list}= Get Member List ${redfish_component_uri}
249
250 # Example output:
251 # {'@odata.id': '/redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies/powersupply0'}
252 # {'@odata.id': '/redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies/powersupply1'}
253
254 ${vpd_field}= Set Variable If
255 ... '${field}' == 'Model' CC
256 ... '${field}' == 'PartNumber' PN
257 ... '${field}' == 'SerialNumber' SN
258 ... '${field}' == 'SparePartNumber' FN
259 ... '${field}' == 'Location' LocationCode
260
261 FOR ${uri} IN @{redfish_uri_list}
262 ${resp}= Redfish.Get Properties ${uri}
263 ${name}= Fetch From Right ${uri} /
264 ${vpd_component}= Set Variable /system/chassis/motherboard/${name}
265 ${vpd_records}= Vpdtool -o -O ${vpd_component}
266
267 # Check whether the vpd details from redfish and vpdtool are the same.
268 Run Keyword if '${field}' == 'Location'
269 ... Should Be Equal As Strings ${resp["Location"]["PartLocation"]["ServiceLabel"]}
270 ... ${vpd_records['${vpd_component}']['${vpd_field}']}
271 ... ELSE
272 ... Should Be Equal As Strings ${resp["${field}"]}
273 ... ${vpd_records['${vpd_component}']['${vpd_field}']}
274 END