chithrag | 782ad28 | 2022-03-12 10:12:40 +0000 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Test IPMI Inband SDR commands. |
| 3 | ... Following IPMI command are verified, |
| 4 | ... 1. Get SDR, |
| 5 | ... 2. Get Device SDR Info, |
| 6 | ... 3. Reserve Device SDR Repository, |
| 7 | ... 4. Get Device SDR. |
| 8 | |
| 9 | Resource ../lib/ipmi_client.robot |
| 10 | Resource ../lib/openbmc_ffdc.robot |
| 11 | Resource ../lib/boot_utils.robot |
| 12 | Library ../lib/ipmi_utils.py |
| 13 | Variables ../data/ipmi_raw_cmd_table.py |
| 14 | |
George Keishing | e42cd02 | 2022-05-06 08:16:57 -0500 | [diff] [blame] | 15 | Suite setup Suite Setup Execution |
chithrag | 782ad28 | 2022-03-12 10:12:40 +0000 | [diff] [blame] | 16 | Suite Teardown Redfish.Logout |
| 17 | Test Teardown FFDC On Test Case Fail |
| 18 | |
George Keishing | 87dc442 | 2023-10-20 12:56:30 +0530 | [diff] [blame] | 19 | Force Tags IPMI_Inband_SDR |
chithrag | 782ad28 | 2022-03-12 10:12:40 +0000 | [diff] [blame] | 20 | |
| 21 | *** Test Cases *** |
| 22 | |
| 23 | Verify Get SDR For Maximum Record Via IPMI |
| 24 | [Documentation] Verify Get SDR for each and every record one by one via IPMI lanplus. |
| 25 | [Tags] Verify_Get_SDR_For_Maximum_Record_Via_IPMI |
| 26 | |
| 27 | # Gets the Total Record Count from SDR Info and the last Record entry number. |
| 28 | ${record_count} ${last_record}= Get Record Count And Last Record From SDR |
| 29 | |
| 30 | # Validate each and every record till the last record. |
| 31 | FOR ${record} IN RANGE 0 ${record_count} |
| 32 | # Convert number to hexadecimal record ID. |
| 33 | ${recordhex}= Convert To Hex ${record} length=2 lowercase=yes |
| 34 | |
| 35 | # Get SDR command. |
| 36 | ${resp}= Run IPMI Standard Command |
| 37 | ... raw ${IPMI_RAW_CMD['Get SDR']['Get'][1]} 0x00 0x00 0x${recordhex} 0x00 0x00 0xff |
| 38 | ${get_SDR}= Split String ${resp} |
| 39 | |
| 40 | # If the record ID reaches the last data available, the next record ID will be ff ff. |
| 41 | # eg, If total record ID available is 115, record IDs : 0 - 114, |
| 42 | # Then when record ID reaches last record ID (i.e 114 (decimal) - 72h), |
| 43 | # Get SDR response bytes 0:2 will be - ff ff 72 00 .... |
| 44 | # If not then (say 25 - 19h ), 1a 00 19 00 .... |
| 45 | |
| 46 | IF '${record}' != '${last_record}' |
| 47 | # current record ID in response data. |
| 48 | Should Be Equal ${get_SDR[2]} ${recordhex} |
| 49 | Should Be Equal ${get_SDR[3]} 00 |
| 50 | |
| 51 | # Next record ID in response data. |
| 52 | ${record_next}= Evaluate ${record} + 1 |
| 53 | ${record_next}= Convert To Hex ${record_next} length=2 lowercase=yes |
| 54 | Should Be Equal ${get_SDR[0]} ${record_next} |
| 55 | Should Be Equal ${get_SDR[1]} 00 |
| 56 | ELSE |
| 57 | # Next record ID in response data. |
| 58 | Should Be Equal ${get_SDR[0]} ff |
| 59 | Should Be Equal ${get_SDR[1]} ff |
| 60 | |
| 61 | # current record ID in response data. |
| 62 | Should Be Equal ${get_SDR[2]} ${recordhex} |
| 63 | Should Be Equal ${get_SDR[3]} 00 |
| 64 | END |
| 65 | |
| 66 | # Response Data Count - total records (max - FFh - 255 in decimal). |
| 67 | ${response_data}= Set Variable ${get_SDR[2:]} |
| 68 | ${length}= Get Length ${response_data} |
| 69 | Should Be True 0<${length}<=255 |
| 70 | END |
| 71 | |
| 72 | |
| 73 | Verify Sensor And SDR Count In Get Device SDR Info Via Inband IPMI |
| 74 | [Documentation] Verify Sensor and SDR Count in Get Device SDR Info via inband IPMI. |
| 75 | [Tags] Verify_Sensor_And_SDR_Count_In_Get_Device_SDR_Info_Via_Inband_IPMI |
| 76 | |
| 77 | # Get Sensor count and SDR elist all count from IPMI LAN interface. |
| 78 | ${sensor_count_lan1} ${SDR_count_lan1}= Get Count for Sensor And SDR Elist All |
| 79 | |
| 80 | # Get Sensor Count From Get Device SDR Info command. |
| 81 | ${sensor_count1}= Get Sensor Count From SDR Info |
| 82 | # Compare Get Device SDR Sensor count with Sensor count from lanplus. |
| 83 | Should Be Equal As Integers ${sensor_count1} ${sensor_count_lan1} |
| 84 | |
| 85 | # Get SDR Count From Get Device SDR Info command. |
| 86 | ${SDR_count1}= Get SDR Count From SDR Info |
| 87 | # Compare Get Device SDR Sdr count with SDR Elist All count from lanplus. |
| 88 | Should Be Equal As Integers ${SDR_count1} ${SDR_count_lan1} |
| 89 | |
| 90 | # Reboot Host using Chassis Power Cycle. |
| 91 | IPMI Power Cycle |
| 92 | |
| 93 | # Get Sensor count and SDR elist all count from IPMI lanplus interface. |
| 94 | ${sensor_count_lan2} ${SDR_count_lan2}= Get Count for Sensor And SDR Elist All |
| 95 | |
| 96 | # Get Sensor Count From Get Device SDR Info command. |
| 97 | ${sensor_count2}= Get Sensor Count From SDR Info |
| 98 | # Compare Get Device SDR Sensor count with Sensor count from lanplus. |
| 99 | Should Be Equal As Integers ${sensor_count2} ${sensor_count_lan2} |
| 100 | |
| 101 | # Get SDR Count From Get Device SDR Info command. |
| 102 | ${SDR_count2}= Get SDR Count From SDR Info |
| 103 | # Compare Get Device SDR Sdr count with SDR Elist All count from lanplus. |
| 104 | Should Be Equal As Integers ${SDR_count2} ${SDR_count_lan2} |
| 105 | |
| 106 | |
| 107 | Verify Timestamp In Get Device SDR Info Via Inband IPMI |
| 108 | [Documentation] Verify timestamp In Get Device SDR Info via inband IPMI. |
| 109 | [Tags] Verify_Timestamp_In_Get_Device_SDR_Info_Via_Inband_IPMI |
| 110 | |
| 111 | # Reboot Host using Chassis Power Cycle. |
| 112 | IPMI Power Cycle |
| 113 | |
| 114 | # Get epoch Timestamp obtained from Get Device SDR Info command. |
| 115 | ${SDR_timestamp}= Get Device SDR Timestamp |
| 116 | |
| 117 | # Get current date from BMC Native Date command and convert to epoch. |
| 118 | ${bmc_date}= Get Current Date from BMC |
| 119 | ${epoch_bmc}= Convert Date ${bmc_date} epoch exclude_millis=yes date_format=%m/%d/%Y %H:%M:%S |
| 120 | |
| 121 | # Compare time difference between bmc time and Get Device SDR Info timestamp. |
| 122 | # The maximum time difference should be less then 6 minute - 360 seconds. |
| 123 | ${difference}= Evaluate int(${epoch_bmc}) - int(${SDR_timestamp}) |
| 124 | Should Be True ${difference}<=360 |
| 125 | |
| 126 | |
| 127 | Verify Get Device SDR Info For Invalid Data Request |
| 128 | [Documentation] Verify Get Device SDR Info via inband IPMI with extra bytes. |
| 129 | [Tags] Verify_Get_Device_SDR_Info_For_Invalid_Data_Request |
| 130 | |
| 131 | # Sensor Count Via Device SDR Info with extra bytes. |
| 132 | ${resp}= Run Keyword and Expect Error *${IPMI_RAW_CMD['Device_SDR']['Get_Info'][3]}* |
| 133 | ... Run Inband IPMI Standard Command |
| 134 | ... raw ${IPMI_RAW_CMD['Device_SDR']['Get_Info'][0]} 0x00 |
| 135 | # Proper error code should be returned. |
| 136 | Should Contain ${resp} ${IPMI_RAW_CMD['Device_SDR']['Get_Info'][2]} |
| 137 | |
| 138 | # SDR Count Via Device SDR Info with extra bytes. |
| 139 | ${resp}= Run Keyword and Expect Error *${IPMI_RAW_CMD['Device_SDR']['Get_Info'][3]}* |
| 140 | ... Run Inband IPMI Standard Command |
| 141 | ... raw ${IPMI_RAW_CMD['Device_SDR']['Get_Info'][1]} 0x00 |
| 142 | # Proper error code should be returned. |
| 143 | Should Contain ${resp} ${IPMI_RAW_CMD['Device_SDR']['Get_Info'][2]} |
| 144 | |
| 145 | |
| 146 | Verify Device SDR Info Via IPMI Lanplus |
| 147 | [Documentation] Verify whether Get Device SDR Info command is accessible via lanplus. |
| 148 | [Tags] Verify_Device_SDR_Info_Via_IPMI_Lanplus |
| 149 | |
| 150 | # Sensor Count Via Device SDR Info via lanplus. |
| 151 | ${resp}= Run Keyword and Expect Error *${IPMI_RAW_CMD['Device_SDR']['Get_Info'][5]}* |
| 152 | ... Run IPMI Standard Command |
| 153 | ... raw ${IPMI_RAW_CMD['Device_SDR']['Get_Info'][0]} |
| 154 | # Proper error code should be returned. |
| 155 | Should Contain ${resp} ${IPMI_RAW_CMD['Device_SDR']['Get_Info'][4]} |
| 156 | |
| 157 | # SDR Count Via Device SDR Info via lanplus. |
| 158 | ${resp}= Run Keyword and Expect Error *${IPMI_RAW_CMD['Device_SDR']['Get_Info'][5]}* |
| 159 | ... Run IPMI Standard Command |
| 160 | ... raw ${IPMI_RAW_CMD['Device_SDR']['Get_Info'][1]} |
| 161 | # Proper error code should be returned. |
| 162 | Should Contain ${resp} ${IPMI_RAW_CMD['Device_SDR']['Get_Info'][4]} |
| 163 | |
| 164 | |
| 165 | Verify Reserve Device SDR Repository Via Inband IPMI |
| 166 | [Documentation] Verify Reserve Device SDR Repository via inband IPMI. |
| 167 | [Tags] Verify_Reserve_Device_SDR_Repository_Via_Inband_IPMI |
| 168 | |
| 169 | # Reserve Device SDR Repository via inband IPMI. |
| 170 | ${resp}= Get Reserve Device SDR Repository |
| 171 | ${reserve_id}= Split String ${resp} |
| 172 | |
| 173 | # Identify the byte count. |
| 174 | ${length}= Get Length ${reserve_id} |
| 175 | Should Be Equal As Integers ${length} 2 |
| 176 | |
| 177 | |
| 178 | Verify Reserve Device SDR Repository For Invalid Data Request |
| 179 | [Documentation] Verify Reserve Device SDR Repository via inband IPMI with extra request bytes. |
| 180 | [Tags] Verify_Reserve_Device_SDR_Repository_For_Invalid_Data_Request |
| 181 | |
| 182 | # Reserve Device SDR Repository with extra request bytes. |
| 183 | ${resp}= Run Keyword and Expect Error *${IPMI_RAW_CMD['Device_SDR']['Reserve_Repository'][2]}* |
| 184 | ... Run Inband IPMI Standard Command |
| 185 | ... raw ${IPMI_RAW_CMD['Device_SDR']['Reserve_Repository'][0]} 0x00 |
| 186 | # Proper error code should be returned. |
| 187 | Should Contain ${resp} ${IPMI_RAW_CMD['Device_SDR']['Reserve_Repository'][1]} |
| 188 | |
| 189 | |
| 190 | Verify Reserve Device SDR Repository Info Via IPMI Lanplus |
| 191 | [Documentation] Verify whether Reserve Device SDR Repository command is accessible via lanplus. |
George Keishing | e45d262 | 2022-05-05 07:27:30 -0500 | [diff] [blame] | 192 | [Tags] Verify_Reserve_Device_SDR_Repository_Info_Via_IPMI_Lanplus |
chithrag | 782ad28 | 2022-03-12 10:12:40 +0000 | [diff] [blame] | 193 | |
| 194 | # Reserve Device SDR Repository via lanplus. |
| 195 | ${resp}= Run Keyword and Expect Error *${IPMI_RAW_CMD['Device_SDR']['Reserve_Repository'][4]}* |
| 196 | ... Run IPMI Standard Command |
| 197 | ... raw ${IPMI_RAW_CMD['Device_SDR']['Reserve_Repository'][0]} |
| 198 | # Proper error code should be returned. |
| 199 | Should Contain ${resp} ${IPMI_RAW_CMD['Device_SDR']['Reserve_Repository'][3]} |
| 200 | |
| 201 | |
| 202 | Verify Reserve Device SDR Repository For Partial Record |
George Keishing | 6e64126 | 2022-05-05 10:46:22 -0500 | [diff] [blame] | 203 | [Documentation] Verify whether reservation ID of Reserve Device SDR Repository is accessible |
| 204 | ... to fetch partial record from Get Device SDR. |
chithrag | 782ad28 | 2022-03-12 10:12:40 +0000 | [diff] [blame] | 205 | [Tags] Verify_Reserve_Device_SDR_Repository_For_Partial_Record |
| 206 | |
| 207 | # Get Reservation ID. |
| 208 | ${resp}= Get Reserve Device SDR Repository |
| 209 | ${reserve_id}= Split String ${resp} |
| 210 | |
| 211 | # Check whether the response for Get device SDR command is obtained with the given Reservation ID. |
nagarjunb22 | 0c70140 | 2022-05-10 14:53:06 +0530 | [diff] [blame] | 212 | ${resp}= Run Inband IPMI Standard Command |
nagarjunb22 | 0f1d87e | 2022-07-12 21:09:25 +0530 | [diff] [blame] | 213 | ... raw ${IPMI_RAW_CMD['Device_SDR']['Get'][0]} 0x${reserve_id[0]} 0x${reserve_id[1]} 0x00 0x00 0x01 0x0f |
chithrag | 782ad28 | 2022-03-12 10:12:40 +0000 | [diff] [blame] | 214 | ${resp}= Split String ${resp} |
| 215 | # Record data starts from ${resp[2]}. |
| 216 | ${resp}= Set Variable ${resp[2:]} |
| 217 | ${length}= Get Length ${resp} |
| 218 | Should Be Equal As Integers ${length} 15 |
| 219 | |
| 220 | |
| 221 | Verify Reserve Device SDR Repository For Partial Record After BMC Reboot |
| 222 | [Documentation] Verify whether Reservation ID of Reserve Device SDR Repository, |
| 223 | ... is accessible after bmc reboot to fetch partial record from Get Device SDR. |
| 224 | [Tags] Verify_Reserve_Device_SDR_Repository_For_Partial_Record_After_BMC_Reboot |
| 225 | |
| 226 | # Generate Reservation ID. |
| 227 | ${resp}= Get Reserve Device SDR Repository |
| 228 | ${reserve_id}= Split String ${resp} |
| 229 | |
| 230 | # Check whether the response for Get device SDR command is obtained with the given Reservation ID. |
nagarjunb22 | 0c70140 | 2022-05-10 14:53:06 +0530 | [diff] [blame] | 231 | ${resp1}= Run Inband IPMI Standard Command |
nagarjunb22 | 0f1d87e | 2022-07-12 21:09:25 +0530 | [diff] [blame] | 232 | ... raw ${IPMI_RAW_CMD['Device_SDR']['Get'][0]} 0x${reserve_id[0]} 0x${reserve_id[1]} 0x00 0x00 0x01 0x0f |
chithrag | 782ad28 | 2022-03-12 10:12:40 +0000 | [diff] [blame] | 233 | |
| 234 | # Reboot bmc. |
nagarjunb22 | 0c70140 | 2022-05-10 14:53:06 +0530 | [diff] [blame] | 235 | IPMI MC Reset Cold (run) |
chithrag | 782ad28 | 2022-03-12 10:12:40 +0000 | [diff] [blame] | 236 | |
| 237 | # Check whether the response for Get device SDR command is obtained with the given Reservation ID. |
| 238 | # Reserve IDs are volatile so once bmc is rebooted, new Reserve ID should be generated. |
| 239 | ${resp2}= Run Keyword and Expect Error *${IPMI_RAW_CMD['Device_SDR']['Reserve_Repository'][5]}* |
nagarjunb22 | 0c70140 | 2022-05-10 14:53:06 +0530 | [diff] [blame] | 240 | ... Run Inband IPMI Standard Command |
nagarjunb22 | 0f1d87e | 2022-07-12 21:09:25 +0530 | [diff] [blame] | 241 | ... raw ${IPMI_RAW_CMD['Device_SDR']['Get'][0]} 0x${reserve_id[0]} 0x${reserve_id[1]} 0x00 0x00 0x01 0x0f |
chithrag | 782ad28 | 2022-03-12 10:12:40 +0000 | [diff] [blame] | 242 | |
| 243 | |
| 244 | Verify Reserve Device SDR Repository Invalid Reservation ID For Partial Record |
| 245 | [Documentation] Verify whether invalid reservation ID of Reserve Device SDR Repository, |
| 246 | ... is accessible to fetch partial record from Get Device SDR. |
| 247 | [Tags] Verify_Reserve_Device_SDR_Repository_Invalid_Reservation_ID_For_Partial_Record |
| 248 | |
| 249 | # Generate Reservation ID 1. |
| 250 | ${resp}= Get Reserve Device SDR Repository |
| 251 | ${reserve_id}= Split String ${resp} |
| 252 | |
| 253 | # Generate Reservation ID 2. |
| 254 | ${resp2}= Get Reserve Device SDR Repository |
| 255 | |
| 256 | # Check whether response for Gner device SDR command is obtained with Reservation ID 1. |
| 257 | # Once Reservation ID is overwritten, old Reservation ID will be invalid. |
| 258 | ${resp1}= Run Keyword and Expect Error *${IPMI_RAW_CMD['Device_SDR']['Reserve_Repository'][5]}* |
nagarjunb22 | 0c70140 | 2022-05-10 14:53:06 +0530 | [diff] [blame] | 259 | ... Run Inband IPMI Standard Command |
nagarjunb22 | 0f1d87e | 2022-07-12 21:09:25 +0530 | [diff] [blame] | 260 | ... raw ${IPMI_RAW_CMD['Device_SDR']['Get'][0]} 0x${reserve_id[0]} 0x${reserve_id[1]} 0x00 0x00 0x01 0x0f |
chithrag | 782ad28 | 2022-03-12 10:12:40 +0000 | [diff] [blame] | 261 | |
| 262 | |
| 263 | Verify Get Device SDR For Maximum Record Via IPMI |
nagarjunb22 | 0c70140 | 2022-05-10 14:53:06 +0530 | [diff] [blame] | 264 | [Documentation] Verify Get Device SDR for each and every Record Via IPMI Inband. |
chithrag | 782ad28 | 2022-03-12 10:12:40 +0000 | [diff] [blame] | 265 | [Tags] Verify_Get_Device_SDR_For_Maximum_Record_Via_IPMI |
| 266 | |
| 267 | # Gets the Total Record Count from SDR Info and the last Record entry number. |
| 268 | ${record_count} ${last_record}= Get Record Count And Last Record From SDR |
| 269 | |
| 270 | # Validate each and every record till the last record. |
| 271 | FOR ${record} IN RANGE 0 ${record_count} |
| 272 | # Convert number to hexadecimal record ID. |
| 273 | ${recordhex}= Convert To Hex ${record} length=2 lowercase=yes |
| 274 | |
nagarjunb22 | 0c70140 | 2022-05-10 14:53:06 +0530 | [diff] [blame] | 275 | # Get Device SDR command. |
| 276 | ${resp}= Run Inband IPMI Standard Command |
chithrag | 782ad28 | 2022-03-12 10:12:40 +0000 | [diff] [blame] | 277 | ... raw ${IPMI_RAW_CMD['Device_SDR']['Get'][0]} 0x00 0x00 0x${recordhex} 0x00 0x00 0xff |
| 278 | ${get_dev_SDR}= Split String ${resp} |
| 279 | |
| 280 | # If the record ID reaches the last data available, the next record ID will be ff ff |
| 281 | # eg, If total record ID available is 115, record IDs : 0 - 114, |
| 282 | # Then when record ID reaches last record ID (i.e 114 (in decimal) - 72h), |
| 283 | # Get SDR response bytes 0:2 will be - ff ff 72 00 .... |
| 284 | # If not then (say 25 - 19h ), 1a 00 19 00 .... |
| 285 | |
| 286 | IF '${record}' != '${last_record}' |
| 287 | # current record ID in response data. |
| 288 | Should Be Equal ${get_dev_SDR[2]} ${recordhex} |
| 289 | Should Be Equal ${get_dev_SDR[3]} 00 |
| 290 | |
| 291 | # Next record ID in response data. |
| 292 | ${record_next}= Evaluate ${record} + 1 |
| 293 | ${record_next}= Convert To Hex ${record_next} length=2 lowercase=yes |
| 294 | Should Be Equal ${get_dev_SDR[0]} ${record_next} |
| 295 | Should Be Equal ${get_dev_SDR[1]} 00 |
| 296 | |
| 297 | ELSE |
| 298 | # Next record ID in response data. |
| 299 | Should Be Equal ${get_dev_SDR[0]} ff |
| 300 | Should Be Equal ${get_dev_SDR[1]} ff |
| 301 | |
| 302 | # current record ID in response data. |
| 303 | Should Be Equal ${get_dev_SDR[2]} ${recordhex} |
| 304 | Should Be Equal ${get_dev_SDR[3]} 00 |
| 305 | |
| 306 | END |
| 307 | # Response data count - total record ID (max - FFh - 255 in decimal). |
| 308 | ${response_data}= Set Variable ${get_dev_SDR[2:]} |
| 309 | ${length}= Get Length ${response_data} |
| 310 | Should Be True 0<${length}<=255 |
| 311 | END |
| 312 | |
| 313 | |
| 314 | Verify Get Device SDR For Invalid Data Request Via IPMI |
| 315 | [Documentation] Verify Get Device SDR via IPMI lanplus with extra bytes. |
| 316 | [Tags] Verify_Get_Device_SDR_For_Invalid_Data_Request_Via_IPMI |
| 317 | |
| 318 | # Get SDR command with extra bytes. |
| 319 | ${resp}= Run Keyword and Expect Error *${IPMI_RAW_CMD['Device_SDR']['Get'][3]}* |
nagarjunb22 | 0c70140 | 2022-05-10 14:53:06 +0530 | [diff] [blame] | 320 | ... Run Inband IPMI Standard Command |
chithrag | 782ad28 | 2022-03-12 10:12:40 +0000 | [diff] [blame] | 321 | ... raw ${IPMI_RAW_CMD['Device_SDR']['Get'][0]} 0x00 0x00 ${IPMI_RAW_CMD['Device_SDR']['Get'][1]} 0x00 |
| 322 | # Proper error code should be returned. |
| 323 | Should Contain ${resp} ${IPMI_RAW_CMD['Device_SDR']['Get'][2]} |
| 324 | |
| 325 | |
| 326 | *** Keywords *** |
| 327 | |
| 328 | Get IPMI Sensor Count |
| 329 | [Documentation] Get sensors count using "SDR elist all" command. |
| 330 | # Example of "SDR elist all" command output: |
| 331 | # BootProgress | 03h | ok | 34.2 | |
| 332 | # OperatingSystemS | 05h | ok | 35.1 | |
| 333 | # AttemptsLeft | 07h | ok | 34.1 | |
| 334 | # occ0 | 08h | ok | 210.1 | Device Disabled |
| 335 | # occ1 | 09h | ok | 210.2 | Device Disabled |
| 336 | # p0_core0_temp | 11h | ns | 3.1 | Disabled |
| 337 | # cpu0_core0 | 12h | ok | 208.1 | Presence detected |
| 338 | # p0_core1_temp | 14h | ns | 3.2 | Disabled |
| 339 | # cpu0_core1 | 15h | ok | 208.2 | Presence detected |
| 340 | # p0_core2_temp | 17h | ns | 3.3 | Disabled |
| 341 | # .. |
| 342 | # .. |
| 343 | # .. |
| 344 | # .. |
| 345 | # .. |
| 346 | # .. |
| 347 | # fan3 | 00h | ns | 29.4 | Logical FRU @35h |
| 348 | # bmc | 00h | ns | 6.1 | Logical FRU @3Ch |
| 349 | # ethernet | 00h | ns | 1.1 | Logical FRU @46h |
| 350 | |
nagarjunb22 | 0c70140 | 2022-05-10 14:53:06 +0530 | [diff] [blame] | 351 | ${output}= Run IPMI Standard Command sdr elist all |
chithrag | 782ad28 | 2022-03-12 10:12:40 +0000 | [diff] [blame] | 352 | ${sensor_list}= Split String ${output} \n |
| 353 | ${sensor_count}= Get Length ${sensor_list} |
| 354 | [Return] ${sensor_count} |
| 355 | |
| 356 | |
| 357 | Get Device SDR Info For Sensor Data |
| 358 | [Documentation] Get Device SDR Info via inband IPMI and return response data with Sensor count. |
| 359 | |
| 360 | # Get Device SDR Info for Sensor data. |
| 361 | ${sensor_data}= Run Inband IPMI Standard Command |
| 362 | ... raw ${IPMI_RAW_CMD['Device_SDR']['Get_Info'][0]} |
| 363 | |
| 364 | [Return] ${sensor_data} |
| 365 | |
| 366 | |
| 367 | Get Device SDR Info For SDR Data |
| 368 | [Documentation] Get Device SDR Info via inband IPMI and return response data with SDR count. |
| 369 | |
| 370 | # Get Device SDR Info for SDR data. |
| 371 | ${SDR_data}= Run Inband IPMI Standard Command |
| 372 | ... raw ${IPMI_RAW_CMD['Device_SDR']['Get_Info'][1]} |
| 373 | |
| 374 | [Return] ${SDR_data} |
| 375 | |
| 376 | |
| 377 | Get Sensor Count From SDR Info |
| 378 | [Documentation] Get Sensor Count from Get Device SDR Info data. |
| 379 | |
| 380 | # Get Device SDR Info Via inband IPMI for Sensor count. |
| 381 | ${sensor_data}= Get Device SDR Info For Sensor Data |
| 382 | |
| 383 | # Get Sensor count from Get Device SDR Info count - bytie 0. |
| 384 | ${sensor_data}= Split String ${sensor_data} |
| 385 | ${sensor_count}= Set Variable ${sensor_data[0]} |
| 386 | ${sensor_count}= Convert To Integer ${sensor_count} 16 |
| 387 | |
| 388 | [Return] ${sensor_count} |
| 389 | |
| 390 | |
| 391 | Get SDR Count From SDR Info |
| 392 | [Documentation] Get SDR Count from Get Device SDR Info data. |
| 393 | |
| 394 | # Get Device SDR Info Via inband IPMI for SDR count. |
| 395 | ${SDR_data}= Get Device SDR Info For SDR Data |
| 396 | |
| 397 | # Get SDR count from Get Device SDR Info count - byte 0. |
| 398 | ${SDR_data}= Split String ${SDR_data} |
| 399 | ${SDR_count}= Set Variable ${SDR_data[0]} |
| 400 | ${SDR_count}= Convert To Integer ${SDR_count} 16 |
| 401 | |
| 402 | [Return] ${SDR_count} |
| 403 | |
| 404 | |
| 405 | Get Device SDR Timestamp |
| 406 | [Documentation] Get Timestamp from Get Device SDR Info. |
| 407 | |
| 408 | # Get Device SDR Info Via inband IPMI for Sendor count. |
| 409 | ${sensor_data}= Get Device SDR Info For Sensor Data |
| 410 | # Get Device SDR Info Via inband IPMI for SDR count. |
| 411 | ${SDR_data}= Get Device SDR Info For SDR Data |
| 412 | |
| 413 | # Split into list. |
| 414 | ${sensor_data}= Split String ${sensor_data} |
| 415 | ${SDR_data}= Split String ${SDR_data} |
| 416 | |
| 417 | # Timestamp for the Get SDR count will be from Response byte 2 to N. |
| 418 | # Compare the timestamps for Sensor data and SDR data. |
| 419 | Should Be Equal ${sensor_data[2:]} ${SDR_data[2:]} |
| 420 | |
| 421 | # Convert Bytestamp to Epoch timestamp. |
| 422 | ${timestamp}= Set Variable ${SDR_data[2:]} |
| 423 | Reverse List ${timestamp} |
| 424 | ${timestamp}= Evaluate "".join(${timestamp}) |
| 425 | # Prefixes 0s for expected bytes. |
| 426 | ${timestamp}= Zfill Data ${timestamp} 8 |
| 427 | ${timestamp}= Convert To Integer ${timestamp} 16 |
| 428 | |
| 429 | [Return] ${timestamp} |
| 430 | |
| 431 | |
| 432 | Get Count for Sensor And SDR Elist All |
| 433 | [Documentation] Get Sensor and SDR elist all count via IPMI lanplus. |
| 434 | |
| 435 | # Get Sensor list via IPMI lanplus. |
| 436 | ${sensor_count}= Run IPMI Standard Command sensor | wc -l |
| 437 | # Get SDR elist all via IPMI lanplus. |
| 438 | ${SDR_count}= Get IPMI Sensor Count |
| 439 | |
| 440 | [Return] ${sensor_count} ${SDR_count} |
| 441 | |
| 442 | |
| 443 | Get Reserve Device SDR Repository |
| 444 | [Documentation] Get Reserve Device SDR Repository via Inband IPMI. |
| 445 | |
| 446 | # Reserve Device SDR Repository command via inband. |
| 447 | ${resp}= Run Inband IPMI Standard Command |
| 448 | ... raw ${IPMI_RAW_CMD['Device_SDR']['Reserve_Repository'][0]} |
| 449 | |
| 450 | [Return] ${resp} |
| 451 | |
| 452 | |
| 453 | Get IPMI SDR Status Info |
| 454 | [Documentation] Returns status for given IPMI SDR Info. |
| 455 | [Arguments] ${setting} |
| 456 | # Description of argument(s): |
| 457 | # setting SDR Info which needs to be read(e.g. "SDR Version"). |
| 458 | # SDR Version : 0x51 |
| 459 | # Record Count : 58 |
| 460 | # Free Space : 9312 bytes |
| 461 | # Most recent Addition : 03/10/2022 05:56:02 |
| 462 | # Most recent Erase : 02/07/2106 06:28:15 |
| 463 | # SDR overflow : yes |
| 464 | # SDR Repository Update Support : unspecified |
| 465 | # Delete SDR supported : no |
| 466 | # Partial Add SDR supported : no |
| 467 | # Reserve SDR repository supported : yes |
| 468 | # SDR Repository Alloc info supported : yes |
| 469 | |
| 470 | # Get SDR Info IPMI command. |
nagarjunb22 | 0c70140 | 2022-05-10 14:53:06 +0530 | [diff] [blame] | 471 | ${resp}= Run IPMI Standard Command sdr info |
chithrag | 782ad28 | 2022-03-12 10:12:40 +0000 | [diff] [blame] | 472 | |
| 473 | # Return lines for given IPMI SDR Info. |
| 474 | ${setting_line}= Get Lines Containing String ${resp} ${setting} |
| 475 | ... case-insensitive |
| 476 | ${setting_status}= Fetch From Right ${setting_line} :${SPACE} |
| 477 | |
| 478 | [Return] ${setting_status} |
| 479 | |
| 480 | |
| 481 | Get Record Count And Last Record From SDR |
| 482 | [Documentation] Returns total record count from IPMI SDR Info and last SDR record. |
| 483 | |
| 484 | # Returns Record count from IPMI SDR Info. |
| 485 | ${record_count}= Get IPMI SDR Status Info Record Count |
| 486 | |
| 487 | # Identifies Last record ID. |
| 488 | # If Record Count = 58 (3Ah), record IDs range from 0 to 57. |
| 489 | # Then Last record ID will be 57 (in decimal) - 39h. |
| 490 | ${last_record}= Evaluate ${record_count} - 1 |
| 491 | |
| 492 | [Return] ${record_count} ${last_record} |
George Keishing | e42cd02 | 2022-05-06 08:16:57 -0500 | [diff] [blame] | 493 | |
| 494 | |
| 495 | Suite Setup Execution |
| 496 | [Documentation] Do suite setup tasks. |
George Keishing | e42cd02 | 2022-05-06 08:16:57 -0500 | [diff] [blame] | 497 | Redfish.Login |
| 498 | Should Not Be Empty ${OS_HOST} msg=Please provide required parameter OS_HOST |
| 499 | Should Not Be Empty ${OS_USERNAME} msg=Please provide required parameter OS_USERNAME |
George Keishing | 42c84ea | 2023-09-07 20:31:45 +0530 | [diff] [blame] | 500 | Should Not Be Empty ${OS_PASSWORD} msg=Please provide required parameter OS_PASSWORD |