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 | bad5e82 | 2019-07-30 12:36:27 -0500 | [diff] [blame] | 9 | Library ../lib/ipmi_utils.py |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 10 | |
| 11 | Suite setup Suite Setup Execution |
George Keishing | 2d0edad | 2021-08-18 11:44:10 -0500 | [diff] [blame^] | 12 | Suite Teardown Redfish.Logout |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 13 | Test Teardown Test Teardown Execution |
| 14 | |
| 15 | Force Tags SDR_Test |
| 16 | |
| 17 | |
| 18 | *** Test Cases *** |
| 19 | |
Rahul Maheshwari | bad5e82 | 2019-07-30 12:36:27 -0500 | [diff] [blame] | 20 | Verify SDR Info |
| 21 | [Documentation] Verify sdr info command output. |
| 22 | [Tags] Verify_SDR_Info |
| 23 | # Example of SDR info command output: |
| 24 | # SDR Version : 0x51 |
| 25 | # Record Count : 216 |
| 26 | # Free Space : unspecified |
| 27 | # Most recent Addition : |
| 28 | # Most recent Erase : |
| 29 | # SDR overflow : no |
| 30 | # SDR Repository Update Support : unspecified |
| 31 | # Delete SDR supported : no |
| 32 | # Partial Add SDR supported : no |
| 33 | # Reserve SDR repository supported : no |
| 34 | # SDR Repository Alloc info supported : no |
| 35 | |
| 36 | ${sdr_info}= Get SDR Info |
| 37 | Should Be Equal ${sdr_info['sdr_version']} 0x51 |
| 38 | |
| 39 | # Get sensor count from "sdr elist all" command output. |
| 40 | ${sensor_count}= Get Sensor Count |
| 41 | Should Be Equal As Strings |
| 42 | ... ${sdr_info['record_count']} ${sensor_count} |
| 43 | |
| 44 | Should Be Equal ${sdr_info['free_space']} unspecified |
| 45 | Should Be Equal ${sdr_info['most_recent_addition']} ${EMPTY} |
| 46 | Should Be Equal ${sdr_info['most_recent_erase']} ${EMPTY} |
| 47 | Should Be Equal ${sdr_info['sdr_overflow']} no |
| 48 | Should Be Equal ${sdr_info['sdr_repository_update_support']} unspecified |
| 49 | Should Be Equal ${sdr_info['delete_sdr_supported']} no |
| 50 | Should Be Equal ${sdr_info['partial_add_sdr_supported']} no |
| 51 | Should Be Equal ${sdr_info['reserve_sdr_repository_supported']} no |
| 52 | Should Be Equal ${sdr_info['sdr_repository_alloc_info_supported']} no |
| 53 | |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 54 | |
| 55 | Test CPU Core SDR Info At Power On |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 56 | [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] | 57 | |
| 58 | [Tags] Test_CPU_Core_SDR_Info_At_Power_On |
| 59 | |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 60 | Redfish Power On stack_mode=skip quiet=1 |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 61 | Test SDR Info core |
| 62 | |
| 63 | |
| 64 | Test DIMM SDR Info At Power On |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 65 | [Documentation] Verify DIMM SDR info via IPMI and Redfish at power on. |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 66 | |
| 67 | [Tags] Test_DIMM_SDR_Info_At_Power_On |
| 68 | |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 69 | Redfish Power On stack_mode=skip quiet=1 |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 70 | Test SDR Info dimm |
| 71 | |
Rahul Maheshwari | cd7b19c | 2018-04-10 07:35:56 -0500 | [diff] [blame] | 72 | |
| 73 | Test GPU SDR Info At Power On |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 74 | [Documentation] Verify GPU SDR info via IPMI and Redfish at power on. |
Rahul Maheshwari | cd7b19c | 2018-04-10 07:35:56 -0500 | [diff] [blame] | 75 | |
| 76 | [Tags] Test_GPU_SDR_Info_At_Power_On |
| 77 | |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 78 | Redfish Power On stack_mode=skip quiet=1 |
Rahul Maheshwari | cd7b19c | 2018-04-10 07:35:56 -0500 | [diff] [blame] | 79 | Test SDR Info gv100card |
| 80 | |
| 81 | |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 82 | Test CPU Core SDR Info At Power Off |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 83 | [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] | 84 | |
| 85 | [Tags] Test_CPU_Core_SDR_Info_At_Power_Off |
| 86 | |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 87 | Redfish Hard Power Off stack_mode=skip quiet=1 |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 88 | Test SDR Info core |
| 89 | |
| 90 | |
| 91 | Test DIMM SDR Info At Power Off |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 92 | [Documentation] Verify DIMM SDR info via IPMI and Redfish at power off. |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 93 | |
| 94 | [Tags] Test_DIMM_SDR_Info_At_Power_Off |
| 95 | |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 96 | Redfish Hard Power Off stack_mode=skip quiet=1 |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 97 | Test SDR Info dimm |
| 98 | |
| 99 | |
Rahul Maheshwari | cd7b19c | 2018-04-10 07:35:56 -0500 | [diff] [blame] | 100 | Test Turbo Allowed SDR Info |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 101 | [Documentation] Verify turbo allowed SDR info via IPMI and Redfish. |
Rahul Maheshwari | cd7b19c | 2018-04-10 07:35:56 -0500 | [diff] [blame] | 102 | [Tags] Test_Turbo_Allowed_SDR_Info |
| 103 | |
| 104 | ${component_uri_list}= Get Component URIs turbo_allowed |
| 105 | ${component_uri}= Get From List ${component_uri_list} 0 |
| 106 | ${state_rest}= Read Attribute ${component_uri} TurboAllowed |
| 107 | |
| 108 | ${state_ipmi}= Get SDR Presence Via IPMI turbo_allowed${SPACE} |
| 109 | |
| 110 | Run Keyword If '${state_ipmi}' == 'Disabled' |
George Keishing | 9a75e68 | 2019-10-24 00:22:08 -0500 | [diff] [blame] | 111 | ... Should Be True ${state_rest} == ${0} |
Rahul Maheshwari | cd7b19c | 2018-04-10 07:35:56 -0500 | [diff] [blame] | 112 | ... ELSE IF '${state_ipmi}' == 'State Asserted' |
George Keishing | 9a75e68 | 2019-10-24 00:22:08 -0500 | [diff] [blame] | 113 | ... Should Be True ${state_rest} == ${1} |
Rahul Maheshwari | cd7b19c | 2018-04-10 07:35:56 -0500 | [diff] [blame] | 114 | |
| 115 | |
| 116 | Test Auto Reboot SDR Info |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 117 | [Documentation] Verify auto reboot SDR info via IPMI and Redfish. |
Rahul Maheshwari | cd7b19c | 2018-04-10 07:35:56 -0500 | [diff] [blame] | 118 | [Tags] Test_Auto_Reboot_SDR_Info |
| 119 | |
| 120 | |
| 121 | ${component_uri_list}= Get Component URIs auto_reboot |
| 122 | ${component_uri}= Get From List ${component_uri_list} 0 |
| 123 | ${state_rest}= Read Attribute ${component_uri} AutoReboot |
| 124 | |
| 125 | ${state_ipmi}= Get SDR Presence Via IPMI auto_reboot${SPACE} |
| 126 | |
| 127 | Run Keyword If '${state_ipmi}' == 'Disabled' |
George Keishing | 9a75e68 | 2019-10-24 00:22:08 -0500 | [diff] [blame] | 128 | ... Should Be True ${state_rest} == ${0} |
Rahul Maheshwari | cd7b19c | 2018-04-10 07:35:56 -0500 | [diff] [blame] | 129 | ... ELSE IF '${state_ipmi}' == 'State Asserted' |
George Keishing | 9a75e68 | 2019-10-24 00:22:08 -0500 | [diff] [blame] | 130 | ... Should Be True ${state_rest} == ${1} |
Rahul Maheshwari | cd7b19c | 2018-04-10 07:35:56 -0500 | [diff] [blame] | 131 | |
| 132 | |
| 133 | Test TPM Enable SDR Info |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 134 | [Documentation] Verify auto reboot SDR info via IPMI and Redfish. |
Rahul Maheshwari | cd7b19c | 2018-04-10 07:35:56 -0500 | [diff] [blame] | 135 | [Tags] Test_TPM_Enable_SDR_Info |
| 136 | |
| 137 | |
| 138 | ${component_uri_list}= Get Component URIs TPMEnable |
| 139 | ${component_uri}= Get From List ${component_uri_list} 0 |
| 140 | ${state_rest}= Read Attribute ${component_uri} TPMEnable |
| 141 | |
| 142 | ${state_ipmi}= Get SDR Presence Via IPMI auto_reboot${SPACE} |
| 143 | |
| 144 | Run Keyword If '${state_ipmi}' == 'Disabled' |
George Keishing | 9a75e68 | 2019-10-24 00:22:08 -0500 | [diff] [blame] | 145 | ... Should Be True ${state_rest} == ${0} |
Rahul Maheshwari | cd7b19c | 2018-04-10 07:35:56 -0500 | [diff] [blame] | 146 | ... ELSE IF '${state_ipmi}' == 'State Asserted' |
George Keishing | 9a75e68 | 2019-10-24 00:22:08 -0500 | [diff] [blame] | 147 | ... Should Be True ${state_rest} == ${1} |
Rahul Maheshwari | cd7b19c | 2018-04-10 07:35:56 -0500 | [diff] [blame] | 148 | |
| 149 | |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 150 | *** Keywords *** |
| 151 | |
Rahul Maheshwari | bad5e82 | 2019-07-30 12:36:27 -0500 | [diff] [blame] | 152 | Get Sensor Count |
| 153 | [Documentation] Get sensors count using "sdr elist all" command. |
| 154 | # Example of "sdr elist all" command output: |
| 155 | # BootProgress | 03h | ok | 34.2 | |
| 156 | # OperatingSystemS | 05h | ok | 35.1 | |
| 157 | # AttemptsLeft | 07h | ok | 34.1 | |
| 158 | # occ0 | 08h | ok | 210.1 | Device Disabled |
| 159 | # occ1 | 09h | ok | 210.2 | Device Disabled |
| 160 | # p0_core0_temp | 11h | ns | 3.1 | Disabled |
| 161 | # cpu0_core0 | 12h | ok | 208.1 | Presence detected |
| 162 | # p0_core1_temp | 14h | ns | 3.2 | Disabled |
| 163 | # cpu0_core1 | 15h | ok | 208.2 | Presence detected |
| 164 | # p0_core2_temp | 17h | ns | 3.3 | Disabled |
| 165 | # .. |
| 166 | # .. |
| 167 | # .. |
| 168 | # .. |
| 169 | # .. |
| 170 | # .. |
| 171 | # fan3 | 00h | ns | 29.4 | Logical FRU @35h |
| 172 | # bmc | 00h | ns | 6.1 | Logical FRU @3Ch |
| 173 | # ethernet | 00h | ns | 1.1 | Logical FRU @46h |
| 174 | |
| 175 | ${output}= Run IPMI Standard Command sdr elist all |
| 176 | ${sensor_list}= Split String ${output} \n |
| 177 | ${sensor_count}= Get Length ${sensor_list} |
| 178 | [Return] ${sensor_count} |
| 179 | |
| 180 | |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 181 | Get Component URIs |
| 182 | [Documentation] Get URIs for given component from given URIs |
| 183 | ... and return as a list. |
| 184 | [Arguments] ${component_name} ${uri_list}=${SYSTEM_URI} |
| 185 | |
| 186 | # A sample result returned for the "core" component: |
| 187 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core0 |
| 188 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core1 |
| 189 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core10 |
| 190 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core11 |
| 191 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core12 |
| 192 | # (etc.) |
| 193 | |
| 194 | # Description of argument(s): |
| 195 | # component_name Component name (e.g. "core", "dimm", etc.). |
| 196 | # uri_list URI list. |
| 197 | |
| 198 | ${component_uris}= Get Matches ${uri_list} |
Jayashree-D | 5ddaf9b | 2020-07-15 13:50:02 +0530 | [diff] [blame] | 199 | ... regexp=^.*[0-9a-z_].${component_name}\[_0-9a-z]*$ |
| 200 | ... case_insensitive=${True} |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 201 | [Return] ${component_uris} |
| 202 | |
| 203 | |
| 204 | Get SDR Presence Via IPMI |
| 205 | [Documentation] Return presence info from IPMI sensor data record. |
| 206 | [Arguments] ${component_name} |
| 207 | |
| 208 | # Description of argument(s): |
| 209 | # component_name Component name (e.g. "cpu0_core0", "dimm0", etc.). |
| 210 | |
| 211 | # Example of IPMI SDR elist output. |
| 212 | # BootProgress | 03h | ok | 34.2 | |
| 213 | # OperatingSystemS | 05h | ok | 35.1 | boot completed - device not specified |
| 214 | # AttemptsLeft | 07h | ok | 34.1 | |
| 215 | # occ0 | 08h | ok | 210.1 | Device Disabled |
| 216 | # occ1 | 09h | ok | 210.2 | Device Disabled |
| 217 | # cpu0_core0 | 12h | ok | 208.1 | Presence detected |
| 218 | # cpu0_core1 | 15h | ok | 208.2 | Disabled |
| 219 | # cpu0_core2 | 18h | ok | 208.3 | Presence detected |
| 220 | # dimm0 | A6h | ok | 32.1 | Presence Detected |
| 221 | # dimm1 | A8h | ok | 32.2 | Presence Detected |
| 222 | # dimm2 | AAh | ok | 32.9 | Presence Detected |
| 223 | # gv100card0 | C5h | ok | 216.1 | 0 unspecified |
| 224 | # gv100card1 | C8h | ok | 216.2 | 0 unspecified |
| 225 | # TPMEnable | D7h | ok | 3.3 | State Asserted |
| 226 | # auto_reboot | DAh | ok | 33.2 | State Asserted |
| 227 | # volatile | DBh | ok | 33.1 | State Deasserted |
| 228 | |
| 229 | ${sdr_elist_output}= Run IPMI Standard Command sdr elist |
| 230 | ${sdr_component_line}= |
| 231 | ... Get Lines Containing String ${sdr_elist_output} ${component_name} |
| 232 | ... case-insensitive |
| 233 | |
| 234 | ${presence_ipmi}= Fetch From Right ${sdr_component_line} | |
| 235 | ${presence_ipmi}= Strip String ${presence_ipmi} |
| 236 | [Return] ${presence_ipmi} |
| 237 | |
| 238 | |
| 239 | Verify SDR |
| 240 | [Documentation] Verify IPMI sensor data record for given component |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 241 | ... with Redfish. |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 242 | [Arguments] ${component_name} |
| 243 | |
| 244 | # Description of argument(s): |
| 245 | # component_name Component name (e.g. "cpu0/core0", "dimm0", etc.). |
| 246 | |
| 247 | ${presence_rest}= Read Attribute |
| 248 | ... ${HOST_INVENTORY_URI}system/chassis/motherboard/${component_name} |
| 249 | ... Present |
| 250 | ${functional_rest}= Read Attribute |
| 251 | ... ${HOST_INVENTORY_URI}system/chassis/motherboard/${component_name} |
| 252 | ... Functional |
| 253 | |
| 254 | # Replace "/" with "_" if there is any "/" in component name. |
| 255 | # e.g. cpu0/core0 to cpu0_core0 |
| 256 | ${component_name}= Replace String ${component_name} / _ |
| 257 | ${presence_ipmi}= Get SDR Presence Via IPMI ${component_name}${SPACE} |
| 258 | |
| 259 | Run Keyword If '${presence_ipmi}' == 'Disabled' |
George Keishing | 9a75e68 | 2019-10-24 00:22:08 -0500 | [diff] [blame] | 260 | ... Should Be True ${presence_rest} == ${0} and ${functional_rest} == ${0} |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 261 | ... ELSE IF '${presence_ipmi}' == 'Presence Detected' or '${presence_ipmi}' == 'Presence detected' |
George Keishing | 9a75e68 | 2019-10-24 00:22:08 -0500 | [diff] [blame] | 262 | ... Should Be True ${presence_rest} == ${1} and ${functional_rest} == ${1} |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 263 | ... ELSE IF '${presence_ipmi}' == 'State Asserted' |
George Keishing | 9a75e68 | 2019-10-24 00:22:08 -0500 | [diff] [blame] | 264 | ... Should Be True ${presence_rest} == ${1} and ${functional_rest} == ${1} |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 265 | ... ELSE IF '${presence_ipmi}' == 'State Deasserted' |
George Keishing | 9a75e68 | 2019-10-24 00:22:08 -0500 | [diff] [blame] | 266 | ... Should Be True ${presence_rest} == ${1} and ${functional_rest} == ${0} |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 267 | ... ELSE Fail msg=Invalid Presence${presence_ipmi} |
| 268 | |
| 269 | |
| 270 | Test SDR Info |
| 271 | [Documentation] Test SDR info for given component. |
| 272 | [Arguments] ${component_name} |
| 273 | |
| 274 | # Description of argument(s): |
| 275 | # component_name Component name (e.g. "core", "dimm", etc.). |
| 276 | |
| 277 | ${component_uri_list}= Get Component URIs ${component_name} |
Sushil Singh | ab209cd | 2020-07-01 09:01:14 -0500 | [diff] [blame] | 278 | |
| 279 | FOR ${uri} IN @{component_uri_list} |
| 280 | ${component_name}= Fetch From Right ${uri} motherboard/ |
| 281 | Log To Console ${component_name} |
| 282 | Verify SDR ${component_name} |
| 283 | END |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 284 | |
| 285 | |
| 286 | Suite Setup Execution |
| 287 | [Documentation] Do the initial suite setup. |
| 288 | |
George Keishing | 2d0edad | 2021-08-18 11:44:10 -0500 | [diff] [blame^] | 289 | Redfish.Login |
Rahul Maheshwari | b6ebe4c | 2019-07-17 02:02:17 -0500 | [diff] [blame] | 290 | Redfish Power On stack_mode=skip quiet=1 |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 291 | |
| 292 | ${uri_list}= Read Properties ${OPENBMC_BASE_URI}list |
| 293 | Set Suite Variable ${SYSTEM_URI} ${uri_list} |
| 294 | Log ${uri_list} |
| 295 | |
| 296 | |
| 297 | Test Teardown Execution |
| 298 | [Documentation] Do the post test teardown. |
| 299 | |
| 300 | FFDC On Test Case Fail |