Rahul Maheshwari | 38b3d72 | 2020-04-06 00:43:34 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation This suite tests Vital Product Data (VPD) via busctl command. |
Rahul Maheshwari | 83b2f10 | 2020-12-02 05:39:50 -0600 | [diff] [blame] | 3 | ... Before running this suite, create a data/vpd_data.py file with |
| 4 | ... all VPD data to verify from system. |
| 5 | ... |
George Keishing | e7e9171 | 2021-09-03 11:28:44 -0500 | [diff] [blame] | 6 | ... #!/usr/bin/env python3 |
Rahul Maheshwari | 83b2f10 | 2020-12-02 05:39:50 -0600 | [diff] [blame] | 7 | ... VPD_DETAILS = { |
| 8 | ... "/system/chassis/motherboard": { |
| 9 | ... "DR": "SYSTEM BACKPLANE", |
| 10 | ... "LocationCode": "ABCD.EF1.1234567-P0", |
| 11 | ... "PN": "PN12345", |
| 12 | ... "SN": "SN1234567890", |
| 13 | ... }, |
| 14 | ... "/system/chassis/motherboard/base_op_panel_blyth": { |
| 15 | ... "DR": "CEC OP PANEL", |
| 16 | ... "LocationCode": "ABCD.EF1.1234567-D0", |
| 17 | ... "PN": "PN12345", |
| 18 | ... "SN": "SN1234567890", |
| 19 | ... } |
| 20 | ... } |
Rahul Maheshwari | 38b3d72 | 2020-04-06 00:43:34 -0500 | [diff] [blame] | 21 | |
| 22 | Variables ../../data/vpd_data.py |
| 23 | Resource ../../lib/openbmc_ffdc.robot |
| 24 | |
| 25 | Test Teardown FFDC On Test Case Fail |
| 26 | |
| 27 | |
| 28 | *** Variables *** |
| 29 | |
| 30 | ${CMD_INVENTORY_PREFIX} busctl get-property xyz.openbmc_project.Inventory.Manager |
| 31 | ... /xyz/openbmc_project/inventory |
| 32 | |
| 33 | |
| 34 | *** Test Cases *** |
| 35 | |
Rahul Maheshwari | 83b2f10 | 2020-12-02 05:39:50 -0600 | [diff] [blame] | 36 | Verify Vital Product Data |
Rahul Maheshwari | 38b3d72 | 2020-04-06 00:43:34 -0500 | [diff] [blame] | 37 | [Documentation] Verify VPD via busctl command. |
Rahul Maheshwari | 83b2f10 | 2020-12-02 05:39:50 -0600 | [diff] [blame] | 38 | [Tags] Verify_Vital_Product_Data |
Rahul Maheshwari | 38b3d72 | 2020-04-06 00:43:34 -0500 | [diff] [blame] | 39 | |
Rahul Maheshwari | 83b2f10 | 2020-12-02 05:39:50 -0600 | [diff] [blame] | 40 | ${components}= Get Dictionary Keys ${VPD_DETAILS} |
| 41 | FOR ${component} IN @{components} |
| 42 | Verify VPD Via Busctl ${component} |
| 43 | END |
Rahul Maheshwari | 38b3d72 | 2020-04-06 00:43:34 -0500 | [diff] [blame] | 44 | |
| 45 | |
| 46 | *** Keywords *** |
| 47 | |
| 48 | Verify VPD Via Busctl |
| 49 | [Documentation] Verify VPD details via busctl. |
| 50 | [Arguments] ${component} |
| 51 | |
| 52 | # Description of argument(s): |
| 53 | # component VPD component (e.g. /system/chassis/motherboard/vdd_vrm1). |
| 54 | |
| 55 | # Verify Location code |
| 56 | ${busctl_output}= BMC Execute Command |
| 57 | ... ${CMD_INVENTORY_PREFIX}${component} com.ibm.ipzvpd.Location LocationCode |
| 58 | Should Be Equal ${busctl_output[0].split('"')[1].strip('"')} |
| 59 | ... ${VPD_DETAILS['${component}']['LocationCode']} |
| 60 | |
Rahul Maheshwari | 8347a7a | 2020-12-14 01:23:06 -0600 | [diff] [blame] | 61 | # Skip check for other VPD fields if its an ethernet component. |
| 62 | ${status}= Run Keyword And Return Status Should Contain ${component} ethernet |
| 63 | Return From Keyword If '${status}' == 'True' |
| 64 | |
Rahul Maheshwari | 38b3d72 | 2020-04-06 00:43:34 -0500 | [diff] [blame] | 65 | # Verify PrettyName |
| 66 | ${busctl_output}= BMC Execute Command |
| 67 | ... ${CMD_INVENTORY_PREFIX}${component} xyz.openbmc_project.Inventory.Item PrettyName |
Rahul Maheshwari | 2ab8e05 | 2020-10-28 00:07:12 -0500 | [diff] [blame] | 68 | Should Contain ${busctl_output[0].split('"')[1].strip('"')} |
Rahul Maheshwari | 38b3d72 | 2020-04-06 00:43:34 -0500 | [diff] [blame] | 69 | ... ${VPD_DETAILS['${component}']['DR']} |
| 70 | |
| 71 | # Verify Part Number |
| 72 | ${busctl_output}= BMC Execute Command |
| 73 | ... ${CMD_INVENTORY_PREFIX}${component} xyz.openbmc_project.Inventory.Decorator.Asset PartNumber |
| 74 | Should Be Equal ${busctl_output[0].split('"')[1].strip('"')} |
| 75 | ... ${VPD_DETAILS['${component}']['PN']} |
| 76 | |
| 77 | # Verify Serial Number |
| 78 | ${busctl_output}= BMC Execute Command |
| 79 | ... ${CMD_INVENTORY_PREFIX}${component} xyz.openbmc_project.Inventory.Decorator.Asset SerialNumber |
| 80 | Should Be Equal ${busctl_output[0].split('"')[1].strip('"')} |
| 81 | ... ${VPD_DETAILS['${component}']['SN']} |