blob: eb55254f3b751c4358a4b1988ca3bde866a3a3a0 [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
Rahul Maheshwari037407d2021-05-12 23:54:11 -0500132*** Keywords ***
133
134Verify Redfish VPD Data
135 [Documentation] Verify Redfish VPD data of given component.
Rahul Maheshwari3d8a9682021-08-23 07:53:41 -0500136 [Arguments] ${component} ${field}
Rahul Maheshwari369e0cd2021-09-08 00:03:33 -0500137
Rahul Maheshwari037407d2021-05-12 23:54:11 -0500138 # Description of arguments:
139 # component VPD component (e.g. /system/chassis/motherboard/vdd_vrm1).
Rahul Maheshwari3d8a9682021-08-23 07:53:41 -0500140 # field VPD field (e.g. Model, PartNumber etc.).
Rahul Maheshwari037407d2021-05-12 23:54:11 -0500141
Rahul Maheshwari369e0cd2021-09-08 00:03:33 -0500142 ${redfish_component_uri} ${redfish_component_name}= Run Keyword If
143 ... '${component}' == 'BMC' Set Variable /redfish/v1/Managers/bmc OpenBmc Manager
144 ... ELSE IF '${component}' == 'Chassis'
145 ... Set Variable /redfish/v1/Chassis/chassis RackMount
146 ... ELSE IF '${component}' == 'CPU'
147 ... Set Variable /redfish/v1/Systems/system/Processors/cpu0 Processor
148 ... ELSE IF '${component}' == 'TPM'
149 ... Set Variable /redfish/v1/Chassis/chassis/Assembly tpm_wilson
150 ... ELSE IF '${component}' == 'TOD Battery'
151 ... Set Variable /redfish/v1/Chassis/chassis/Assembly tod_battery
152 ... ELSE IF '${component}' == 'VRM'
153 ... Set Variable /redfish/v1/Chassis/chassis/Assembly vdd_vrm0
154 ... ELSE IF '${component}' == 'OP Panel'
155 ... Set Variable /redfish/v1/Chassis/chassis/Assembly base_op_panel_blyth
156 ... ELSE IF '${component}' == 'OP Panel LCD'
157 ... Set Variable /redfish/v1/Chassis/chassis/Assembly lcd_op_panel_hill
158 ... ELSE IF '${component}' == 'Disk Backplane'
159 ... Set Variable /redfish/v1/Chassis/chassis/Assembly disk_backplane0
Rahul Maheshwari037407d2021-05-12 23:54:11 -0500160
Rahul Maheshwari369e0cd2021-09-08 00:03:33 -0500161 ${resp}= Run Keyword If '${redfish_component_uri}' == '/redfish/v1/Chassis/chassis/Assembly'
162 ... Get Assembly Component VPD ${redfish_component_name}
163 ... ELSE Redfish.Get Properties ${redfish_component_uri}
164
Rahul Maheshwari037407d2021-05-12 23:54:11 -0500165 ${vpd_field}= Set Variable If
166 ... '${field}' == 'Model' CC
167 ... '${field}' == 'PartNumber' PN
168 ... '${field}' == 'SerialNumber' SN
169 ... '${field}' == 'SparePartNumber' FN
170 ... '${field}' == 'Location' LocationCode
171
172 ${vpd_component}= Set Variable If
Rahul Maheshwari3ac51c92021-09-07 00:30:17 -0500173 ... '${component}' == 'CPU' /system/chassis/motherboard/dcm0/cpu0
Rahul Maheshwari037407d2021-05-12 23:54:11 -0500174 ... '${component}' == 'Chassis' /system/chassis
175 ... '${component}' == 'BMC' /system/chassis/motherboard/ebmc_card_bmc
Rahul Maheshwari369e0cd2021-09-08 00:03:33 -0500176 ... '${component}' == 'TPM' /system/chassis/motherboard/tpm_wilson
177 ... '${component}' == 'TOD Battery' /system/chassis/motherboard/tod_battery
178 ... '${component}' == 'VRM' /system/chassis/motherboard/vdd_vrm0
179 ... '${component}' == 'OP Panel' /system/chassis/motherboard/base_op_panel_blyth
180 ... '${component}' == 'OP Panel LCD' /system/chassis/motherboard/lcd_op_panel_hill
181 ... '${component}' == 'Disk Backplane' /system/chassis/motherboard/disk_backplane0
Rahul Maheshwari037407d2021-05-12 23:54:11 -0500182
Rahul Maheshwari3d8a9682021-08-23 07:53:41 -0500183 ${vpd_records}= Vpdtool -o -O ${vpd_component}
184
185 Run Keyword if '${field}' == 'Location'
186 ... Should Be Equal As Strings ${resp["Location"]["PartLocation"]["ServiceLabel"]}
187 ... ${vpd_records['${vpd_component}']['${vpd_field}']}
188 ... ELSE
189 ... Should Be Equal As Strings ${resp["${field}"]} ${vpd_records['${vpd_component}']['${vpd_field}']}
Rahul Maheshwari369e0cd2021-09-08 00:03:33 -0500190
191
192Get Assembly Component VPD
193 [Documentation] Returns Redfish VPD data of given assembly component.
194 [Arguments] ${component_name}
195
196 # Description of argument(s):
197 # component_name Assembly's component name (e.g. tpm_wilson, tod_battery).
198
199 ${resp}= Redfish.Get Properties /redfish/v1/Chassis/chassis/Assembly
200 FOR ${assembly_component} IN @{resp["Assemblies"]}
201 ${output}= Set Variable If
202 ... "${component_name}" == "${assembly_component["Name"]}" ${assembly_component}
203 Exit For Loop IF "${component_name}" == "${assembly_component["Name"]}"
204 END
205 [Return] ${output}