Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Test IPMI sensor IDs. |
| 3 | |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 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 |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 9 | |
| 10 | Suite setup Suite Setup Execution |
| 11 | Test Teardown Test Teardown Execution |
| 12 | |
| 13 | Force Tags SDR_Test |
| 14 | |
| 15 | |
| 16 | *** Test Cases *** |
| 17 | |
| 18 | |
| 19 | Test CPU Core SDR Info At Power On |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 20 | [Documentation] Verify CPU core SDR info via IPMI and Redfish at power on. |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 21 | |
| 22 | [Tags] Test_CPU_Core_SDR_Info_At_Power_On |
| 23 | |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 24 | Redfish Power On stack_mode=skip quiet=1 |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 25 | Test SDR Info core |
| 26 | |
| 27 | |
| 28 | Test DIMM SDR Info At Power On |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 29 | [Documentation] Verify DIMM SDR info via IPMI and Redfish at power on. |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 30 | |
| 31 | [Tags] Test_DIMM_SDR_Info_At_Power_On |
| 32 | |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 33 | Redfish Power On stack_mode=skip quiet=1 |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 34 | Test SDR Info dimm |
| 35 | |
Rahul Maheshwari | cd7b19c | 2018-04-10 07:35:56 -0500 | [diff] [blame] | 36 | |
| 37 | Test GPU SDR Info At Power On |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 38 | [Documentation] Verify GPU SDR info via IPMI and Redfish at power on. |
Rahul Maheshwari | cd7b19c | 2018-04-10 07:35:56 -0500 | [diff] [blame] | 39 | |
| 40 | [Tags] Test_GPU_SDR_Info_At_Power_On |
| 41 | |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 42 | Redfish Power On stack_mode=skip quiet=1 |
Rahul Maheshwari | cd7b19c | 2018-04-10 07:35:56 -0500 | [diff] [blame] | 43 | Test SDR Info gv100card |
| 44 | |
| 45 | |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 46 | Test CPU Core SDR Info At Power Off |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 47 | [Documentation] Verify CPU core SDR info via IPMI and Redfish at power off. |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 48 | |
| 49 | [Tags] Test_CPU_Core_SDR_Info_At_Power_Off |
| 50 | |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 51 | Redfish Hard Power Off stack_mode=skip quiet=1 |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 52 | Test SDR Info core |
| 53 | |
| 54 | |
| 55 | Test DIMM SDR Info At Power Off |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 56 | [Documentation] Verify DIMM SDR info via IPMI and Redfish at power off. |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 57 | |
| 58 | [Tags] Test_DIMM_SDR_Info_At_Power_Off |
| 59 | |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 60 | Redfish Hard Power Off stack_mode=skip quiet=1 |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 61 | Test SDR Info dimm |
| 62 | |
| 63 | |
Rahul Maheshwari | cd7b19c | 2018-04-10 07:35:56 -0500 | [diff] [blame] | 64 | Test Turbo Allowed SDR Info |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 65 | [Documentation] Verify turbo allowed SDR info via IPMI and Redfish. |
Rahul Maheshwari | cd7b19c | 2018-04-10 07:35:56 -0500 | [diff] [blame] | 66 | [Tags] Test_Turbo_Allowed_SDR_Info |
| 67 | |
| 68 | ${component_uri_list}= Get Component URIs turbo_allowed |
| 69 | ${component_uri}= Get From List ${component_uri_list} 0 |
| 70 | ${state_rest}= Read Attribute ${component_uri} TurboAllowed |
| 71 | |
| 72 | ${state_ipmi}= Get SDR Presence Via IPMI turbo_allowed${SPACE} |
| 73 | |
| 74 | Run Keyword If '${state_ipmi}' == 'Disabled' |
| 75 | ... Should Be True ${state_rest} == 0 |
| 76 | ... ELSE IF '${state_ipmi}' == 'State Asserted' |
| 77 | ... Should Be True ${state_rest} == 1 |
| 78 | |
| 79 | |
| 80 | Test Auto Reboot SDR Info |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 81 | [Documentation] Verify auto reboot SDR info via IPMI and Redfish. |
Rahul Maheshwari | cd7b19c | 2018-04-10 07:35:56 -0500 | [diff] [blame] | 82 | [Tags] Test_Auto_Reboot_SDR_Info |
| 83 | |
| 84 | |
| 85 | ${component_uri_list}= Get Component URIs auto_reboot |
| 86 | ${component_uri}= Get From List ${component_uri_list} 0 |
| 87 | ${state_rest}= Read Attribute ${component_uri} AutoReboot |
| 88 | |
| 89 | ${state_ipmi}= Get SDR Presence Via IPMI auto_reboot${SPACE} |
| 90 | |
| 91 | Run Keyword If '${state_ipmi}' == 'Disabled' |
| 92 | ... Should Be True ${state_rest} == 0 |
| 93 | ... ELSE IF '${state_ipmi}' == 'State Asserted' |
| 94 | ... Should Be True ${state_rest} == 1 |
| 95 | |
| 96 | |
| 97 | Test TPM Enable SDR Info |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 98 | [Documentation] Verify auto reboot SDR info via IPMI and Redfish. |
Rahul Maheshwari | cd7b19c | 2018-04-10 07:35:56 -0500 | [diff] [blame] | 99 | [Tags] Test_TPM_Enable_SDR_Info |
| 100 | |
| 101 | |
| 102 | ${component_uri_list}= Get Component URIs TPMEnable |
| 103 | ${component_uri}= Get From List ${component_uri_list} 0 |
| 104 | ${state_rest}= Read Attribute ${component_uri} TPMEnable |
| 105 | |
| 106 | ${state_ipmi}= Get SDR Presence Via IPMI auto_reboot${SPACE} |
| 107 | |
| 108 | Run Keyword If '${state_ipmi}' == 'Disabled' |
| 109 | ... Should Be True ${state_rest} == 0 |
| 110 | ... ELSE IF '${state_ipmi}' == 'State Asserted' |
| 111 | ... Should Be True ${state_rest} == 1 |
| 112 | |
| 113 | |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 114 | *** Keywords *** |
| 115 | |
| 116 | Get Component URIs |
| 117 | [Documentation] Get URIs for given component from given URIs |
| 118 | ... and return as a list. |
| 119 | [Arguments] ${component_name} ${uri_list}=${SYSTEM_URI} |
| 120 | |
| 121 | # A sample result returned for the "core" component: |
| 122 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core0 |
| 123 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core1 |
| 124 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core10 |
| 125 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core11 |
| 126 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core12 |
| 127 | # (etc.) |
| 128 | |
| 129 | # Description of argument(s): |
| 130 | # component_name Component name (e.g. "core", "dimm", etc.). |
| 131 | # uri_list URI list. |
| 132 | |
| 133 | ${component_uris}= Get Matches ${uri_list} |
Michael Walsh | d917c6e | 2018-12-11 10:09:09 -0600 | [diff] [blame] | 134 | ... regexp=^.*[0-9a-z_].${component_name}\[0-9]*$ |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 135 | [Return] ${component_uris} |
| 136 | |
| 137 | |
| 138 | Get SDR Presence Via IPMI |
| 139 | [Documentation] Return presence info from IPMI sensor data record. |
| 140 | [Arguments] ${component_name} |
| 141 | |
| 142 | # Description of argument(s): |
| 143 | # component_name Component name (e.g. "cpu0_core0", "dimm0", etc.). |
| 144 | |
| 145 | # Example of IPMI SDR elist output. |
| 146 | # BootProgress | 03h | ok | 34.2 | |
| 147 | # OperatingSystemS | 05h | ok | 35.1 | boot completed - device not specified |
| 148 | # AttemptsLeft | 07h | ok | 34.1 | |
| 149 | # occ0 | 08h | ok | 210.1 | Device Disabled |
| 150 | # occ1 | 09h | ok | 210.2 | Device Disabled |
| 151 | # cpu0_core0 | 12h | ok | 208.1 | Presence detected |
| 152 | # cpu0_core1 | 15h | ok | 208.2 | Disabled |
| 153 | # cpu0_core2 | 18h | ok | 208.3 | Presence detected |
| 154 | # dimm0 | A6h | ok | 32.1 | Presence Detected |
| 155 | # dimm1 | A8h | ok | 32.2 | Presence Detected |
| 156 | # dimm2 | AAh | ok | 32.9 | Presence Detected |
| 157 | # gv100card0 | C5h | ok | 216.1 | 0 unspecified |
| 158 | # gv100card1 | C8h | ok | 216.2 | 0 unspecified |
| 159 | # TPMEnable | D7h | ok | 3.3 | State Asserted |
| 160 | # auto_reboot | DAh | ok | 33.2 | State Asserted |
| 161 | # volatile | DBh | ok | 33.1 | State Deasserted |
| 162 | |
| 163 | ${sdr_elist_output}= Run IPMI Standard Command sdr elist |
| 164 | ${sdr_component_line}= |
| 165 | ... Get Lines Containing String ${sdr_elist_output} ${component_name} |
| 166 | ... case-insensitive |
| 167 | |
| 168 | ${presence_ipmi}= Fetch From Right ${sdr_component_line} | |
| 169 | ${presence_ipmi}= Strip String ${presence_ipmi} |
| 170 | [Return] ${presence_ipmi} |
| 171 | |
| 172 | |
| 173 | Verify SDR |
| 174 | [Documentation] Verify IPMI sensor data record for given component |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 175 | ... with Redfish. |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 176 | [Arguments] ${component_name} |
| 177 | |
| 178 | # Description of argument(s): |
| 179 | # component_name Component name (e.g. "cpu0/core0", "dimm0", etc.). |
| 180 | |
| 181 | ${presence_rest}= Read Attribute |
| 182 | ... ${HOST_INVENTORY_URI}system/chassis/motherboard/${component_name} |
| 183 | ... Present |
| 184 | ${functional_rest}= Read Attribute |
| 185 | ... ${HOST_INVENTORY_URI}system/chassis/motherboard/${component_name} |
| 186 | ... Functional |
| 187 | |
| 188 | # Replace "/" with "_" if there is any "/" in component name. |
| 189 | # e.g. cpu0/core0 to cpu0_core0 |
| 190 | ${component_name}= Replace String ${component_name} / _ |
| 191 | ${presence_ipmi}= Get SDR Presence Via IPMI ${component_name}${SPACE} |
| 192 | |
| 193 | Run Keyword If '${presence_ipmi}' == 'Disabled' |
| 194 | ... Should Be True ${presence_rest} == 0 and ${functional_rest} == 0 |
| 195 | ... ELSE IF '${presence_ipmi}' == 'Presence Detected' or '${presence_ipmi}' == 'Presence detected' |
| 196 | ... Should Be True ${presence_rest} == 1 and ${functional_rest} == 1 |
| 197 | ... ELSE IF '${presence_ipmi}' == 'State Asserted' |
| 198 | ... Should Be True ${presence_rest} == 1 and ${functional_rest} == 1 |
| 199 | ... ELSE IF '${presence_ipmi}' == 'State Deasserted' |
| 200 | ... Should Be True ${presence_rest} == 1 and ${functional_rest} == 0 |
| 201 | ... ELSE Fail msg=Invalid Presence${presence_ipmi} |
| 202 | |
| 203 | |
| 204 | Test SDR Info |
| 205 | [Documentation] Test SDR info for given component. |
| 206 | [Arguments] ${component_name} |
| 207 | |
| 208 | # Description of argument(s): |
| 209 | # component_name Component name (e.g. "core", "dimm", etc.). |
| 210 | |
| 211 | ${component_uri_list}= Get Component URIs ${component_name} |
| 212 | : FOR ${uri} IN @{component_uri_list} |
| 213 | \ ${component_name}= Fetch From Right ${uri} motherboard/ |
| 214 | \ Log To Console ${component_name} |
| 215 | \ Verify SDR ${component_name} |
| 216 | |
| 217 | |
| 218 | Suite Setup Execution |
| 219 | [Documentation] Do the initial suite setup. |
| 220 | |
Rahul Maheshwari | b6ebe4c | 2019-07-17 02:02:17 -0500 | [diff] [blame] | 221 | Redfish Power On stack_mode=skip quiet=1 |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 222 | |
| 223 | ${uri_list}= Read Properties ${OPENBMC_BASE_URI}list |
| 224 | Set Suite Variable ${SYSTEM_URI} ${uri_list} |
| 225 | Log ${uri_list} |
| 226 | |
| 227 | |
| 228 | Test Teardown Execution |
| 229 | [Documentation] Do the post test teardown. |
| 230 | |
| 231 | FFDC On Test Case Fail |