blob: e9467dfc7c0cb7369aa086408532ab5f97cb55bc [file] [log] [blame]
Rahul Maheshwarief003062020-03-23 07:17:16 -05001*** Settings ***
2Documentation This suite tests System Vital Product Data (VPD) using vpdtool.
3
4Library ../../lib/vpd_utils.py
5Variables ../../data/vpd_variables.py
Sridevi Ramesh87cfb9e2025-06-10 02:06:46 -05006
Rahul Maheshwarief003062020-03-23 07:17:16 -05007Resource ../../lib/openbmc_ffdc.robot
Sridevi Rameshf6304c62025-04-17 12:04:48 -05008Resource ../../lib/boot_utils.robot
Sridevi Ramesh87cfb9e2025-06-10 02:06:46 -05009Resource ../../lib/vpd_tool_resource.robot
Rahul Maheshwarief003062020-03-23 07:17:16 -050010
11Test Teardown FFDC On Test Case Fail
12
Sridevi Ramesh87cfb9e2025-06-10 02:06:46 -050013Test Tags VPD_Tool
Rahul Maheshwarief003062020-03-23 07:17:16 -050014
15*** Variables ***
16
17${CMD_GET_PROPERTY_INVENTORY} busctl get-property xyz.openbmc_project.Inventory.Manager
Rahul Maheshwarief003062020-03-23 07:17:16 -050018
19*** Test Cases ***
20
dnirmala348356a2023-03-06 04:52:56 -060021Verify System VPD Data Via Vpdtool
22 [Documentation] Verify the system VPD details via vpdtool output.
23 [Tags] Verify_System_VPD_Data_Via_Vpdtool
24 [Template] Verify VPD Data Via Vpdtool
Rahul Maheshwarief003062020-03-23 07:17:16 -050025
dnirmala348356a2023-03-06 04:52:56 -060026 # Component Field
27 System Model
28 System SerialNumber
29 System LocationCode
Rahul Maheshwarief003062020-03-23 07:17:16 -050030
31
32Verify VPD Component Read
dnirmala62a3b7d2023-03-16 01:17:05 -050033 [Documentation] Verify details of all VPD component via vpdtool.
Rahul Maheshwarief003062020-03-23 07:17:16 -050034 [Tags] Verify_VPD_Component_Read
35
dnirmala62a3b7d2023-03-16 01:17:05 -050036 ${vpd_records}= Vpdtool -i
37 ${components}= Get Dictionary Keys ${vpd_records}
Rahul Maheshwarief003062020-03-23 07:17:16 -050038 FOR ${component} IN @{components}
39 Verify VPD Component Read Operation ${component}
40 END
41
42
43Verify VPD Field Read
44 [Documentation] Verify reading VPD field value via vpdtool.
45 [Tags] Verify_VPD_Field_Read
46
dnirmala62a3b7d2023-03-16 01:17:05 -050047 ${vpd_records}= Vpdtool -i
48 ${components}= Get Dictionary Keys ${vpd_records}
Rahul Maheshwarief003062020-03-23 07:17:16 -050049 FOR ${component} IN @{components}
George Keishinge01ee582023-05-16 10:17:08 +053050 # Drive component field values response in ascii format
51 # due to that skipping here.
dnirmala62a3b7d2023-03-16 01:17:05 -050052 IF 'drive' in '${component}'
Sridevi Rameshc6e7f932025-05-07 11:26:54 -050053 CONTINUE
dnirmala62a3b7d2023-03-16 01:17:05 -050054 ELSE
55 Verify VPD Field Read Operation ${component}
56 END
Rahul Maheshwarief003062020-03-23 07:17:16 -050057 END
58
59
60Verify VPD Field Write
George Keishinge20f82c2020-05-13 10:51:02 -050061 [Documentation] Verify writing VPD field value via vpdtool.
Rahul Maheshwarief003062020-03-23 07:17:16 -050062 [Tags] Verify_VPD_Field_Write
63
Sridevi Rameshf6304c62025-04-17 12:04:48 -050064 # Put system to power off state before VPD write operation.
65 Redfish Power Off stack_mode=skip
66
Rahul Maheshwarief003062020-03-23 07:17:16 -050067 ${components}= Get Dictionary Keys ${VPD_DETAILS}
68 FOR ${component} IN @{components}
Rahul Maheshwari0ef1e152020-11-02 23:10:55 -060069 # VPD fields "DR", "CC" and "FN" will be added later.
70 @{vpd_fields}= Create List SN PN
71 ${field}= Evaluate random.choice($vpd_fields) random
72 Verify VPD Field Write Operation ${component} ${field}
Rahul Maheshwarief003062020-03-23 07:17:16 -050073 END