| Sushma M M | 8f254b5 | 2020-04-23 06:16:39 -0500 | [diff] [blame] | 1 | *** Settings *** | 
|  | 2 | Documentation  Test IPMI FRU data. | 
|  | 3 |  | 
| George Keishing | e4a7549 | 2020-05-13 13:56:09 -0500 | [diff] [blame] | 4 | Resource               ../lib/ipmi_client.robot | 
| Sushma M M | 8f254b5 | 2020-04-23 06:16:39 -0500 | [diff] [blame] | 5 | Resource               ../lib/openbmc_ffdc.robot | 
|  | 6 | Library                ../lib/ipmi_utils.py | 
|  | 7 |  | 
|  | 8 |  | 
|  | 9 | Suite Setup            Suite Setup Execution | 
|  | 10 | Suite Teardown         Suite Teardown Execution | 
|  | 11 | Test Teardown          Test Teardown Execution | 
|  | 12 |  | 
| Matt Fischer | 6fb70d9 | 2023-10-24 19:06:33 -0600 | [diff] [blame] | 13 | Test Tags             IPMI_FRU | 
| Sushma M M | 8f254b5 | 2020-04-23 06:16:39 -0500 | [diff] [blame] | 14 |  | 
|  | 15 | *** Variables *** | 
| George Keishing | 87dc442 | 2023-10-20 12:56:30 +0530 | [diff] [blame] | 16 |  | 
| srichn28 | 7c51c15 | 2022-10-16 23:39:29 -0500 | [diff] [blame] | 17 | &{ipmi_redfish_fru_field_map}  product_serial=SerialNumber  product_part_number=PartNumber | 
| Sushma M M | 8f254b5 | 2020-04-23 06:16:39 -0500 | [diff] [blame] | 18 |  | 
|  | 19 | *** Test Cases *** | 
|  | 20 |  | 
|  | 21 | Test FRU Info Of Power Supplies | 
|  | 22 | [Documentation]  Verify FRU info of power supply via IPMI and Redfish. | 
|  | 23 | [Tags]  Test_FRU_Info_Of_Power_Supplies | 
|  | 24 |  | 
|  | 25 | # IPMI FRU info. | 
| Tony Lee | 79940a5 | 2021-10-12 17:04:13 +0800 | [diff] [blame] | 26 | ${ipmi_fru_component_info}=  Get Component FRU Info  ${COMPONENT_NAME_OF_POWER_SUPPLY} | 
| Sushma M M | 8f254b5 | 2020-04-23 06:16:39 -0500 | [diff] [blame] | 27 | ...  ${fru_objs} | 
|  | 28 |  | 
|  | 29 | # Redfish FRU info. | 
| George Keishing | a91601b | 2023-03-21 09:35:49 +0530 | [diff] [blame] | 30 | ${redfish_power_details}=  Redfish.Get Members List | 
|  | 31 | ...  /redfish/v1/Chassis/${CHASSIS_ID}/PowerSubsystem/PowerSupplies | 
| srichn28 | 7c51c15 | 2022-10-16 23:39:29 -0500 | [diff] [blame] | 32 | ${redfish_power_dict}=  Create List | 
|  | 33 | FOR  ${power_supply}  IN  @{redfish_power_details} | 
|  | 34 | ${redfish_power_supply_reading}=  Redfish.Get Properties  ${power_supply} | 
|  | 35 | Append To List  ${redfish_power_dict}  ${redfish_power_supply_reading} | 
|  | 36 | END | 
|  | 37 | Verify IPMI and Redfish subcomponents  ${redfish_power_dict} | 
| Sushma M M | 8f254b5 | 2020-04-23 06:16:39 -0500 | [diff] [blame] | 38 | ...  ${ipmi_fru_component_info} | 
|  | 39 |  | 
|  | 40 | *** Keywords *** | 
|  | 41 |  | 
|  | 42 | Verify IPMI and Redfish subcomponents | 
|  | 43 | [Documentation]  Get IPMI And Redfish subcomponents of FRU and verify. | 
|  | 44 | [Arguments]  ${redfish_fru_info}  ${ipmi_fru_info} | 
|  | 45 |  | 
|  | 46 | # Description of argument(s): | 
|  | 47 | # ${ipmi_fru_info}       IPMI FRU component values. | 
|  | 48 | # ${redfish_fru_info}    Redfish FRU component values. | 
|  | 49 |  | 
|  | 50 | ${sub_component_count}=  Get Length  ${redfish_fru_info} | 
|  | 51 |  | 
|  | 52 | # Fetch each subcomponent value of IPMI and Redfish and compare. | 
|  | 53 | FOR  ${sub_component_index}  IN RANGE  0  ${sub_component_count} | 
|  | 54 | ${ipmi_fru_sub_component}= | 
|  | 55 | ...  Get From List  ${ipmi_fru_info}  ${sub_component_index} | 
|  | 56 | ${redfish_fru_sub_component}= | 
|  | 57 | ...  Get From List  ${redfish_fru_info}  ${sub_component_index} | 
|  | 58 | Compare IPMI And Redfish FRU Component  ${ipmi_fru_sub_component} | 
|  | 59 | ...  ${redfish_fru_sub_component} | 
|  | 60 | END | 
|  | 61 |  | 
|  | 62 |  | 
|  | 63 | Compare IPMI And Redfish FRU Component | 
|  | 64 | [Documentation]  Compare IPMI And Redfish FRU Component data objects. | 
|  | 65 | [Arguments]  ${ipmi_fru_component_obj}  ${redfish_fru_component_obj} | 
|  | 66 |  | 
|  | 67 | # Description of argument(s): | 
|  | 68 | # ${ipmi_fru_component_obj}  IPMI FRU component data in dictionary. | 
|  | 69 | # Example: | 
|  | 70 | # FRU Device Description : powersupply0 (ID 75) | 
|  | 71 | # Board Mfg Date        : Sun Dec 31 18:00:00 1995 | 
|  | 72 | # Board Product         : powersupply0 | 
|  | 73 | # Board Serial          : 71G303 | 
|  | 74 | # Board Part Number     : 01KL471 | 
|  | 75 | # ${redfish_fru_component_obj}  Redfish FRU component data in dictionary. | 
|  | 76 | # Example: | 
|  | 77 | # "Name": "powersupply0", | 
|  | 78 | # "PartNumber": "01KL471", | 
|  | 79 | # "PowerInputWatts": 114.0, | 
|  | 80 | # "SerialNumber": "71G303", | 
|  | 81 |  | 
|  | 82 | # Get key_map from ipmi_redfish_fru_field_map. | 
|  | 83 | ${key_map}=  Get Dictionary Items   ${ipmi_redfish_fru_field_map} | 
|  | 84 |  | 
|  | 85 | FOR    ${key}    ${value}    IN    @{key_map} | 
| George Keishing | 3a15f82 | 2025-06-17 22:17:48 +0530 | [diff] [blame] | 86 | IF  "${value}" == "${EMPTY}"  BREAK | 
| Nandish-Matti | 66023b8 | 2023-04-07 01:09:04 -0500 | [diff] [blame] | 87 | FOR  ${ipmi_fru_component}  IN  ${ipmi_fru_component_obj} | 
|  | 88 | FOR  ${redfish_fru_component}  IN  ${redfish_fru_component_obj} | 
| Sridevi Ramesh | c6e7f93 | 2025-05-07 11:26:54 -0500 | [diff] [blame] | 89 | IF  '${ipmi_fru_component['product_name']}' == '${redfish_fru_component['Name']}' | 
|  | 90 | Should Contain  ${redfish_fru_component_obj['${value}']} | 
|  | 91 | ...  ${ipmi_fru_component_obj['${key}']}  msg=Comparison failed. | 
|  | 92 | END | 
| Nandish-Matti | 66023b8 | 2023-04-07 01:09:04 -0500 | [diff] [blame] | 93 | END | 
|  | 94 | END | 
| Sushma M M | 8f254b5 | 2020-04-23 06:16:39 -0500 | [diff] [blame] | 95 | END | 
|  | 96 |  | 
|  | 97 |  | 
|  | 98 | Suite Setup Execution | 
|  | 99 | [Documentation]  Do test setup initialization. | 
|  | 100 |  | 
| srichn28 | 7c51c15 | 2022-10-16 23:39:29 -0500 | [diff] [blame] | 101 | ${status}  ${fru_objs}=  Run Keyword And Ignore Error  Get Fru Info | 
|  | 102 | Log To Console  FRU: ${fru_objs} | 
| Sushma M M | 8f254b5 | 2020-04-23 06:16:39 -0500 | [diff] [blame] | 103 | Set Suite Variable  ${fru_objs} | 
|  | 104 | Redfish.Login | 
|  | 105 |  | 
|  | 106 |  | 
|  | 107 | Suite Teardown Execution | 
|  | 108 | [Documentation]  Do the post suite teardown. | 
|  | 109 |  | 
|  | 110 | Redfish.Logout | 
|  | 111 |  | 
|  | 112 |  | 
|  | 113 | Test Teardown Execution | 
|  | 114 | [Documentation]  Do the post test teardown. | 
|  | 115 |  | 
| srichn28 | 7c51c15 | 2022-10-16 23:39:29 -0500 | [diff] [blame] | 116 | FFDC On Test Case Fail |