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 | c0df92e | 2021-06-23 23:57:24 -0500 | [diff] [blame] | 7 | #Test Teardown FFDC On Test Case Fail |
Rahul Maheshwari | 037407d | 2021-05-12 23:54:11 -0500 | [diff] [blame] | 8 | |
| 9 | |
| 10 | *** Test Cases *** |
| 11 | |
| 12 | Verify VPD Data Via Redfish |
| 13 | [Documentation] Verify VPD details via Redfish output. |
| 14 | [Tags] Verify_VPD_Data_Via_Redfish |
| 15 | [Template] Verify Redfish VPD Data |
| 16 | |
| 17 | # Component |
Rahul Maheshwari | c0df92e | 2021-06-23 23:57:24 -0500 | [diff] [blame] | 18 | System |
Rahul Maheshwari | 037407d | 2021-05-12 23:54:11 -0500 | [diff] [blame] | 19 | BMC |
| 20 | Chassis |
| 21 | CPU |
| 22 | |
| 23 | |
| 24 | *** Keywords *** |
| 25 | |
| 26 | Verify Redfish VPD Data |
| 27 | [Documentation] Verify Redfish VPD data of given component. |
| 28 | [Arguments] ${component} |
| 29 | # Description of arguments: |
| 30 | # component VPD component (e.g. /system/chassis/motherboard/vdd_vrm1). |
| 31 | |
| 32 | ${component_uri}= Set Variable If |
| 33 | ... '${component}' == 'BMC' /redfish/v1/Managers/bmc |
| 34 | ... '${component}' == 'Chassis' /redfish/v1/Chassis/chassis |
| 35 | ... '${component}' == 'CPU' /redfish/v1/Systems/system/Processors/cpu0 |
Rahul Maheshwari | c0df92e | 2021-06-23 23:57:24 -0500 | [diff] [blame] | 36 | ... '${component}' == 'System' /redfish/v1/Systems/system |
Rahul Maheshwari | 037407d | 2021-05-12 23:54:11 -0500 | [diff] [blame] | 37 | |
| 38 | # TODO: Currently serial number is verified. Verification for other fields will be added later. |
| 39 | Verify Redfish VPD ${component} ${component_uri} SerialNumber |
| 40 | |
| 41 | |
| 42 | Verify Redfish VPD |
| 43 | [Documentation] Verify Redfish VPD of given URI. |
| 44 | [Arguments] ${component} ${component_uri} ${field} |
| 45 | # Description of arguments: |
| 46 | # component_uri Redfish VPD uri (e.g. /redfish/v1/Systems/system/Processors/cpu1). |
| 47 | # field Redfish VPD field (Model) |
| 48 | |
| 49 | ${resp}= Redfish.Get Properties ${component_uri} |
| 50 | |
| 51 | ${vpd_field}= Set Variable If |
| 52 | ... '${field}' == 'Model' CC |
| 53 | ... '${field}' == 'PartNumber' PN |
| 54 | ... '${field}' == 'SerialNumber' SN |
| 55 | ... '${field}' == 'SparePartNumber' FN |
| 56 | ... '${field}' == 'Location' LocationCode |
| 57 | |
| 58 | ${vpd_component}= Set Variable If |
| 59 | ... '${component}' == 'CPU' /system/chassis/motherboard/cpu0 |
| 60 | ... '${component}' == 'Chassis' /system/chassis |
| 61 | ... '${component}' == 'BMC' /system/chassis/motherboard/ebmc_card_bmc |
Rahul Maheshwari | c0df92e | 2021-06-23 23:57:24 -0500 | [diff] [blame] | 62 | ... '${component}' == 'System' /system |
Rahul Maheshwari | 037407d | 2021-05-12 23:54:11 -0500 | [diff] [blame] | 63 | |
| 64 | ${vpd_records}= Vpdtool -r -O ${vpd_component} -R VINI -K ${vpd_field} |
| 65 | Should Be Equal As Strings ${resp["SerialNumber"]} ${vpd_records['${vpd_component}']['${vpd_field}']} |