blob: 1f11b1866853a0f435fb9c85a64ab80a023100c6 [file] [log] [blame]
Rahul Maheshwari037407d2021-05-12 23:54:11 -05001*** Settings ***
2Documentation This suite tests Vital Product Data (VPD) using Redfish.
3
4Resource ../../lib/openbmc_ffdc.robot
5Library ../../lib/vpd_utils.py
6
Rahul Maheshwari8e72e3e2021-07-22 05:07:00 -05007Suite Setup Redfish.Login
8Suite Teardown Redfish.Logout
9Test Teardown FFDC On Test Case Fail
Rahul Maheshwari037407d2021-05-12 23:54:11 -050010
11
12*** Test Cases ***
13
14Verify VPD Data Via Redfish
15 [Documentation] Verify VPD details via Redfish output.
16 [Tags] Verify_VPD_Data_Via_Redfish
17 [Template] Verify Redfish VPD Data
18
19 # Component
20 BMC
21 Chassis
22 CPU
23
24
25*** Keywords ***
26
27Verify Redfish VPD Data
28 [Documentation] Verify Redfish VPD data of given component.
29 [Arguments] ${component}
30 # Description of arguments:
31 # component VPD component (e.g. /system/chassis/motherboard/vdd_vrm1).
32
33 ${component_uri}= Set Variable If
34 ... '${component}' == 'BMC' /redfish/v1/Managers/bmc
35 ... '${component}' == 'Chassis' /redfish/v1/Chassis/chassis
36 ... '${component}' == 'CPU' /redfish/v1/Systems/system/Processors/cpu0
37
38 # TODO: Currently serial number is verified. Verification for other fields will be added later.
39 Verify Redfish VPD ${component} ${component_uri} SerialNumber
40
41
42Verify Redfish VPD
43 [Documentation] Verify Redfish VPD of given URI.
44 [Arguments] ${component} ${component_uri} ${field}
45 # Description of arguments:
46 # component_uri Redfish VPD uri (e.g. /redfish/v1/Systems/system/Processors/cpu1).
47 # field Redfish VPD field (Model)
48
49 ${resp}= Redfish.Get Properties ${component_uri}
50
51 ${vpd_field}= Set Variable If
52 ... '${field}' == 'Model' CC
53 ... '${field}' == 'PartNumber' PN
54 ... '${field}' == 'SerialNumber' SN
55 ... '${field}' == 'SparePartNumber' FN
56 ... '${field}' == 'Location' LocationCode
57
58 ${vpd_component}= Set Variable If
59 ... '${component}' == 'CPU' /system/chassis/motherboard/cpu0
60 ... '${component}' == 'Chassis' /system/chassis
61 ... '${component}' == 'BMC' /system/chassis/motherboard/ebmc_card_bmc
Rahul Maheshwari037407d2021-05-12 23:54:11 -050062
63 ${vpd_records}= Vpdtool -r -O ${vpd_component} -R VINI -K ${vpd_field}
64 Should Be Equal As Strings ${resp["SerialNumber"]} ${vpd_records['${vpd_component}']['${vpd_field}']}