18f254b53SSushma M M*** Settings ***
28f254b53SSushma M MDocumentation  Test IPMI FRU data.
38f254b53SSushma M M
4*e4a7549cSGeorge KeishingResource               ../lib/ipmi_client.robot
58f254b53SSushma M MResource               ../lib/openbmc_ffdc.robot
68f254b53SSushma M MLibrary                ../lib/ipmi_utils.py
78f254b53SSushma M M
88f254b53SSushma M M
98f254b53SSushma M MSuite Setup            Suite Setup Execution
108f254b53SSushma M MSuite Teardown         Suite Teardown Execution
118f254b53SSushma M MTest Teardown          Test Teardown Execution
128f254b53SSushma M M
138f254b53SSushma M M
148f254b53SSushma M M*** Variables ***
158f254b53SSushma M M&{ipmi_redfish_fru_field_map}  board_serial=SerialNumber  board_part_number=PartNumber
168f254b53SSushma M M...  board_product=Name
178f254b53SSushma M M
188f254b53SSushma M M*** Test Cases ***
198f254b53SSushma M M
208f254b53SSushma M MTest FRU Info Of Power Supplies
218f254b53SSushma M M    [Documentation]  Verify FRU info of power supply via IPMI and Redfish.
228f254b53SSushma M M    [Tags]  Test_FRU_Info_Of_Power_Supplies
238f254b53SSushma M M
248f254b53SSushma M M    # IPMI FRU info.
258f254b53SSushma M M    ${ipmi_fru_component_info}=  Get Component FRU Info  powersupply
268f254b53SSushma M M    ...  ${fru_objs}
278f254b53SSushma M M
288f254b53SSushma M M    # Redfish FRU info.
298f254b53SSushma M M    ${redfish_power_details}=  Redfish.Get Properties  /redfish/v1/Chassis/chassis/Power
308f254b53SSushma M M    ${redfish_power_supply_reading}=  Set Variable  ${redfish_power_details['PowerSupplies']}
318f254b53SSushma M M
328f254b53SSushma M M    Verify IPMI and Redfish subcomponents  ${redfish_power_supply_reading}
338f254b53SSushma M M    ...  ${ipmi_fru_component_info}
348f254b53SSushma M M
358f254b53SSushma M M*** Keywords ***
368f254b53SSushma M M
378f254b53SSushma M MVerify IPMI and Redfish subcomponents
388f254b53SSushma M M    [Documentation]  Get IPMI And Redfish subcomponents of FRU and verify.
398f254b53SSushma M M    [Arguments]  ${redfish_fru_info}  ${ipmi_fru_info}
408f254b53SSushma M M
418f254b53SSushma M M    # Description of argument(s):
428f254b53SSushma M M    # ${ipmi_fru_info}       IPMI FRU component values.
438f254b53SSushma M M    # ${redfish_fru_info}    Redfish FRU component values.
448f254b53SSushma M M
458f254b53SSushma M M    ${sub_component_count}=  Get Length  ${redfish_fru_info}
468f254b53SSushma M M
478f254b53SSushma M M    # Fetch each subcomponent value of IPMI and Redfish and compare.
488f254b53SSushma M M    FOR  ${sub_component_index}  IN RANGE  0  ${sub_component_count}
498f254b53SSushma M M      ${ipmi_fru_sub_component}=
508f254b53SSushma M M      ...  Get From List  ${ipmi_fru_info}  ${sub_component_index}
518f254b53SSushma M M      ${redfish_fru_sub_component}=
528f254b53SSushma M M      ...  Get From List  ${redfish_fru_info}  ${sub_component_index}
538f254b53SSushma M M      Compare IPMI And Redfish FRU Component  ${ipmi_fru_sub_component}
548f254b53SSushma M M      ...  ${redfish_fru_sub_component}
558f254b53SSushma M M    END
568f254b53SSushma M M
578f254b53SSushma M M
588f254b53SSushma M MCompare IPMI And Redfish FRU Component
598f254b53SSushma M M    [Documentation]  Compare IPMI And Redfish FRU Component data objects.
608f254b53SSushma M M    [Arguments]  ${ipmi_fru_component_obj}  ${redfish_fru_component_obj}
618f254b53SSushma M M
628f254b53SSushma M M    # Description of argument(s):
638f254b53SSushma M M    # ${ipmi_fru_component_obj}  IPMI FRU component data in dictionary.
648f254b53SSushma M M    # Example:
658f254b53SSushma M M    # FRU Device Description : powersupply0 (ID 75)
668f254b53SSushma M M    # Board Mfg Date        : Sun Dec 31 18:00:00 1995
678f254b53SSushma M M    # Board Product         : powersupply0
688f254b53SSushma M M    # Board Serial          : 71G303
698f254b53SSushma M M    # Board Part Number     : 01KL471
708f254b53SSushma M M    # ${redfish_fru_component_obj}  Redfish FRU component data in dictionary.
718f254b53SSushma M M    # Example:
728f254b53SSushma M M    # "Name": "powersupply0",
738f254b53SSushma M M    # "PartNumber": "01KL471",
748f254b53SSushma M M    # "PowerInputWatts": 114.0,
758f254b53SSushma M M    # "SerialNumber": "71G303",
768f254b53SSushma M M
778f254b53SSushma M M    # Get key_map from ipmi_redfish_fru_field_map.
788f254b53SSushma M M    ${key_map}=  Get Dictionary Items   ${ipmi_redfish_fru_field_map}
798f254b53SSushma M M
808f254b53SSushma M M    FOR    ${key}    ${value}    IN    @{key_map}
818f254b53SSushma M M      Should Contain  ${redfish_fru_component_obj['${value}']}
828f254b53SSushma M M      ...  ${ipmi_fru_component_obj['${key}']}
838f254b53SSushma M M      ...  msg=Comparison failed.
848f254b53SSushma M M    END
858f254b53SSushma M M
868f254b53SSushma M M
878f254b53SSushma M MSuite Setup Execution
888f254b53SSushma M M    [Documentation]  Do test setup initialization.
898f254b53SSushma M M
908f254b53SSushma M M    ${fru_objs}=  Get Fru Info
918f254b53SSushma M M    Set Suite Variable  ${fru_objs}
928f254b53SSushma M M    Redfish.Login
938f254b53SSushma M M
948f254b53SSushma M M
958f254b53SSushma M MSuite Teardown Execution
968f254b53SSushma M M    [Documentation]  Do the post suite teardown.
978f254b53SSushma M M
988f254b53SSushma M M    Redfish.Logout
998f254b53SSushma M M
1008f254b53SSushma M M
1018f254b53SSushma M MTest Teardown Execution
1028f254b53SSushma M M    [Documentation]  Do the post test teardown.
1038f254b53SSushma M M
1048f254b53SSushma M M    FFDC On Test Case Fail
105