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 | |
| 54 | *** Keywords *** |
| 55 | |
| 56 | Verify Redfish VPD Data |
| 57 | [Documentation] Verify Redfish VPD data of given component. |
Rahul Maheshwari | 3d8a968 | 2021-08-23 07:53:41 -0500 | [diff] [blame] | 58 | [Arguments] ${component} ${field} |
Rahul Maheshwari | 037407d | 2021-05-12 23:54:11 -0500 | [diff] [blame] | 59 | # Description of arguments: |
| 60 | # component VPD component (e.g. /system/chassis/motherboard/vdd_vrm1). |
Rahul Maheshwari | 3d8a968 | 2021-08-23 07:53:41 -0500 | [diff] [blame] | 61 | # field VPD field (e.g. Model, PartNumber etc.). |
Rahul Maheshwari | 037407d | 2021-05-12 23:54:11 -0500 | [diff] [blame] | 62 | |
| 63 | ${component_uri}= Set Variable If |
| 64 | ... '${component}' == 'BMC' /redfish/v1/Managers/bmc |
| 65 | ... '${component}' == 'Chassis' /redfish/v1/Chassis/chassis |
| 66 | ... '${component}' == 'CPU' /redfish/v1/Systems/system/Processors/cpu0 |
| 67 | |
Rahul Maheshwari | 037407d | 2021-05-12 23:54:11 -0500 | [diff] [blame] | 68 | ${resp}= Redfish.Get Properties ${component_uri} |
Rahul Maheshwari | 037407d | 2021-05-12 23:54:11 -0500 | [diff] [blame] | 69 | ${vpd_field}= Set Variable If |
| 70 | ... '${field}' == 'Model' CC |
| 71 | ... '${field}' == 'PartNumber' PN |
| 72 | ... '${field}' == 'SerialNumber' SN |
| 73 | ... '${field}' == 'SparePartNumber' FN |
| 74 | ... '${field}' == 'Location' LocationCode |
| 75 | |
| 76 | ${vpd_component}= Set Variable If |
| 77 | ... '${component}' == 'CPU' /system/chassis/motherboard/cpu0 |
| 78 | ... '${component}' == 'Chassis' /system/chassis |
| 79 | ... '${component}' == 'BMC' /system/chassis/motherboard/ebmc_card_bmc |
Rahul Maheshwari | 037407d | 2021-05-12 23:54:11 -0500 | [diff] [blame] | 80 | |
Rahul Maheshwari | 3d8a968 | 2021-08-23 07:53:41 -0500 | [diff] [blame] | 81 | ${vpd_records}= Vpdtool -o -O ${vpd_component} |
| 82 | |
| 83 | Run Keyword if '${field}' == 'Location' |
| 84 | ... Should Be Equal As Strings ${resp["Location"]["PartLocation"]["ServiceLabel"]} |
| 85 | ... ${vpd_records['${vpd_component}']['${vpd_field}']} |
| 86 | ... ELSE |
| 87 | ... Should Be Equal As Strings ${resp["${field}"]} ${vpd_records['${vpd_component}']['${vpd_field}']} |