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/ipmi_client.robot |
ganesanb | d0c4b80 | 2023-04-28 18:29:38 +0000 | [diff] [blame] | 5 | Resource ../lib/rest_client.robot |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 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 |
nagarjunb22 | 87138e6 | 2022-04-19 16:49:16 +0530 | [diff] [blame] | 10 | Library ../lib/utilities.py |
| 11 | Variables ../data/ipmi_raw_cmd_table.py |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 12 | |
| 13 | Suite setup Suite Setup Execution |
George Keishing | 2d0edad | 2021-08-18 11:44:10 -0500 | [diff] [blame] | 14 | Suite Teardown Redfish.Logout |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 15 | Test Teardown Test Teardown Execution |
| 16 | |
Matt Fischer | 6fb70d9 | 2023-10-24 19:06:33 -0600 | [diff] [blame] | 17 | Test Tags IPMI_SDR |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 18 | |
| 19 | *** Test Cases *** |
| 20 | |
Rahul Maheshwari | bad5e82 | 2019-07-30 12:36:27 -0500 | [diff] [blame] | 21 | Verify SDR Info |
| 22 | [Documentation] Verify sdr info command output. |
| 23 | [Tags] Verify_SDR_Info |
| 24 | # Example of SDR info command output: |
| 25 | # SDR Version : 0x51 |
| 26 | # Record Count : 216 |
| 27 | # Free Space : unspecified |
| 28 | # Most recent Addition : |
| 29 | # Most recent Erase : |
| 30 | # SDR overflow : no |
| 31 | # SDR Repository Update Support : unspecified |
| 32 | # Delete SDR supported : no |
| 33 | # Partial Add SDR supported : no |
| 34 | # Reserve SDR repository supported : no |
| 35 | # SDR Repository Alloc info supported : no |
| 36 | |
nagarjunb22 | 87138e6 | 2022-04-19 16:49:16 +0530 | [diff] [blame] | 37 | # Check if delete, partially add, reserve SDR and get SDR alloc info command are supported or not. |
| 38 | ${support_delete_sdr}= Fetch IPMI Command Support Status |
| 39 | ... ${IPMI_RAW_CMD['SDR']['Delete SDR'][0]} |
| 40 | ${support_partial_add}= Fetch IPMI Command Support Status |
| 41 | ... ${IPMI_RAW_CMD['SDR']['Partially Add SDR'][0]} |
| 42 | ${support_reserve_sdr_repository}= Fetch IPMI Command Support Status |
| 43 | ... ${IPMI_RAW_CMD['SDR']['Reserve SDR Repository'][0]} |
| 44 | ${support_sdr_repository_alloc_info}= Fetch IPMI Command Support Status |
| 45 | ... ${IPMI_RAW_CMD['SDR']['Get SDR allocation Info'][0]} |
| 46 | |
Rahul Maheshwari | bad5e82 | 2019-07-30 12:36:27 -0500 | [diff] [blame] | 47 | ${sdr_info}= Get SDR Info |
| 48 | Should Be Equal ${sdr_info['sdr_version']} 0x51 |
| 49 | |
manimozhik | dd32165 | 2023-11-08 10:22:06 +0000 | [diff] [blame] | 50 | # Get SDR OEM record count from "sdr elist -vvv" command output. |
| 51 | ${sdr_data}= Run IPMI Standard Command sdr elist -vvv |
KManimozhi123 | f320b4e | 2024-03-13 10:22:41 +0000 | [diff] [blame] | 52 | ${sdr_oem}= Fetch OEM Sdr Count ${sdr_data} |
manimozhik | dd32165 | 2023-11-08 10:22:06 +0000 | [diff] [blame] | 53 | ${sdr_info_record_count}= Evaluate ${sdr_info['record_count']} - ${sdr_oem} |
| 54 | |
Rahul Maheshwari | bad5e82 | 2019-07-30 12:36:27 -0500 | [diff] [blame] | 55 | # Get sensor count from "sdr elist all" command output. |
| 56 | ${sensor_count}= Get Sensor Count |
| 57 | Should Be Equal As Strings |
manimozhik | dd32165 | 2023-11-08 10:22:06 +0000 | [diff] [blame] | 58 | ... ${sdr_info_record_count} ${sensor_count} |
Rahul Maheshwari | bad5e82 | 2019-07-30 12:36:27 -0500 | [diff] [blame] | 59 | |
| 60 | Should Be Equal ${sdr_info['free_space']} unspecified |
nagarjunb22 | 87138e6 | 2022-04-19 16:49:16 +0530 | [diff] [blame] | 61 | Should Not Be Equal ${sdr_info['most_recent_addition']} ${EMPTY} |
| 62 | Should Not Be Equal ${sdr_info['most_recent_erase']} ${EMPTY} |
| 63 | Should Be Equal ${sdr_info['sdr_overflow']} yes |
Rahul Maheshwari | bad5e82 | 2019-07-30 12:36:27 -0500 | [diff] [blame] | 64 | Should Be Equal ${sdr_info['sdr_repository_update_support']} unspecified |
nagarjunb22 | 87138e6 | 2022-04-19 16:49:16 +0530 | [diff] [blame] | 65 | Should Be Equal ${sdr_info['delete_sdr_supported']} ${support_delete_sdr} |
| 66 | Should Be Equal ${sdr_info['partial_add_sdr_supported']} ${support_partial_add} |
| 67 | Should Be Equal ${sdr_info['reserve_sdr_repository_supported']} ${support_reserve_sdr_repository} |
| 68 | Should Be Equal ${sdr_info['sdr_repository_alloc_info_supported']} ${support_sdr_repository_alloc_info} |
Rahul Maheshwari | bad5e82 | 2019-07-30 12:36:27 -0500 | [diff] [blame] | 69 | |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 70 | |
| 71 | Test CPU Core SDR Info At Power On |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 72 | [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] | 73 | |
| 74 | [Tags] Test_CPU_Core_SDR_Info_At_Power_On |
| 75 | |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 76 | Redfish Power On stack_mode=skip quiet=1 |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 77 | Test SDR Info core |
| 78 | |
| 79 | |
| 80 | Test DIMM SDR Info At Power On |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 81 | [Documentation] Verify DIMM SDR info via IPMI and Redfish at power on. |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 82 | |
| 83 | [Tags] Test_DIMM_SDR_Info_At_Power_On |
| 84 | |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 85 | Redfish Power On stack_mode=skip quiet=1 |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 86 | Test SDR Info dimm |
| 87 | |
Rahul Maheshwari | cd7b19c | 2018-04-10 07:35:56 -0500 | [diff] [blame] | 88 | |
| 89 | Test GPU SDR Info At Power On |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 90 | [Documentation] Verify GPU SDR info via IPMI and Redfish at power on. |
Rahul Maheshwari | cd7b19c | 2018-04-10 07:35:56 -0500 | [diff] [blame] | 91 | |
| 92 | [Tags] Test_GPU_SDR_Info_At_Power_On |
| 93 | |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 94 | Redfish Power On stack_mode=skip quiet=1 |
Rahul Maheshwari | cd7b19c | 2018-04-10 07:35:56 -0500 | [diff] [blame] | 95 | Test SDR Info gv100card |
| 96 | |
| 97 | |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 98 | Test CPU Core SDR Info At Power Off |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 99 | [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] | 100 | |
| 101 | [Tags] Test_CPU_Core_SDR_Info_At_Power_Off |
| 102 | |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 103 | Redfish Hard Power Off stack_mode=skip quiet=1 |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 104 | Test SDR Info core |
| 105 | |
| 106 | |
| 107 | Test DIMM SDR Info At Power Off |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 108 | [Documentation] Verify DIMM SDR info via IPMI and Redfish at power off. |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 109 | |
| 110 | [Tags] Test_DIMM_SDR_Info_At_Power_Off |
| 111 | |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 112 | Redfish Hard Power Off stack_mode=skip quiet=1 |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 113 | Test SDR Info dimm |
| 114 | |
| 115 | |
Rahul Maheshwari | cd7b19c | 2018-04-10 07:35:56 -0500 | [diff] [blame] | 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 | |
nagarjunb22 | 8ea859e | 2022-07-12 21:39:51 +0530 | [diff] [blame] | 149 | |
nagarjunb22 | 87138e6 | 2022-04-19 16:49:16 +0530 | [diff] [blame] | 150 | Test Reserve SDR Repository |
| 151 | [Documentation] Verify Reserve SDR Repository IPMI command. |
| 152 | [Tags] Test_Reserve_SDR_Repository |
| 153 | |
| 154 | ${reservation_id}= Get Reservation ID convert_lsb_to_msb=True |
| 155 | |
| 156 | # Getting another Reservation ID and verify it is different from previous Reservation ID. |
| 157 | ${new_reservation_id}= Get Reservation ID convert_lsb_to_msb=True |
| 158 | |
| 159 | Should Not Be Equal ${reservation_id} ${new_reservation_id} |
nagarjunb22 | 8ea859e | 2022-07-12 21:39:51 +0530 | [diff] [blame] | 160 | ... msg=Getting same reservation ID for second time, reservation ID must be different. |
| 161 | |
nagarjunb22 | 87138e6 | 2022-04-19 16:49:16 +0530 | [diff] [blame] | 162 | |
| 163 | Test Get SDR Using Reservation ID |
| 164 | [Documentation] Verify get SDR command using reservation ID obtained from Reserve SDR repository. |
| 165 | [Tags] Test_Get_SDR_Using_Reservation_ID |
| 166 | |
| 167 | ${reservation_id}= Get Reservation ID add_prefix=True |
| 168 | |
| 169 | # Get SDR full without using Reservation ID. |
ishwaryamathim | 372cd86 | 2023-11-14 18:12:23 +0000 | [diff] [blame] | 170 | Run IPMI Command ${IPMI_RAW_CMD['SDR']['Get'][0]} |
nagarjunb22 | 87138e6 | 2022-04-19 16:49:16 +0530 | [diff] [blame] | 171 | |
| 172 | # Get SDR Partially using Reservation ID. |
| 173 | ${get_sdr_raw_cmd}= Catenate |
nagarjunb22 | 8ea859e | 2022-07-12 21:39:51 +0530 | [diff] [blame] | 174 | ... ${IPMI_RAW_CMD['Get SDR']['Get'][1]} ${reservation_id} 0x${record_id} 0x00 |
| 175 | ... ${IPMI_RAW_CMD['Get SDR']['Get'][2]} |
ishwaryamathim | 372cd86 | 2023-11-14 18:12:23 +0000 | [diff] [blame] | 176 | Run IPMI Command ${get_sdr_raw_cmd} |
nagarjunb22 | 87138e6 | 2022-04-19 16:49:16 +0530 | [diff] [blame] | 177 | |
| 178 | # Get SDR partially without using reservation ID and expect error. |
| 179 | Verify Invalid IPMI Command ${IPMI_RAW_CMD['SDR']['Get'][3]} 0xc5 |
| 180 | |
| 181 | |
| 182 | Test Get SDR Using Invalid Reservation ID |
| 183 | [Documentation] Verify get SDR command using invalid reservation ID. |
| 184 | [Tags] Test_Get_SDR_Using_Invalid_Reservation_ID |
| 185 | |
| 186 | # Generate two reservation ID and verify get SDR partial using old reservation ID. |
| 187 | ${first_reservation_id}= Get Reservation ID add_prefix=True |
| 188 | ${second_reservation_id}= Get Reservation ID add_prefix=True |
| 189 | |
nagarjunb22 | 8ea859e | 2022-07-12 21:39:51 +0530 | [diff] [blame] | 190 | # Creating the raw cmd with First reservation ID. |
nagarjunb22 | 87138e6 | 2022-04-19 16:49:16 +0530 | [diff] [blame] | 191 | ${get_sdr_raw_cmd}= Catenate |
nagarjunb22 | 8ea859e | 2022-07-12 21:39:51 +0530 | [diff] [blame] | 192 | ... ${IPMI_RAW_CMD['Get SDR']['Get'][1]} ${first_reservation_id} 0x${record_id} 0x00 |
| 193 | ... ${IPMI_RAW_CMD['Get SDR']['Get'][2]} |
nagarjunb22 | 87138e6 | 2022-04-19 16:49:16 +0530 | [diff] [blame] | 194 | |
nagarjunb22 | 87138e6 | 2022-04-19 16:49:16 +0530 | [diff] [blame] | 195 | |
| 196 | Test Reserve SDR Repository After BMC Reboot |
| 197 | [Documentation] Verify reserve SDR repository reservation ID after BMC Reboot. |
| 198 | [Tags] Test_Reserve_SDR_Repository_After_BMC_Reboot |
| 199 | |
| 200 | # Get Reservation ID before reboot. |
| 201 | ${reservation_id_before_reboot}= Get Reservation ID add_prefix=True |
| 202 | |
| 203 | # Cold reset BMC |
| 204 | IPMI MC Reset Cold (run) |
| 205 | |
nagarjunb22 | 8ea859e | 2022-07-12 21:39:51 +0530 | [diff] [blame] | 206 | # Waiting to for sdr to populate. |
| 207 | Sleep 10s |
| 208 | |
nagarjunb22 | 87138e6 | 2022-04-19 16:49:16 +0530 | [diff] [blame] | 209 | # Create Get SDR Partially command using reservation ID which got before reboot. |
| 210 | ${get_sdr_raw_cmd}= Catenate |
nagarjunb22 | 8ea859e | 2022-07-12 21:39:51 +0530 | [diff] [blame] | 211 | ... ${IPMI_RAW_CMD['Get SDR']['Get'][1]} ${reservation_id_before_reboot} 0x${record_id} 0x00 |
| 212 | ... ${IPMI_RAW_CMD['Get SDR']['Get'][2]} |
nagarjunb22 | 87138e6 | 2022-04-19 16:49:16 +0530 | [diff] [blame] | 213 | |
| 214 | Verify Invalid IPMI Command ${get_sdr_raw_cmd} 0xc5 |
| 215 | |
| 216 | # Verify get SDR partially with new reservation ID after reboot. |
| 217 | ${reservation_id_after_reboot}= Get Reservation ID add_prefix=True |
| 218 | ${get_sdr_raw_cmd}= Catenate |
nagarjunb22 | 8ea859e | 2022-07-12 21:39:51 +0530 | [diff] [blame] | 219 | ... ${IPMI_RAW_CMD['Get SDR']['Get'][1]} ${reservation_id_after_reboot} 0x${record_id} 0x00 |
| 220 | ... ${IPMI_RAW_CMD['Get SDR']['Get'][2]} |
ishwaryamathim | 372cd86 | 2023-11-14 18:12:23 +0000 | [diff] [blame] | 221 | Run IPMI Command ${get_sdr_raw_cmd} |
nagarjunb22 | 87138e6 | 2022-04-19 16:49:16 +0530 | [diff] [blame] | 222 | |
Rahul Maheshwari | cd7b19c | 2018-04-10 07:35:56 -0500 | [diff] [blame] | 223 | |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 224 | *** Keywords *** |
| 225 | |
nagarjunb22 | 87138e6 | 2022-04-19 16:49:16 +0530 | [diff] [blame] | 226 | Get Reservation ID |
| 227 | [Documentation] Get reservation ID using reserve SDR repository. |
| 228 | [Arguments] ${add_prefix}=False ${convert_lsb_to_msb}=False |
| 229 | |
| 230 | # Description of argument(s): |
| 231 | # add_prefix If True will prefix "0x" to the reservation ID. |
| 232 | # e.g. IPMI response for Reservation ID command will be like 01 00 |
| 233 | # return reservation ID will be "0x01" for above response. |
| 234 | |
| 235 | # convert_lsb_to_msb If True will convert the reservation ID from LSB first to MSB first. |
| 236 | # e.g. IPMI response for reservation ID command will be like 01 0a |
| 237 | # return reservation ID will be "a1" for above response. |
| 238 | |
ishwaryamathim | 372cd86 | 2023-11-14 18:12:23 +0000 | [diff] [blame] | 239 | ${reservation_id}= Run IPMI Command |
nagarjunb22 | 87138e6 | 2022-04-19 16:49:16 +0530 | [diff] [blame] | 240 | ... ${IPMI_RAW_CMD['SDR']['Reserve SDR Repository'][0]} |
| 241 | |
| 242 | ${reservation_id}= Run Keyword If ${add_prefix} |
| 243 | ... Add Prefix To String ${reservation_id} 0x |
| 244 | ... ELSE IF ${convert_lsb_to_msb} |
| 245 | ... Convert LSB To MSB ${reservation_id} |
| 246 | ... ELSE |
| 247 | ... Return From Keyword ${reservation_id} |
| 248 | |
George Keishing | 409df05 | 2024-01-17 22:36:14 +0530 | [diff] [blame] | 249 | RETURN ${reservation_id} |
nagarjunb22 | 87138e6 | 2022-04-19 16:49:16 +0530 | [diff] [blame] | 250 | |
| 251 | |
Rahul Maheshwari | bad5e82 | 2019-07-30 12:36:27 -0500 | [diff] [blame] | 252 | Get Sensor Count |
| 253 | [Documentation] Get sensors count using "sdr elist all" command. |
| 254 | # Example of "sdr elist all" command output: |
| 255 | # BootProgress | 03h | ok | 34.2 | |
| 256 | # OperatingSystemS | 05h | ok | 35.1 | |
| 257 | # AttemptsLeft | 07h | ok | 34.1 | |
| 258 | # occ0 | 08h | ok | 210.1 | Device Disabled |
| 259 | # occ1 | 09h | ok | 210.2 | Device Disabled |
| 260 | # p0_core0_temp | 11h | ns | 3.1 | Disabled |
| 261 | # cpu0_core0 | 12h | ok | 208.1 | Presence detected |
| 262 | # p0_core1_temp | 14h | ns | 3.2 | Disabled |
| 263 | # cpu0_core1 | 15h | ok | 208.2 | Presence detected |
| 264 | # p0_core2_temp | 17h | ns | 3.3 | Disabled |
| 265 | # .. |
| 266 | # .. |
| 267 | # .. |
| 268 | # .. |
| 269 | # .. |
| 270 | # .. |
| 271 | # fan3 | 00h | ns | 29.4 | Logical FRU @35h |
| 272 | # bmc | 00h | ns | 6.1 | Logical FRU @3Ch |
| 273 | # ethernet | 00h | ns | 1.1 | Logical FRU @46h |
| 274 | |
| 275 | ${output}= Run IPMI Standard Command sdr elist all |
| 276 | ${sensor_list}= Split String ${output} \n |
| 277 | ${sensor_count}= Get Length ${sensor_list} |
George Keishing | 409df05 | 2024-01-17 22:36:14 +0530 | [diff] [blame] | 278 | RETURN ${sensor_count} |
Rahul Maheshwari | bad5e82 | 2019-07-30 12:36:27 -0500 | [diff] [blame] | 279 | |
| 280 | |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 281 | Get Component URIs |
| 282 | [Documentation] Get URIs for given component from given URIs |
| 283 | ... and return as a list. |
| 284 | [Arguments] ${component_name} ${uri_list}=${SYSTEM_URI} |
| 285 | |
| 286 | # A sample result returned for the "core" component: |
| 287 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core0 |
| 288 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core1 |
| 289 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core10 |
| 290 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core11 |
| 291 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core12 |
| 292 | # (etc.) |
| 293 | |
| 294 | # Description of argument(s): |
| 295 | # component_name Component name (e.g. "core", "dimm", etc.). |
| 296 | # uri_list URI list. |
| 297 | |
| 298 | ${component_uris}= Get Matches ${uri_list} |
Jayashree-D | 5ddaf9b | 2020-07-15 13:50:02 +0530 | [diff] [blame] | 299 | ... regexp=^.*[0-9a-z_].${component_name}\[_0-9a-z]*$ |
| 300 | ... case_insensitive=${True} |
George Keishing | 409df05 | 2024-01-17 22:36:14 +0530 | [diff] [blame] | 301 | RETURN ${component_uris} |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 302 | |
| 303 | |
| 304 | Get SDR Presence Via IPMI |
| 305 | [Documentation] Return presence info from IPMI sensor data record. |
| 306 | [Arguments] ${component_name} |
| 307 | |
| 308 | # Description of argument(s): |
| 309 | # component_name Component name (e.g. "cpu0_core0", "dimm0", etc.). |
| 310 | |
| 311 | # Example of IPMI SDR elist output. |
| 312 | # BootProgress | 03h | ok | 34.2 | |
| 313 | # OperatingSystemS | 05h | ok | 35.1 | boot completed - device not specified |
| 314 | # AttemptsLeft | 07h | ok | 34.1 | |
| 315 | # occ0 | 08h | ok | 210.1 | Device Disabled |
| 316 | # occ1 | 09h | ok | 210.2 | Device Disabled |
| 317 | # cpu0_core0 | 12h | ok | 208.1 | Presence detected |
| 318 | # cpu0_core1 | 15h | ok | 208.2 | Disabled |
| 319 | # cpu0_core2 | 18h | ok | 208.3 | Presence detected |
| 320 | # dimm0 | A6h | ok | 32.1 | Presence Detected |
| 321 | # dimm1 | A8h | ok | 32.2 | Presence Detected |
| 322 | # dimm2 | AAh | ok | 32.9 | Presence Detected |
| 323 | # gv100card0 | C5h | ok | 216.1 | 0 unspecified |
| 324 | # gv100card1 | C8h | ok | 216.2 | 0 unspecified |
| 325 | # TPMEnable | D7h | ok | 3.3 | State Asserted |
| 326 | # auto_reboot | DAh | ok | 33.2 | State Asserted |
| 327 | # volatile | DBh | ok | 33.1 | State Deasserted |
| 328 | |
| 329 | ${sdr_elist_output}= Run IPMI Standard Command sdr elist |
| 330 | ${sdr_component_line}= |
| 331 | ... Get Lines Containing String ${sdr_elist_output} ${component_name} |
| 332 | ... case-insensitive |
| 333 | |
| 334 | ${presence_ipmi}= Fetch From Right ${sdr_component_line} | |
| 335 | ${presence_ipmi}= Strip String ${presence_ipmi} |
George Keishing | 409df05 | 2024-01-17 22:36:14 +0530 | [diff] [blame] | 336 | RETURN ${presence_ipmi} |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 337 | |
| 338 | |
| 339 | Verify SDR |
| 340 | [Documentation] Verify IPMI sensor data record for given component |
George Keishing | d6bc1c1 | 2019-03-08 12:59:29 -0600 | [diff] [blame] | 341 | ... with Redfish. |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 342 | [Arguments] ${component_name} |
| 343 | |
| 344 | # Description of argument(s): |
| 345 | # component_name Component name (e.g. "cpu0/core0", "dimm0", etc.). |
| 346 | |
| 347 | ${presence_rest}= Read Attribute |
| 348 | ... ${HOST_INVENTORY_URI}system/chassis/motherboard/${component_name} |
| 349 | ... Present |
| 350 | ${functional_rest}= Read Attribute |
| 351 | ... ${HOST_INVENTORY_URI}system/chassis/motherboard/${component_name} |
| 352 | ... Functional |
| 353 | |
| 354 | # Replace "/" with "_" if there is any "/" in component name. |
| 355 | # e.g. cpu0/core0 to cpu0_core0 |
| 356 | ${component_name}= Replace String ${component_name} / _ |
| 357 | ${presence_ipmi}= Get SDR Presence Via IPMI ${component_name}${SPACE} |
| 358 | |
Tim Lee | ada4b0c | 2021-08-25 14:52:42 +0800 | [diff] [blame] | 359 | Run Keyword If '${presence_ipmi}' == 'Disabled' or '${presence_ipmi}' == '' |
George Keishing | 9a75e68 | 2019-10-24 00:22:08 -0500 | [diff] [blame] | 360 | ... Should Be True ${presence_rest} == ${0} and ${functional_rest} == ${0} |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 361 | ... ELSE IF '${presence_ipmi}' == 'Presence Detected' or '${presence_ipmi}' == 'Presence detected' |
George Keishing | 9a75e68 | 2019-10-24 00:22:08 -0500 | [diff] [blame] | 362 | ... Should Be True ${presence_rest} == ${1} and ${functional_rest} == ${1} |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 363 | ... ELSE IF '${presence_ipmi}' == 'State Asserted' |
George Keishing | 9a75e68 | 2019-10-24 00:22:08 -0500 | [diff] [blame] | 364 | ... Should Be True ${presence_rest} == ${1} and ${functional_rest} == ${1} |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 365 | ... ELSE IF '${presence_ipmi}' == 'State Deasserted' |
George Keishing | 9a75e68 | 2019-10-24 00:22:08 -0500 | [diff] [blame] | 366 | ... Should Be True ${presence_rest} == ${1} and ${functional_rest} == ${0} |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 367 | ... ELSE Fail msg=Invalid Presence${presence_ipmi} |
| 368 | |
| 369 | |
| 370 | Test SDR Info |
| 371 | [Documentation] Test SDR info for given component. |
| 372 | [Arguments] ${component_name} |
| 373 | |
| 374 | # Description of argument(s): |
| 375 | # component_name Component name (e.g. "core", "dimm", etc.). |
| 376 | |
| 377 | ${component_uri_list}= Get Component URIs ${component_name} |
Sushil Singh | ab209cd | 2020-07-01 09:01:14 -0500 | [diff] [blame] | 378 | |
| 379 | FOR ${uri} IN @{component_uri_list} |
| 380 | ${component_name}= Fetch From Right ${uri} motherboard/ |
| 381 | Log To Console ${component_name} |
| 382 | Verify SDR ${component_name} |
| 383 | END |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 384 | |
nagarjunb22 | 87138e6 | 2022-04-19 16:49:16 +0530 | [diff] [blame] | 385 | Fetch IPMI Command Support Status |
| 386 | [Documentation] Return yes if IPMI command is supported. |
| 387 | [Arguments] ${ipmi_cmd} |
| 388 | |
| 389 | # Description of argument(s): |
| 390 | # ipmi_cmd IPMI command. |
| 391 | |
ishwaryamathim | 372cd86 | 2023-11-14 18:12:23 +0000 | [diff] [blame] | 392 | ${resp}= Run IPMI Command ${ipmi_cmd} fail_on_err=0 |
nagarjunb22 | 87138e6 | 2022-04-19 16:49:16 +0530 | [diff] [blame] | 393 | ${resp_code_match}= Get Regexp Matches ${resp} rsp=0xc1 |
| 394 | |
| 395 | ${cmd_support}= Set Variable If ${resp_code_match} != [] no yes |
| 396 | |
George Keishing | 409df05 | 2024-01-17 22:36:14 +0530 | [diff] [blame] | 397 | RETURN ${cmd_support} |
nagarjunb22 | 87138e6 | 2022-04-19 16:49:16 +0530 | [diff] [blame] | 398 | |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 399 | |
nagarjunb22 | 8ea859e | 2022-07-12 21:39:51 +0530 | [diff] [blame] | 400 | Get SDR Record ID |
| 401 | [Documentation] Fetch one record ID from SDR elist IPMI cmd response. |
| 402 | |
ishwaryamathim | 372cd86 | 2023-11-14 18:12:23 +0000 | [diff] [blame] | 403 | ${resp}= Run IPMI Standard Command sdr elist |
nagarjunb22 | 8ea859e | 2022-07-12 21:39:51 +0530 | [diff] [blame] | 404 | ${record_id}= Get Regexp Matches ${resp} \\|\\s+([0-9]+)h\\s+\\| 1 |
| 405 | |
George Keishing | 409df05 | 2024-01-17 22:36:14 +0530 | [diff] [blame] | 406 | RETURN ${record_id[0]} |
nagarjunb22 | 8ea859e | 2022-07-12 21:39:51 +0530 | [diff] [blame] | 407 | |
| 408 | |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 409 | Suite Setup Execution |
| 410 | [Documentation] Do the initial suite setup. |
| 411 | |
George Keishing | 2d0edad | 2021-08-18 11:44:10 -0500 | [diff] [blame] | 412 | Redfish.Login |
Rahul Maheshwari | b6ebe4c | 2019-07-17 02:02:17 -0500 | [diff] [blame] | 413 | Redfish Power On stack_mode=skip quiet=1 |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 414 | |
nagarjunb22 | 8ea859e | 2022-07-12 21:39:51 +0530 | [diff] [blame] | 415 | ${record_id}= Get SDR Record ID |
| 416 | Set Suite Variable ${record_id} |
| 417 | |
Nagarjun B | 1168d69 | 2023-02-16 16:29:57 +0530 | [diff] [blame] | 418 | # If REST is supported, then the uri_list will be returned. |
| 419 | ${resp}= OpenBMC Get Request ${OPENBMC_BASE_URI} |
| 420 | IF '${resp.status_code}' == '${HTTP_OK}' |
| 421 | ${uri_list}= Read Properties ${OPENBMC_BASE_URI}list |
| 422 | Set Suite Variable ${SYSTEM_URI} ${uri_list} |
| 423 | Log ${uri_list} |
| 424 | END |
Rahul Maheshwari | 77ab160 | 2018-02-28 07:21:55 -0600 | [diff] [blame] | 425 | |
| 426 | |
| 427 | Test Teardown Execution |
| 428 | [Documentation] Do the post test teardown. |
| 429 | |
| 430 | FFDC On Test Case Fail |