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