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