Rahul Maheshwari | 037407d | 2021-05-12 23:54:11 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation This suite tests Vital Product Data (VPD) using Redfish. |
| 3 | |
| 4 | Resource ../../lib/openbmc_ffdc.robot |
| 5 | Library ../../lib/vpd_utils.py |
| 6 | |
Rahul Maheshwari | 8e72e3e | 2021-07-22 05:07:00 -0500 | [diff] [blame] | 7 | Suite Setup Redfish.Login |
| 8 | Suite Teardown Redfish.Logout |
| 9 | Test Teardown FFDC On Test Case Fail |
Rahul Maheshwari | 037407d | 2021-05-12 23:54:11 -0500 | [diff] [blame] | 10 | |
| 11 | |
| 12 | *** Test Cases *** |
| 13 | |
Rahul Maheshwari | 3d8a968 | 2021-08-23 07:53:41 -0500 | [diff] [blame] | 14 | Verify BMC VPD Data Via Redfish |
| 15 | [Documentation] Verify BMC VPD details via Redfish output. |
| 16 | [Tags] Verify_BMC_VPD_Data_Via_Redfish |
Rahul Maheshwari | 037407d | 2021-05-12 23:54:11 -0500 | [diff] [blame] | 17 | [Template] Verify Redfish VPD Data |
| 18 | |
Rahul Maheshwari | 3d8a968 | 2021-08-23 07:53:41 -0500 | [diff] [blame] | 19 | # Component Field |
| 20 | BMC Model |
| 21 | BMC PartNumber |
| 22 | BMC SerialNumber |
| 23 | BMC SparePartNumber |
| 24 | BMC Location |
| 25 | |
| 26 | |
| 27 | Verify 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 | |
| 41 | Verify 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 Maheshwari | 037407d | 2021-05-12 23:54:11 -0500 | [diff] [blame] | 52 | |
| 53 | |
Rahul Maheshwari | 369e0cd | 2021-09-08 00:03:33 -0500 | [diff] [blame] | 54 | Verify 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 | |
| 67 | Verify 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 | |
| 80 | Verify 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 | |
| 93 | Verify 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 | |
| 106 | Verify 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 | |
| 119 | Verify 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 | |
dnirmala | d5a41a1 | 2023-01-12 01:02:46 -0600 | [diff] [blame] | 132 | Verify 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 Maheshwari | 037407d | 2021-05-12 23:54:11 -0500 | [diff] [blame] | 142 | *** Keywords *** |
| 143 | |
| 144 | Verify Redfish VPD Data |
| 145 | [Documentation] Verify Redfish VPD data of given component. |
Rahul Maheshwari | 3d8a968 | 2021-08-23 07:53:41 -0500 | [diff] [blame] | 146 | [Arguments] ${component} ${field} |
Rahul Maheshwari | 369e0cd | 2021-09-08 00:03:33 -0500 | [diff] [blame] | 147 | |
Rahul Maheshwari | 037407d | 2021-05-12 23:54:11 -0500 | [diff] [blame] | 148 | # Description of arguments: |
| 149 | # component VPD component (e.g. /system/chassis/motherboard/vdd_vrm1). |
Rahul Maheshwari | 3d8a968 | 2021-08-23 07:53:41 -0500 | [diff] [blame] | 150 | # field VPD field (e.g. Model, PartNumber etc.). |
Rahul Maheshwari | 037407d | 2021-05-12 23:54:11 -0500 | [diff] [blame] | 151 | |
Rahul Maheshwari | 369e0cd | 2021-09-08 00:03:33 -0500 | [diff] [blame] | 152 | ${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 Maheshwari | 58229e4 | 2022-08-18 07:02:59 -0500 | [diff] [blame] | 159 | ... Set Variable /redfish/v1/Chassis/chassis/Assembly TPM Card |
Rahul Maheshwari | 369e0cd | 2021-09-08 00:03:33 -0500 | [diff] [blame] | 160 | ... ELSE IF '${component}' == 'TOD Battery' |
Rahul Maheshwari | 58229e4 | 2022-08-18 07:02:59 -0500 | [diff] [blame] | 161 | ... Set Variable /redfish/v1/Chassis/chassis/Assembly Time Of Day Battery |
Rahul Maheshwari | 369e0cd | 2021-09-08 00:03:33 -0500 | [diff] [blame] | 162 | ... ELSE IF '${component}' == 'VRM' |
Rahul Maheshwari | 58229e4 | 2022-08-18 07:02:59 -0500 | [diff] [blame] | 163 | ... Set Variable /redfish/v1/Chassis/chassis/Assembly Voltage Regulator Module |
Rahul Maheshwari | 369e0cd | 2021-09-08 00:03:33 -0500 | [diff] [blame] | 164 | ... ELSE IF '${component}' == 'OP Panel' |
Rahul Maheshwari | 58229e4 | 2022-08-18 07:02:59 -0500 | [diff] [blame] | 165 | ... Set Variable /redfish/v1/Chassis/chassis/Assembly Operator Panel Base |
Rahul Maheshwari | 369e0cd | 2021-09-08 00:03:33 -0500 | [diff] [blame] | 166 | ... ELSE IF '${component}' == 'OP Panel LCD' |
Rahul Maheshwari | 58229e4 | 2022-08-18 07:02:59 -0500 | [diff] [blame] | 167 | ... Set Variable /redfish/v1/Chassis/chassis/Assembly Operator Panel LCD |
Rahul Maheshwari | 369e0cd | 2021-09-08 00:03:33 -0500 | [diff] [blame] | 168 | ... ELSE IF '${component}' == 'Disk Backplane' |
Rahul Maheshwari | 58229e4 | 2022-08-18 07:02:59 -0500 | [diff] [blame] | 169 | ... Set Variable /redfish/v1/Chassis/chassis/Assembly NVMe Backplane |
dnirmala | d5a41a1 | 2023-01-12 01:02:46 -0600 | [diff] [blame] | 170 | ... ELSE IF '${component}' == 'System' |
| 171 | ... Set Variable /redfish/v1/Systems/system System |
Rahul Maheshwari | 037407d | 2021-05-12 23:54:11 -0500 | [diff] [blame] | 172 | |
Rahul Maheshwari | 369e0cd | 2021-09-08 00:03:33 -0500 | [diff] [blame] | 173 | ${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 Maheshwari | 037407d | 2021-05-12 23:54:11 -0500 | [diff] [blame] | 177 | ${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 Maheshwari | 3ac51c9 | 2021-09-07 00:30:17 -0500 | [diff] [blame] | 185 | ... '${component}' == 'CPU' /system/chassis/motherboard/dcm0/cpu0 |
Rahul Maheshwari | 037407d | 2021-05-12 23:54:11 -0500 | [diff] [blame] | 186 | ... '${component}' == 'Chassis' /system/chassis |
Rahul Maheshwari | 58229e4 | 2022-08-18 07:02:59 -0500 | [diff] [blame] | 187 | ... '${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 |
dnirmala | d5a41a1 | 2023-01-12 01:02:46 -0600 | [diff] [blame] | 194 | ... '${component}' == 'System' /system |
Rahul Maheshwari | 037407d | 2021-05-12 23:54:11 -0500 | [diff] [blame] | 195 | |
Rahul Maheshwari | 3d8a968 | 2021-08-23 07:53:41 -0500 | [diff] [blame] | 196 | ${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}']} |
dnirmala | d5a41a1 | 2023-01-12 01:02:46 -0600 | [diff] [blame] | 201 | |
| 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 Maheshwari | 3d8a968 | 2021-08-23 07:53:41 -0500 | [diff] [blame] | 205 | ... ELSE |
| 206 | ... Should Be Equal As Strings ${resp["${field}"]} ${vpd_records['${vpd_component}']['${vpd_field}']} |
Rahul Maheshwari | 369e0cd | 2021-09-08 00:03:33 -0500 | [diff] [blame] | 207 | |
| 208 | |
| 209 | Get 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} |