blob: a12dcacff543a51e9002c6c4d422cb0b51e1f092 [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
Rahul Maheshwari037407d2021-05-12 23:54:11 -0500142*** Keywords ***
143
144Verify Redfish VPD Data
145 [Documentation] Verify Redfish VPD data of given component.
Rahul Maheshwari3d8a9682021-08-23 07:53:41 -0500146 [Arguments] ${component} ${field}
Rahul Maheshwari369e0cd2021-09-08 00:03:33 -0500147
Rahul Maheshwari037407d2021-05-12 23:54:11 -0500148 # Description of arguments:
149 # component VPD component (e.g. /system/chassis/motherboard/vdd_vrm1).
Rahul Maheshwari3d8a9682021-08-23 07:53:41 -0500150 # field VPD field (e.g. Model, PartNumber etc.).
Rahul Maheshwari037407d2021-05-12 23:54:11 -0500151
Rahul Maheshwari369e0cd2021-09-08 00:03:33 -0500152 ${redfish_component_uri} ${redfish_component_name}= Run Keyword If
153 ... '${component}' == 'BMC' Set Variable /redfish/v1/Managers/bmc OpenBmc Manager
154 ... ELSE IF '${component}' == 'Chassis'
155 ... Set Variable /redfish/v1/Chassis/chassis RackMount
156 ... ELSE IF '${component}' == 'CPU'
157 ... Set Variable /redfish/v1/Systems/system/Processors/cpu0 Processor
158 ... ELSE IF '${component}' == 'TPM'
Rahul Maheshwari58229e42022-08-18 07:02:59 -0500159 ... Set Variable /redfish/v1/Chassis/chassis/Assembly TPM Card
Rahul Maheshwari369e0cd2021-09-08 00:03:33 -0500160 ... ELSE IF '${component}' == 'TOD Battery'
Rahul Maheshwari58229e42022-08-18 07:02:59 -0500161 ... Set Variable /redfish/v1/Chassis/chassis/Assembly Time Of Day Battery
Rahul Maheshwari369e0cd2021-09-08 00:03:33 -0500162 ... ELSE IF '${component}' == 'VRM'
Rahul Maheshwari58229e42022-08-18 07:02:59 -0500163 ... Set Variable /redfish/v1/Chassis/chassis/Assembly Voltage Regulator Module
Rahul Maheshwari369e0cd2021-09-08 00:03:33 -0500164 ... ELSE IF '${component}' == 'OP Panel'
Rahul Maheshwari58229e42022-08-18 07:02:59 -0500165 ... Set Variable /redfish/v1/Chassis/chassis/Assembly Operator Panel Base
Rahul Maheshwari369e0cd2021-09-08 00:03:33 -0500166 ... ELSE IF '${component}' == 'OP Panel LCD'
Rahul Maheshwari58229e42022-08-18 07:02:59 -0500167 ... Set Variable /redfish/v1/Chassis/chassis/Assembly Operator Panel LCD
Rahul Maheshwari369e0cd2021-09-08 00:03:33 -0500168 ... ELSE IF '${component}' == 'Disk Backplane'
Rahul Maheshwari58229e42022-08-18 07:02:59 -0500169 ... Set Variable /redfish/v1/Chassis/chassis/Assembly NVMe Backplane
dnirmalad5a41a12023-01-12 01:02:46 -0600170 ... ELSE IF '${component}' == 'System'
171 ... Set Variable /redfish/v1/Systems/system System
Rahul Maheshwari037407d2021-05-12 23:54:11 -0500172
Rahul Maheshwari369e0cd2021-09-08 00:03:33 -0500173 ${resp}= Run Keyword If '${redfish_component_uri}' == '/redfish/v1/Chassis/chassis/Assembly'
174 ... Get Assembly Component VPD ${redfish_component_name}
175 ... ELSE Redfish.Get Properties ${redfish_component_uri}
176
Rahul Maheshwari037407d2021-05-12 23:54:11 -0500177 ${vpd_field}= Set Variable If
178 ... '${field}' == 'Model' CC
179 ... '${field}' == 'PartNumber' PN
180 ... '${field}' == 'SerialNumber' SN
181 ... '${field}' == 'SparePartNumber' FN
182 ... '${field}' == 'Location' LocationCode
183
184 ${vpd_component}= Set Variable If
Rahul Maheshwari3ac51c92021-09-07 00:30:17 -0500185 ... '${component}' == 'CPU' /system/chassis/motherboard/dcm0/cpu0
Rahul Maheshwari037407d2021-05-12 23:54:11 -0500186 ... '${component}' == 'Chassis' /system/chassis
Rahul Maheshwari58229e42022-08-18 07:02:59 -0500187 ... '${component}' == 'BMC' /system/chassis/motherboard/bmc
188 ... '${component}' == 'TPM' /system/chassis/motherboard/tpm
189 ... '${component}' == 'TOD Battery' /system/chassis/motherboard/bmc/tod_battery
190 ... '${component}' == 'VRM' /system/chassis/motherboard/vrm0
191 ... '${component}' == 'OP Panel' /system/chassis/motherboard/dasd_backplane/panel0
192 ... '${component}' == 'OP Panel LCD' /system/chassis/motherboard/dasd_backplane/panel1
193 ... '${component}' == 'Disk Backplane' /system/chassis/motherboard/dasd_backplane
dnirmalad5a41a12023-01-12 01:02:46 -0600194 ... '${component}' == 'System' /system
Rahul Maheshwari037407d2021-05-12 23:54:11 -0500195
Rahul Maheshwari3d8a9682021-08-23 07:53:41 -0500196 ${vpd_records}= Vpdtool -o -O ${vpd_component}
197
198 Run Keyword if '${field}' == 'Location'
199 ... Should Be Equal As Strings ${resp["Location"]["PartLocation"]["ServiceLabel"]}
200 ... ${vpd_records['${vpd_component}']['${vpd_field}']}
dnirmalad5a41a12023-01-12 01:02:46 -0600201
202 # Check whether the vpd details from redfish and vpdtool are the same.
203 ... ELSE IF '${component}' == 'System'
204 ... Should Be Equal As Strings ${resp["${field}"]} ${vpd_records['${vpd_component}']['${field}']}
Rahul Maheshwari3d8a9682021-08-23 07:53:41 -0500205 ... ELSE
206 ... Should Be Equal As Strings ${resp["${field}"]} ${vpd_records['${vpd_component}']['${vpd_field}']}
Rahul Maheshwari369e0cd2021-09-08 00:03:33 -0500207
208
209Get Assembly Component VPD
210 [Documentation] Returns Redfish VPD data of given assembly component.
211 [Arguments] ${component_name}
212
213 # Description of argument(s):
214 # component_name Assembly's component name (e.g. tpm_wilson, tod_battery).
215
216 ${resp}= Redfish.Get Properties /redfish/v1/Chassis/chassis/Assembly
217 FOR ${assembly_component} IN @{resp["Assemblies"]}
218 ${output}= Set Variable If
219 ... "${component_name}" == "${assembly_component["Name"]}" ${assembly_component}
220 Exit For Loop IF "${component_name}" == "${assembly_component["Name"]}"
221 END
222 [Return] ${output}