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