George Keishing | 578f646 | 2022-11-04 09:13:03 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Test IPMI sensor IDs. |
| 3 | |
| 4 | Resource ../../lib/rest_client.robot |
| 5 | Resource ../../lib/ipmi_client.robot |
| 6 | Resource ../../lib/openbmc_ffdc.robot |
| 7 | Resource ../../lib/boot_utils.robot |
| 8 | Resource ../../lib/bmc_redfish_resource.robot |
| 9 | |
| 10 | Suite setup Suite Setup Execution |
| 11 | Suite Teardown Redfish.Logout |
| 12 | Test Teardown Test Teardown Execution |
| 13 | |
George Keishing | 42c84ea | 2023-09-07 20:31:45 +0530 | [diff] [blame] | 14 | Force Tags Ipmi_Sdr |
George Keishing | 578f646 | 2022-11-04 09:13:03 -0500 | [diff] [blame] | 15 | |
| 16 | |
| 17 | *** Test Cases *** |
| 18 | |
| 19 | Test Turbo Allowed SDR Info |
| 20 | [Documentation] Verify turbo allowed SDR info via IPMI and Redfish. |
| 21 | [Tags] Test_Turbo_Allowed_SDR_Info |
| 22 | |
| 23 | ${component_uri_list}= Get Component URIs turbo_allowed |
| 24 | ${component_uri}= Get From List ${component_uri_list} 0 |
| 25 | ${state_rest}= Read Attribute ${component_uri} TurboAllowed |
| 26 | |
| 27 | ${state_ipmi}= Get SDR Presence Via IPMI turbo_allowed${SPACE} |
| 28 | |
| 29 | Run Keyword If '${state_ipmi}' == 'Disabled' |
| 30 | ... Should Be True ${state_rest} == ${0} |
| 31 | ... ELSE IF '${state_ipmi}' == 'State Asserted' |
| 32 | ... Should Be True ${state_rest} == ${1} |
| 33 | |
| 34 | |
| 35 | *** Keywords *** |
| 36 | |
| 37 | Get Component URIs |
| 38 | [Documentation] Get URIs for given component from given URIs |
| 39 | ... and return as a list. |
| 40 | [Arguments] ${component_name} ${uri_list}=${SYSTEM_URI} |
| 41 | |
| 42 | # A sample result returned for the "core" component: |
| 43 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core0 |
| 44 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core1 |
| 45 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core10 |
| 46 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core11 |
| 47 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core12 |
| 48 | # (etc.) |
| 49 | |
| 50 | # Description of argument(s): |
| 51 | # component_name Component name (e.g. "core", "dimm", etc.). |
| 52 | # uri_list URI list. |
| 53 | |
| 54 | ${component_uris}= Get Matches ${uri_list} |
| 55 | ... regexp=^.*[0-9a-z_].${component_name}\[_0-9a-z]*$ |
| 56 | ... case_insensitive=${True} |
| 57 | [Return] ${component_uris} |
| 58 | |
| 59 | |
| 60 | Get SDR Presence Via IPMI |
| 61 | [Documentation] Return presence info from IPMI sensor data record. |
| 62 | [Arguments] ${component_name} |
| 63 | |
| 64 | # Description of argument(s): |
| 65 | # component_name Component name (e.g. "cpu0_core0", "dimm0", etc.). |
| 66 | |
| 67 | # Example of IPMI SDR elist output. |
| 68 | # BootProgress | 03h | ok | 34.2 | |
| 69 | # OperatingSystemS | 05h | ok | 35.1 | boot completed - device not specified |
| 70 | # AttemptsLeft | 07h | ok | 34.1 | |
| 71 | # occ0 | 08h | ok | 210.1 | Device Disabled |
| 72 | # occ1 | 09h | ok | 210.2 | Device Disabled |
| 73 | # cpu0_core0 | 12h | ok | 208.1 | Presence detected |
| 74 | # cpu0_core1 | 15h | ok | 208.2 | Disabled |
| 75 | # cpu0_core2 | 18h | ok | 208.3 | Presence detected |
| 76 | # dimm0 | A6h | ok | 32.1 | Presence Detected |
| 77 | # dimm1 | A8h | ok | 32.2 | Presence Detected |
| 78 | # dimm2 | AAh | ok | 32.9 | Presence Detected |
| 79 | # gv100card0 | C5h | ok | 216.1 | 0 unspecified |
| 80 | # gv100card1 | C8h | ok | 216.2 | 0 unspecified |
| 81 | # TPMEnable | D7h | ok | 3.3 | State Asserted |
| 82 | # auto_reboot | DAh | ok | 33.2 | State Asserted |
| 83 | # volatile | DBh | ok | 33.1 | State Deasserted |
| 84 | |
| 85 | ${sdr_elist_output}= Run IPMI Standard Command sdr elist |
| 86 | ${sdr_component_line}= |
| 87 | ... Get Lines Containing String ${sdr_elist_output} ${component_name} |
| 88 | ... case-insensitive |
| 89 | |
| 90 | ${presence_ipmi}= Fetch From Right ${sdr_component_line} | |
| 91 | ${presence_ipmi}= Strip String ${presence_ipmi} |
| 92 | [Return] ${presence_ipmi} |
| 93 | |
| 94 | |
| 95 | Get SDR Record ID |
| 96 | [Documentation] Fetch one record ID from SDR elist IPMI cmd response. |
| 97 | |
| 98 | ${resp}= Run External IPMI Standard Command sdr elist |
| 99 | ${record_id}= Get Regexp Matches ${resp} \\|\\s+([0-9]+)h\\s+\\| 1 |
| 100 | |
| 101 | [Return] ${record_id[0]} |
| 102 | |
| 103 | |
| 104 | Suite Setup Execution |
| 105 | [Documentation] Do the initial suite setup. |
| 106 | |
| 107 | Redfish.Login |
| 108 | Redfish Power On stack_mode=skip quiet=1 |
| 109 | |
| 110 | ${record_id}= Get SDR Record ID |
| 111 | Set Suite Variable ${record_id} |
| 112 | |
| 113 | ${uri_list}= Read Properties ${OPENBMC_BASE_URI}list |
| 114 | Set Suite Variable ${SYSTEM_URI} ${uri_list} |
| 115 | Log ${uri_list} |
| 116 | |
| 117 | |
| 118 | Test Teardown Execution |
| 119 | [Documentation] Do the post test teardown. |
| 120 | |
| 121 | FFDC On Test Case Fail |