18f254b53SSushma M M*** Settings ***
28f254b53SSushma M MDocumentation  Test IPMI FRU data.
38f254b53SSushma M M
4e4a7549cSGeorge 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
178f254b53SSushma M M*** Test Cases ***
188f254b53SSushma M M
198f254b53SSushma M MTest FRU Info Of Power Supplies
208f254b53SSushma M M    [Documentation]  Verify FRU info of power supply via IPMI and Redfish.
218f254b53SSushma M M    [Tags]  Test_FRU_Info_Of_Power_Supplies
228f254b53SSushma M M
238f254b53SSushma M M    # IPMI FRU info.
248f254b53SSushma M M    ${ipmi_fru_component_info}=  Get Component FRU Info  powersupply
258f254b53SSushma M M    ...  ${fru_objs}
268f254b53SSushma M M
278f254b53SSushma M M    # Redfish FRU info.
288f254b53SSushma M M    ${redfish_power_details}=  Redfish.Get Properties  /redfish/v1/Chassis/chassis/Power
298f254b53SSushma M M    ${redfish_power_supply_reading}=  Set Variable  ${redfish_power_details['PowerSupplies']}
308f254b53SSushma M M
318f254b53SSushma M M    Verify IPMI and Redfish subcomponents  ${redfish_power_supply_reading}
328f254b53SSushma M M    ...  ${ipmi_fru_component_info}
338f254b53SSushma M M
348f254b53SSushma M M*** Keywords ***
358f254b53SSushma M M
368f254b53SSushma M MVerify IPMI and Redfish subcomponents
378f254b53SSushma M M    [Documentation]  Get IPMI And Redfish subcomponents of FRU and verify.
388f254b53SSushma M M    [Arguments]  ${redfish_fru_info}  ${ipmi_fru_info}
398f254b53SSushma M M
408f254b53SSushma M M    # Description of argument(s):
418f254b53SSushma M M    # ${ipmi_fru_info}       IPMI FRU component values.
428f254b53SSushma M M    # ${redfish_fru_info}    Redfish FRU component values.
438f254b53SSushma M M
448f254b53SSushma M M    ${sub_component_count}=  Get Length  ${redfish_fru_info}
458f254b53SSushma M M
468f254b53SSushma M M    # Fetch each subcomponent value of IPMI and Redfish and compare.
478f254b53SSushma M M    FOR  ${sub_component_index}  IN RANGE  0  ${sub_component_count}
488f254b53SSushma M M      ${ipmi_fru_sub_component}=
498f254b53SSushma M M      ...  Get From List  ${ipmi_fru_info}  ${sub_component_index}
508f254b53SSushma M M      ${redfish_fru_sub_component}=
518f254b53SSushma M M      ...  Get From List  ${redfish_fru_info}  ${sub_component_index}
528f254b53SSushma M M      Compare IPMI And Redfish FRU Component  ${ipmi_fru_sub_component}
538f254b53SSushma M M      ...  ${redfish_fru_sub_component}
548f254b53SSushma M M    END
558f254b53SSushma M M
568f254b53SSushma M M
578f254b53SSushma M MCompare IPMI And Redfish FRU Component
588f254b53SSushma M M    [Documentation]  Compare IPMI And Redfish FRU Component data objects.
598f254b53SSushma M M    [Arguments]  ${ipmi_fru_component_obj}  ${redfish_fru_component_obj}
608f254b53SSushma M M
618f254b53SSushma M M    # Description of argument(s):
628f254b53SSushma M M    # ${ipmi_fru_component_obj}  IPMI FRU component data in dictionary.
638f254b53SSushma M M    # Example:
648f254b53SSushma M M    # FRU Device Description : powersupply0 (ID 75)
658f254b53SSushma M M    # Board Mfg Date        : Sun Dec 31 18:00:00 1995
668f254b53SSushma M M    # Board Product         : powersupply0
678f254b53SSushma M M    # Board Serial          : 71G303
688f254b53SSushma M M    # Board Part Number     : 01KL471
698f254b53SSushma M M    # ${redfish_fru_component_obj}  Redfish FRU component data in dictionary.
708f254b53SSushma M M    # Example:
718f254b53SSushma M M    # "Name": "powersupply0",
728f254b53SSushma M M    # "PartNumber": "01KL471",
738f254b53SSushma M M    # "PowerInputWatts": 114.0,
748f254b53SSushma M M    # "SerialNumber": "71G303",
758f254b53SSushma M M
768f254b53SSushma M M    # Get key_map from ipmi_redfish_fru_field_map.
778f254b53SSushma M M    ${key_map}=  Get Dictionary Items   ${ipmi_redfish_fru_field_map}
788f254b53SSushma M M
798f254b53SSushma M M    FOR    ${key}    ${value}    IN    @{key_map}
80*bd0fcfc6SSushma M M      Exit For Loop IF    "${value}" == "${EMPTY}"
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