blob: a1368c374744c41c78ffd4b73763bb8da88b14c0 [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
Rahul Maheshwari3d8a9682021-08-23 07:53:41 -050014Verify BMC VPD Data Via Redfish
15 [Documentation] Verify BMC VPD details via Redfish output.
16 [Tags] Verify_BMC_VPD_Data_Via_Redfish
Rahul Maheshwari037407d2021-05-12 23:54:11 -050017 [Template] Verify Redfish VPD Data
18
Rahul Maheshwari3d8a9682021-08-23 07:53:41 -050019 # Component Field
20 BMC Model
21 BMC PartNumber
22 BMC SerialNumber
23 BMC SparePartNumber
24 BMC Location
25
26
27Verify Chassis VPD Data Via Redfish
28 [Documentation] Verify Chassis VPD details via Redfish output.
29 [Tags] Verify_Chassis_VPD_Data_Via_Redfish
30 [Template] Verify Redfish VPD Data
31
32 # Skipping chassis's spare part number test because it has issue.
33 # Component Field
34 Chassis Model
35 Chassis PartNumber
36 Chassis SerialNumber
37 #Chassis SparePartNumber
38 Chassis Location
39
40
41Verify CPU VPD Data Via Redfish
42 [Documentation] Verify CPU VPD details via Redfish output.
43 [Tags] Verify_CPU_VPD_Data_Via_Redfish
44 [Template] Verify Redfish VPD Data
45
46 # Component Field
47 CPU Model
48 CPU PartNumber
49 CPU SerialNumber
50 CPU SparePartNumber
51 CPU Location
Rahul Maheshwari037407d2021-05-12 23:54:11 -050052
53
54*** Keywords ***
55
56Verify Redfish VPD Data
57 [Documentation] Verify Redfish VPD data of given component.
Rahul Maheshwari3d8a9682021-08-23 07:53:41 -050058 [Arguments] ${component} ${field}
Rahul Maheshwari037407d2021-05-12 23:54:11 -050059 # Description of arguments:
60 # component VPD component (e.g. /system/chassis/motherboard/vdd_vrm1).
Rahul Maheshwari3d8a9682021-08-23 07:53:41 -050061 # field VPD field (e.g. Model, PartNumber etc.).
Rahul Maheshwari037407d2021-05-12 23:54:11 -050062
63 ${component_uri}= Set Variable If
64 ... '${component}' == 'BMC' /redfish/v1/Managers/bmc
65 ... '${component}' == 'Chassis' /redfish/v1/Chassis/chassis
66 ... '${component}' == 'CPU' /redfish/v1/Systems/system/Processors/cpu0
67
Rahul Maheshwari037407d2021-05-12 23:54:11 -050068 ${resp}= Redfish.Get Properties ${component_uri}
Rahul Maheshwari037407d2021-05-12 23:54:11 -050069 ${vpd_field}= Set Variable If
70 ... '${field}' == 'Model' CC
71 ... '${field}' == 'PartNumber' PN
72 ... '${field}' == 'SerialNumber' SN
73 ... '${field}' == 'SparePartNumber' FN
74 ... '${field}' == 'Location' LocationCode
75
76 ${vpd_component}= Set Variable If
77 ... '${component}' == 'CPU' /system/chassis/motherboard/cpu0
78 ... '${component}' == 'Chassis' /system/chassis
79 ... '${component}' == 'BMC' /system/chassis/motherboard/ebmc_card_bmc
Rahul Maheshwari037407d2021-05-12 23:54:11 -050080
Rahul Maheshwari3d8a9682021-08-23 07:53:41 -050081 ${vpd_records}= Vpdtool -o -O ${vpd_component}
82
83 Run Keyword if '${field}' == 'Location'
84 ... Should Be Equal As Strings ${resp["Location"]["PartLocation"]["ServiceLabel"]}
85 ... ${vpd_records['${vpd_component}']['${vpd_field}']}
86 ... ELSE
87 ... Should Be Equal As Strings ${resp["${field}"]} ${vpd_records['${vpd_component}']['${vpd_field}']}