| Rahul Maheshwari | ef00306 | 2020-03-23 07:17:16 -0500 | [diff] [blame] | 1 | *** Settings *** | 
 | 2 | Documentation   This suite tests System Vital Product Data (VPD) using vpdtool. | 
 | 3 |  | 
 | 4 | Library         ../../lib/vpd_utils.py | 
 | 5 | Variables       ../../data/vpd_variables.py | 
| Sridevi Ramesh | 87cfb9e | 2025-06-10 02:06:46 -0500 | [diff] [blame] | 6 |  | 
| Rahul Maheshwari | ef00306 | 2020-03-23 07:17:16 -0500 | [diff] [blame] | 7 | Resource        ../../lib/openbmc_ffdc.robot | 
| Sridevi Ramesh | f6304c6 | 2025-04-17 12:04:48 -0500 | [diff] [blame] | 8 | Resource        ../../lib/boot_utils.robot | 
| Sridevi Ramesh | 87cfb9e | 2025-06-10 02:06:46 -0500 | [diff] [blame] | 9 | Resource        ../../lib/vpd_tool_resource.robot | 
| Rahul Maheshwari | ef00306 | 2020-03-23 07:17:16 -0500 | [diff] [blame] | 10 |  | 
 | 11 | Test Teardown   FFDC On Test Case Fail | 
 | 12 |  | 
| Sridevi Ramesh | 87cfb9e | 2025-06-10 02:06:46 -0500 | [diff] [blame] | 13 | Test Tags       VPD_Tool | 
| Rahul Maheshwari | ef00306 | 2020-03-23 07:17:16 -0500 | [diff] [blame] | 14 |  | 
 | 15 | *** Variables *** | 
 | 16 |  | 
 | 17 | ${CMD_GET_PROPERTY_INVENTORY}  busctl get-property xyz.openbmc_project.Inventory.Manager | 
| Rahul Maheshwari | ef00306 | 2020-03-23 07:17:16 -0500 | [diff] [blame] | 18 |  | 
 | 19 | *** Test Cases *** | 
 | 20 |  | 
| dnirmala | 348356a | 2023-03-06 04:52:56 -0600 | [diff] [blame] | 21 | Verify 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 Maheshwari | ef00306 | 2020-03-23 07:17:16 -0500 | [diff] [blame] | 25 |  | 
| dnirmala | 348356a | 2023-03-06 04:52:56 -0600 | [diff] [blame] | 26 |     # Component     Field | 
 | 27 |     System          Model | 
 | 28 |     System          SerialNumber | 
 | 29 |     System          LocationCode | 
| Rahul Maheshwari | ef00306 | 2020-03-23 07:17:16 -0500 | [diff] [blame] | 30 |  | 
 | 31 |  | 
 | 32 | Verify VPD Component Read | 
| dnirmala | 62a3b7d | 2023-03-16 01:17:05 -0500 | [diff] [blame] | 33 |     [Documentation]  Verify details of all VPD component via vpdtool. | 
| Rahul Maheshwari | ef00306 | 2020-03-23 07:17:16 -0500 | [diff] [blame] | 34 |     [Tags]  Verify_VPD_Component_Read | 
 | 35 |  | 
| dnirmala | 62a3b7d | 2023-03-16 01:17:05 -0500 | [diff] [blame] | 36 |     ${vpd_records}=  Vpdtool  -i | 
 | 37 |     ${components}=  Get Dictionary Keys  ${vpd_records} | 
| Rahul Maheshwari | ef00306 | 2020-03-23 07:17:16 -0500 | [diff] [blame] | 38 |     FOR  ${component}  IN  @{components} | 
 | 39 |         Verify VPD Component Read Operation  ${component} | 
 | 40 |     END | 
 | 41 |  | 
 | 42 |  | 
 | 43 | Verify VPD Field Read | 
 | 44 |     [Documentation]  Verify reading VPD field value via vpdtool. | 
 | 45 |     [Tags]  Verify_VPD_Field_Read | 
 | 46 |  | 
| dnirmala | 62a3b7d | 2023-03-16 01:17:05 -0500 | [diff] [blame] | 47 |     ${vpd_records}=  Vpdtool  -i | 
 | 48 |     ${components}=  Get Dictionary Keys  ${vpd_records} | 
| Rahul Maheshwari | ef00306 | 2020-03-23 07:17:16 -0500 | [diff] [blame] | 49 |     FOR  ${component}  IN  @{components} | 
| George Keishing | e01ee58 | 2023-05-16 10:17:08 +0530 | [diff] [blame] | 50 |        # Drive component field values response in ascii format | 
 | 51 |        # due to that skipping here. | 
| dnirmala | 62a3b7d | 2023-03-16 01:17:05 -0500 | [diff] [blame] | 52 |        IF  'drive' in '${component}' | 
| Sridevi Ramesh | c6e7f93 | 2025-05-07 11:26:54 -0500 | [diff] [blame] | 53 |            CONTINUE | 
| dnirmala | 62a3b7d | 2023-03-16 01:17:05 -0500 | [diff] [blame] | 54 |        ELSE | 
 | 55 |            Verify VPD Field Read Operation  ${component} | 
 | 56 |        END | 
| Rahul Maheshwari | ef00306 | 2020-03-23 07:17:16 -0500 | [diff] [blame] | 57 |     END | 
 | 58 |  | 
 | 59 |  | 
 | 60 | Verify VPD Field Write | 
| George Keishing | e20f82c | 2020-05-13 10:51:02 -0500 | [diff] [blame] | 61 |     [Documentation]  Verify writing VPD field value via vpdtool. | 
| Rahul Maheshwari | ef00306 | 2020-03-23 07:17:16 -0500 | [diff] [blame] | 62 |     [Tags]  Verify_VPD_Field_Write | 
 | 63 |  | 
| Sridevi Ramesh | f6304c6 | 2025-04-17 12:04:48 -0500 | [diff] [blame] | 64 |     # Put system to power off state before VPD write operation. | 
 | 65 |     Redfish Power Off  stack_mode=skip | 
 | 66 |  | 
| Rahul Maheshwari | ef00306 | 2020-03-23 07:17:16 -0500 | [diff] [blame] | 67 |     ${components}=  Get Dictionary Keys  ${VPD_DETAILS} | 
 | 68 |     FOR  ${component}  IN  @{components} | 
| Rahul Maheshwari | 0ef1e15 | 2020-11-02 23:10:55 -0600 | [diff] [blame] | 69 |         # 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 Maheshwari | ef00306 | 2020-03-23 07:17:16 -0500 | [diff] [blame] | 73 |     END |