1*** 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
15Suite setup            Suite Setup Execution
16Suite Teardown         Redfish.Logout
17Test Teardown          FFDC On Test Case Fail
18
19Test Tags             IPMI_Inband_SDR
20
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.
33        ${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]
36
37        # Get SDR command.
38        ${resp}=  Run IPMI Standard Command
39        ...  raw ${IPMI_RAW_CMD['Get SDR']['Get'][1]} 0x00 0x00 0x${second_digit} 0x${first_digit} 0x00 0xff
40        ${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.
50          Should Be Equal  ${get_SDR[2]}  ${second_digit}
51          Should Be Equal  ${get_SDR[3]}  ${first_digit}
52
53          # Next record ID in response data.
54          ${record_next}=  Evaluate  ${record} + 1
55          ${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}
60        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.
66          Should Be Equal  ${get_SDR[2]}  ${second_digit}
67          Should Be Equal  ${get_SDR[3]}  ${first_digit}
68        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
91    # 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
96    # Compare Get Device SDR Sdr count with SDR Elist All count from lanplus.
97    Should Be Equal As Integers  ${sdr_info_record_count}  ${SDR_count_lan1}
98
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
112    ${sdr_info_record_count2}=  Evaluate  ${SDR_count2} - ${sdr_oem}
113    # Compare Get Device SDR Sdr count with SDR Elist All count from lanplus.
114    Should Be Equal As Integers  ${sdr_info_record_count2}  ${SDR_count_lan2}
115
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]}*
162    ...  Run External IPMI Standard Command
163    ...  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]}*
169    ...  Run External IPMI Standard Command
170    ...  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.
202    [Tags]  Verify_Reserve_Device_SDR_Repository_Info_Via_IPMI_Lanplus
203
204    # Reserve Device SDR Repository via lanplus.
205    ${resp}=  Run Keyword and Expect Error  *${IPMI_RAW_CMD['Device_SDR']['Reserve_Repository'][4]}*
206    ...  Run External IPMI Standard Command
207    ...  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
213    [Documentation]  Verify whether reservation ID of Reserve Device SDR Repository is accessible
214    ...              to fetch partial record from Get Device SDR.
215    [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.
222    ${resp}=  Run Inband IPMI Standard Command
223    ...  raw ${IPMI_RAW_CMD['Device_SDR']['Get'][0]} 0x${reserve_id[0]} 0x${reserve_id[1]} 0x00 0x00 0x01 0x0f
224    ${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.
241    ${resp1}=  Run Inband IPMI Standard Command
242    ...  raw ${IPMI_RAW_CMD['Device_SDR']['Get'][0]} 0x${reserve_id[0]} 0x${reserve_id[1]} 0x00 0x00 0x01 0x0f
243
244    # Reboot bmc.
245    IPMI MC Reset Cold (run)
246
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]}*
250    ...  Run Inband IPMI Standard Command
251    ...  raw ${IPMI_RAW_CMD['Device_SDR']['Get'][0]} 0x${reserve_id[0]} 0x${reserve_id[1]} 0x00 0x00 0x01 0x0f
252
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]}*
269    ...  Run Inband IPMI Standard Command
270    ...  raw ${IPMI_RAW_CMD['Device_SDR']['Get'][0]} 0x${reserve_id[0]} 0x${reserve_id[1]} 0x00 0x00 0x01 0x0f
271
272
273Verify Get Device SDR For Maximum Record Via IPMI
274    [Documentation]  Verify Get Device SDR for each and every Record Via IPMI Inband.
275    [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.
283        ${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]
286
287        # Get Device SDR command.
288        ${resp}=  Run Inband IPMI Standard Command
289        ...  raw ${IPMI_RAW_CMD['Device_SDR']['Get'][0]} 0x00 0x00 0x${second_digit} 0x${first_digit} 0x00 0xff
290        ${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.
300          Should Be Equal  ${get_dev_SDR[2]}  ${second_digit}
301          Should Be Equal  ${get_dev_SDR[3]}  ${first_digit}
302
303          # Next record ID in response data.
304          ${record_next}=  Evaluate  ${record} + 1
305          ${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}
310
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.
317          Should Be Equal  ${get_dev_SDR[2]}  ${second_digit}
318          Should Be Equal  ${get_dev_SDR[3]}  ${first_digit}
319
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]}*
334    ...  Run Inband IPMI Standard Command
335    ...  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
365    ${output}=  Run IPMI Standard Command  sdr elist all
366    ${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.
485    ${resp}=  Run IPMI Standard Command  sdr info
486
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}
507
508
509Suite Setup Execution
510   [Documentation]  Do suite setup tasks.
511    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
514    Should Not Be Empty  ${OS_PASSWORD}  msg=Please provide required parameter OS_PASSWORD
515