blob: d12c163eafc2b773107a39e5826667f65055ffcb [file] [log] [blame]
Rahul Maheshwari38b3d722020-04-06 00:43:34 -05001*** Settings ***
2Documentation This suite tests Vital Product Data (VPD) via busctl command.
Rahul Maheshwari83b2f102020-12-02 05:39:50 -06003... Before running this suite, create a data/vpd_data.py file with
4... all VPD data to verify from system.
5...
George Keishinge7e91712021-09-03 11:28:44 -05006... #!/usr/bin/env python3
Rahul Maheshwari83b2f102020-12-02 05:39:50 -06007... 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 Maheshwari38b3d722020-04-06 00:43:34 -050021
22Variables ../../data/vpd_data.py
23Resource ../../lib/openbmc_ffdc.robot
24
25Test 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 Maheshwari83b2f102020-12-02 05:39:50 -060036Verify Vital Product Data
Rahul Maheshwari38b3d722020-04-06 00:43:34 -050037 [Documentation] Verify VPD via busctl command.
Rahul Maheshwari83b2f102020-12-02 05:39:50 -060038 [Tags] Verify_Vital_Product_Data
Rahul Maheshwari38b3d722020-04-06 00:43:34 -050039
Rahul Maheshwari83b2f102020-12-02 05:39:50 -060040 ${components}= Get Dictionary Keys ${VPD_DETAILS}
41 FOR ${component} IN @{components}
42 Verify VPD Via Busctl ${component}
43 END
Rahul Maheshwari38b3d722020-04-06 00:43:34 -050044
45
46*** Keywords ***
47
48Verify 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 Maheshwari8347a7a2020-12-14 01:23:06 -060061 # 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 Maheshwari38b3d722020-04-06 00:43:34 -050065 # Verify PrettyName
66 ${busctl_output}= BMC Execute Command
67 ... ${CMD_INVENTORY_PREFIX}${component} xyz.openbmc_project.Inventory.Item PrettyName
Rahul Maheshwari2ab8e052020-10-28 00:07:12 -050068 Should Contain ${busctl_output[0].split('"')[1].strip('"')}
Rahul Maheshwari38b3d722020-04-06 00:43:34 -050069 ... ${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']}