blob: 96d550ab39b9728f866452e78371e3983d2903db [file] [log] [blame]
Rahul Maheshwari77ab1602018-02-28 07:21:55 -06001*** Settings ***
2Documentation Test IPMI sensor IDs.
3
George Keishingd6bc1c12019-03-08 12:59:29 -06004Resource ../lib/ipmi_client.robot
ganesanbd0c4b802023-04-28 18:29:38 +00005Resource ../lib/rest_client.robot
George Keishingd6bc1c12019-03-08 12:59:29 -06006Resource ../lib/openbmc_ffdc.robot
7Resource ../lib/boot_utils.robot
8Resource ../lib/bmc_redfish_resource.robot
Rahul Maheshwaribad5e822019-07-30 12:36:27 -05009Library ../lib/ipmi_utils.py
nagarjunb2287138e62022-04-19 16:49:16 +053010Library ../lib/utilities.py
11Variables ../data/ipmi_raw_cmd_table.py
Rahul Maheshwari77ab1602018-02-28 07:21:55 -060012
13Suite setup Suite Setup Execution
George Keishing2d0edad2021-08-18 11:44:10 -050014Suite Teardown Redfish.Logout
Rahul Maheshwari77ab1602018-02-28 07:21:55 -060015Test Teardown Test Teardown Execution
16
Matt Fischer6fb70d92023-10-24 19:06:33 -060017Test Tags IPMI_SDR
Rahul Maheshwari77ab1602018-02-28 07:21:55 -060018
19*** Test Cases ***
20
Rahul Maheshwaribad5e822019-07-30 12:36:27 -050021Verify 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
nagarjunb2287138e62022-04-19 16:49:16 +053037 # 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 Maheshwaribad5e822019-07-30 12:36:27 -050047 ${sdr_info}= Get SDR Info
48 Should Be Equal ${sdr_info['sdr_version']} 0x51
49
manimozhikdd321652023-11-08 10:22:06 +000050 # Get SDR OEM record count from "sdr elist -vvv" command output.
51 ${sdr_data}= Run IPMI Standard Command sdr elist -vvv
KManimozhi123f320b4e2024-03-13 10:22:41 +000052 ${sdr_oem}= Fetch OEM Sdr Count ${sdr_data}
manimozhikdd321652023-11-08 10:22:06 +000053 ${sdr_info_record_count}= Evaluate ${sdr_info['record_count']} - ${sdr_oem}
54
Rahul Maheshwaribad5e822019-07-30 12:36:27 -050055 # Get sensor count from "sdr elist all" command output.
56 ${sensor_count}= Get Sensor Count
57 Should Be Equal As Strings
manimozhikdd321652023-11-08 10:22:06 +000058 ... ${sdr_info_record_count} ${sensor_count}
Rahul Maheshwaribad5e822019-07-30 12:36:27 -050059
60 Should Be Equal ${sdr_info['free_space']} unspecified
nagarjunb2287138e62022-04-19 16:49:16 +053061 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 Maheshwaribad5e822019-07-30 12:36:27 -050064 Should Be Equal ${sdr_info['sdr_repository_update_support']} unspecified
nagarjunb2287138e62022-04-19 16:49:16 +053065 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 Maheshwaribad5e822019-07-30 12:36:27 -050069
Rahul Maheshwari77ab1602018-02-28 07:21:55 -060070
71Test CPU Core SDR Info At Power On
George Keishingd6bc1c12019-03-08 12:59:29 -060072 [Documentation] Verify CPU core SDR info via IPMI and Redfish at power on.
Rahul Maheshwari77ab1602018-02-28 07:21:55 -060073
74 [Tags] Test_CPU_Core_SDR_Info_At_Power_On
75
George Keishingd6bc1c12019-03-08 12:59:29 -060076 Redfish Power On stack_mode=skip quiet=1
Rahul Maheshwari77ab1602018-02-28 07:21:55 -060077 Test SDR Info core
78
79
80Test DIMM SDR Info At Power On
George Keishingd6bc1c12019-03-08 12:59:29 -060081 [Documentation] Verify DIMM SDR info via IPMI and Redfish at power on.
Rahul Maheshwari77ab1602018-02-28 07:21:55 -060082
83 [Tags] Test_DIMM_SDR_Info_At_Power_On
84
George Keishingd6bc1c12019-03-08 12:59:29 -060085 Redfish Power On stack_mode=skip quiet=1
Rahul Maheshwari77ab1602018-02-28 07:21:55 -060086 Test SDR Info dimm
87
Rahul Maheshwaricd7b19c2018-04-10 07:35:56 -050088
89Test GPU SDR Info At Power On
George Keishingd6bc1c12019-03-08 12:59:29 -060090 [Documentation] Verify GPU SDR info via IPMI and Redfish at power on.
Rahul Maheshwaricd7b19c2018-04-10 07:35:56 -050091
92 [Tags] Test_GPU_SDR_Info_At_Power_On
93
George Keishingd6bc1c12019-03-08 12:59:29 -060094 Redfish Power On stack_mode=skip quiet=1
Rahul Maheshwaricd7b19c2018-04-10 07:35:56 -050095 Test SDR Info gv100card
96
97
Rahul Maheshwari77ab1602018-02-28 07:21:55 -060098Test CPU Core SDR Info At Power Off
George Keishingd6bc1c12019-03-08 12:59:29 -060099 [Documentation] Verify CPU core SDR info via IPMI and Redfish at power off.
Rahul Maheshwari77ab1602018-02-28 07:21:55 -0600100
101 [Tags] Test_CPU_Core_SDR_Info_At_Power_Off
102
George Keishingd6bc1c12019-03-08 12:59:29 -0600103 Redfish Hard Power Off stack_mode=skip quiet=1
Rahul Maheshwari77ab1602018-02-28 07:21:55 -0600104 Test SDR Info core
105
106
107Test DIMM SDR Info At Power Off
George Keishingd6bc1c12019-03-08 12:59:29 -0600108 [Documentation] Verify DIMM SDR info via IPMI and Redfish at power off.
Rahul Maheshwari77ab1602018-02-28 07:21:55 -0600109
110 [Tags] Test_DIMM_SDR_Info_At_Power_Off
111
George Keishingd6bc1c12019-03-08 12:59:29 -0600112 Redfish Hard Power Off stack_mode=skip quiet=1
Rahul Maheshwari77ab1602018-02-28 07:21:55 -0600113 Test SDR Info dimm
114
115
Rahul Maheshwaricd7b19c2018-04-10 07:35:56 -0500116Test Auto Reboot SDR Info
George Keishingd6bc1c12019-03-08 12:59:29 -0600117 [Documentation] Verify auto reboot SDR info via IPMI and Redfish.
Rahul Maheshwaricd7b19c2018-04-10 07:35:56 -0500118 [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
George Keishing1f8baa22025-05-15 23:50:56 +0530127 IF '${state_ipmi}' == 'Disabled'
128 Should Be True ${state_rest} == ${0}
129 ELSE IF '${state_ipmi}' == 'State Asserted'
130 Should Be True ${state_rest} == ${1}
131 END
Rahul Maheshwaricd7b19c2018-04-10 07:35:56 -0500132
133
134Test TPM Enable SDR Info
George Keishingd6bc1c12019-03-08 12:59:29 -0600135 [Documentation] Verify auto reboot SDR info via IPMI and Redfish.
Rahul Maheshwaricd7b19c2018-04-10 07:35:56 -0500136 [Tags] Test_TPM_Enable_SDR_Info
137
138
139 ${component_uri_list}= Get Component URIs TPMEnable
140 ${component_uri}= Get From List ${component_uri_list} 0
141 ${state_rest}= Read Attribute ${component_uri} TPMEnable
142
143 ${state_ipmi}= Get SDR Presence Via IPMI auto_reboot${SPACE}
144
George Keishing1f8baa22025-05-15 23:50:56 +0530145 IF '${state_ipmi}' == 'Disabled'
146 Should Be True ${state_rest} == ${0}
147 ELSE IF '${state_ipmi}' == 'State Asserted'
148 Should Be True ${state_rest} == ${1}
149 END
Rahul Maheshwaricd7b19c2018-04-10 07:35:56 -0500150
nagarjunb228ea859e2022-07-12 21:39:51 +0530151
nagarjunb2287138e62022-04-19 16:49:16 +0530152Test Reserve SDR Repository
153 [Documentation] Verify Reserve SDR Repository IPMI command.
154 [Tags] Test_Reserve_SDR_Repository
155
156 ${reservation_id}= Get Reservation ID convert_lsb_to_msb=True
157
158 # Getting another Reservation ID and verify it is different from previous Reservation ID.
159 ${new_reservation_id}= Get Reservation ID convert_lsb_to_msb=True
160
161 Should Not Be Equal ${reservation_id} ${new_reservation_id}
nagarjunb228ea859e2022-07-12 21:39:51 +0530162 ... msg=Getting same reservation ID for second time, reservation ID must be different.
163
nagarjunb2287138e62022-04-19 16:49:16 +0530164
165Test Get SDR Using Reservation ID
166 [Documentation] Verify get SDR command using reservation ID obtained from Reserve SDR repository.
167 [Tags] Test_Get_SDR_Using_Reservation_ID
168
169 ${reservation_id}= Get Reservation ID add_prefix=True
170
171 # Get SDR full without using Reservation ID.
ishwaryamathim372cd862023-11-14 18:12:23 +0000172 Run IPMI Command ${IPMI_RAW_CMD['SDR']['Get'][0]}
nagarjunb2287138e62022-04-19 16:49:16 +0530173
174 # Get SDR Partially using Reservation ID.
175 ${get_sdr_raw_cmd}= Catenate
nagarjunb228ea859e2022-07-12 21:39:51 +0530176 ... ${IPMI_RAW_CMD['Get SDR']['Get'][1]} ${reservation_id} 0x${record_id} 0x00
177 ... ${IPMI_RAW_CMD['Get SDR']['Get'][2]}
ishwaryamathim372cd862023-11-14 18:12:23 +0000178 Run IPMI Command ${get_sdr_raw_cmd}
nagarjunb2287138e62022-04-19 16:49:16 +0530179
180 # Get SDR partially without using reservation ID and expect error.
181 Verify Invalid IPMI Command ${IPMI_RAW_CMD['SDR']['Get'][3]} 0xc5
182
183
184Test Get SDR Using Invalid Reservation ID
185 [Documentation] Verify get SDR command using invalid reservation ID.
186 [Tags] Test_Get_SDR_Using_Invalid_Reservation_ID
187
188 # Generate two reservation ID and verify get SDR partial using old reservation ID.
189 ${first_reservation_id}= Get Reservation ID add_prefix=True
190 ${second_reservation_id}= Get Reservation ID add_prefix=True
191
nagarjunb228ea859e2022-07-12 21:39:51 +0530192 # Creating the raw cmd with First reservation ID.
nagarjunb2287138e62022-04-19 16:49:16 +0530193 ${get_sdr_raw_cmd}= Catenate
nagarjunb228ea859e2022-07-12 21:39:51 +0530194 ... ${IPMI_RAW_CMD['Get SDR']['Get'][1]} ${first_reservation_id} 0x${record_id} 0x00
195 ... ${IPMI_RAW_CMD['Get SDR']['Get'][2]}
nagarjunb2287138e62022-04-19 16:49:16 +0530196
nagarjunb2287138e62022-04-19 16:49:16 +0530197
198Test Reserve SDR Repository After BMC Reboot
199 [Documentation] Verify reserve SDR repository reservation ID after BMC Reboot.
200 [Tags] Test_Reserve_SDR_Repository_After_BMC_Reboot
201
202 # Get Reservation ID before reboot.
203 ${reservation_id_before_reboot}= Get Reservation ID add_prefix=True
204
205 # Cold reset BMC
206 IPMI MC Reset Cold (run)
207
nagarjunb228ea859e2022-07-12 21:39:51 +0530208 # Waiting to for sdr to populate.
209 Sleep 10s
210
nagarjunb2287138e62022-04-19 16:49:16 +0530211 # Create Get SDR Partially command using reservation ID which got before reboot.
212 ${get_sdr_raw_cmd}= Catenate
nagarjunb228ea859e2022-07-12 21:39:51 +0530213 ... ${IPMI_RAW_CMD['Get SDR']['Get'][1]} ${reservation_id_before_reboot} 0x${record_id} 0x00
214 ... ${IPMI_RAW_CMD['Get SDR']['Get'][2]}
nagarjunb2287138e62022-04-19 16:49:16 +0530215
216 Verify Invalid IPMI Command ${get_sdr_raw_cmd} 0xc5
217
218 # Verify get SDR partially with new reservation ID after reboot.
219 ${reservation_id_after_reboot}= Get Reservation ID add_prefix=True
220 ${get_sdr_raw_cmd}= Catenate
nagarjunb228ea859e2022-07-12 21:39:51 +0530221 ... ${IPMI_RAW_CMD['Get SDR']['Get'][1]} ${reservation_id_after_reboot} 0x${record_id} 0x00
222 ... ${IPMI_RAW_CMD['Get SDR']['Get'][2]}
ishwaryamathim372cd862023-11-14 18:12:23 +0000223 Run IPMI Command ${get_sdr_raw_cmd}
nagarjunb2287138e62022-04-19 16:49:16 +0530224
Rahul Maheshwaricd7b19c2018-04-10 07:35:56 -0500225
Rahul Maheshwari77ab1602018-02-28 07:21:55 -0600226*** Keywords ***
227
nagarjunb2287138e62022-04-19 16:49:16 +0530228Get Reservation ID
229 [Documentation] Get reservation ID using reserve SDR repository.
230 [Arguments] ${add_prefix}=False ${convert_lsb_to_msb}=False
231
232 # Description of argument(s):
233 # add_prefix If True will prefix "0x" to the reservation ID.
234 # e.g. IPMI response for Reservation ID command will be like 01 00
235 # return reservation ID will be "0x01" for above response.
236
237 # convert_lsb_to_msb If True will convert the reservation ID from LSB first to MSB first.
238 # e.g. IPMI response for reservation ID command will be like 01 0a
239 # return reservation ID will be "a1" for above response.
240
ishwaryamathim372cd862023-11-14 18:12:23 +0000241 ${reservation_id}= Run IPMI Command
nagarjunb2287138e62022-04-19 16:49:16 +0530242 ... ${IPMI_RAW_CMD['SDR']['Reserve SDR Repository'][0]}
243
244 ${reservation_id}= Run Keyword If ${add_prefix}
245 ... Add Prefix To String ${reservation_id} 0x
246 ... ELSE IF ${convert_lsb_to_msb}
247 ... Convert LSB To MSB ${reservation_id}
248 ... ELSE
249 ... Return From Keyword ${reservation_id}
250
George Keishing409df052024-01-17 22:36:14 +0530251 RETURN ${reservation_id}
nagarjunb2287138e62022-04-19 16:49:16 +0530252
253
Rahul Maheshwaribad5e822019-07-30 12:36:27 -0500254Get Sensor Count
255 [Documentation] Get sensors count using "sdr elist all" command.
256 # Example of "sdr elist all" command output:
257 # BootProgress | 03h | ok | 34.2 |
258 # OperatingSystemS | 05h | ok | 35.1 |
259 # AttemptsLeft | 07h | ok | 34.1 |
260 # occ0 | 08h | ok | 210.1 | Device Disabled
261 # occ1 | 09h | ok | 210.2 | Device Disabled
262 # p0_core0_temp | 11h | ns | 3.1 | Disabled
263 # cpu0_core0 | 12h | ok | 208.1 | Presence detected
264 # p0_core1_temp | 14h | ns | 3.2 | Disabled
265 # cpu0_core1 | 15h | ok | 208.2 | Presence detected
266 # p0_core2_temp | 17h | ns | 3.3 | Disabled
267 # ..
268 # ..
269 # ..
270 # ..
271 # ..
272 # ..
273 # fan3 | 00h | ns | 29.4 | Logical FRU @35h
274 # bmc | 00h | ns | 6.1 | Logical FRU @3Ch
275 # ethernet | 00h | ns | 1.1 | Logical FRU @46h
276
277 ${output}= Run IPMI Standard Command sdr elist all
278 ${sensor_list}= Split String ${output} \n
279 ${sensor_count}= Get Length ${sensor_list}
George Keishing409df052024-01-17 22:36:14 +0530280 RETURN ${sensor_count}
Rahul Maheshwaribad5e822019-07-30 12:36:27 -0500281
282
Rahul Maheshwari77ab1602018-02-28 07:21:55 -0600283Get Component URIs
284 [Documentation] Get URIs for given component from given URIs
285 ... and return as a list.
286 [Arguments] ${component_name} ${uri_list}=${SYSTEM_URI}
287
288 # A sample result returned for the "core" component:
289 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core0
290 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core1
291 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core10
292 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core11
293 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core12
294 # (etc.)
295
296 # Description of argument(s):
297 # component_name Component name (e.g. "core", "dimm", etc.).
298 # uri_list URI list.
299
300 ${component_uris}= Get Matches ${uri_list}
Jayashree-D5ddaf9b2020-07-15 13:50:02 +0530301 ... regexp=^.*[0-9a-z_].${component_name}\[_0-9a-z]*$
302 ... case_insensitive=${True}
George Keishing409df052024-01-17 22:36:14 +0530303 RETURN ${component_uris}
Rahul Maheshwari77ab1602018-02-28 07:21:55 -0600304
305
306Get SDR Presence Via IPMI
307 [Documentation] Return presence info from IPMI sensor data record.
308 [Arguments] ${component_name}
309
310 # Description of argument(s):
311 # component_name Component name (e.g. "cpu0_core0", "dimm0", etc.).
312
313 # Example of IPMI SDR elist output.
314 # BootProgress | 03h | ok | 34.2 |
315 # OperatingSystemS | 05h | ok | 35.1 | boot completed - device not specified
316 # AttemptsLeft | 07h | ok | 34.1 |
317 # occ0 | 08h | ok | 210.1 | Device Disabled
318 # occ1 | 09h | ok | 210.2 | Device Disabled
319 # cpu0_core0 | 12h | ok | 208.1 | Presence detected
320 # cpu0_core1 | 15h | ok | 208.2 | Disabled
321 # cpu0_core2 | 18h | ok | 208.3 | Presence detected
322 # dimm0 | A6h | ok | 32.1 | Presence Detected
323 # dimm1 | A8h | ok | 32.2 | Presence Detected
324 # dimm2 | AAh | ok | 32.9 | Presence Detected
325 # gv100card0 | C5h | ok | 216.1 | 0 unspecified
326 # gv100card1 | C8h | ok | 216.2 | 0 unspecified
327 # TPMEnable | D7h | ok | 3.3 | State Asserted
328 # auto_reboot | DAh | ok | 33.2 | State Asserted
329 # volatile | DBh | ok | 33.1 | State Deasserted
330
331 ${sdr_elist_output}= Run IPMI Standard Command sdr elist
332 ${sdr_component_line}=
333 ... Get Lines Containing String ${sdr_elist_output} ${component_name}
334 ... case-insensitive
335
336 ${presence_ipmi}= Fetch From Right ${sdr_component_line} |
337 ${presence_ipmi}= Strip String ${presence_ipmi}
George Keishing409df052024-01-17 22:36:14 +0530338 RETURN ${presence_ipmi}
Rahul Maheshwari77ab1602018-02-28 07:21:55 -0600339
340
341Verify SDR
342 [Documentation] Verify IPMI sensor data record for given component
George Keishingd6bc1c12019-03-08 12:59:29 -0600343 ... with Redfish.
Rahul Maheshwari77ab1602018-02-28 07:21:55 -0600344 [Arguments] ${component_name}
345
346 # Description of argument(s):
347 # component_name Component name (e.g. "cpu0/core0", "dimm0", etc.).
348
349 ${presence_rest}= Read Attribute
350 ... ${HOST_INVENTORY_URI}system/chassis/motherboard/${component_name}
351 ... Present
352 ${functional_rest}= Read Attribute
353 ... ${HOST_INVENTORY_URI}system/chassis/motherboard/${component_name}
354 ... Functional
355
356 # Replace "/" with "_" if there is any "/" in component name.
357 # e.g. cpu0/core0 to cpu0_core0
358 ${component_name}= Replace String ${component_name} / _
359 ${presence_ipmi}= Get SDR Presence Via IPMI ${component_name}${SPACE}
360
George Keishing1f8baa22025-05-15 23:50:56 +0530361 IF '${presence_ipmi}' == 'Disabled' or '${presence_ipmi}' == ''
362 Should Be True ${presence_rest} == ${0} and ${functional_rest} == ${0}
363 ELSE IF '${presence_ipmi}' == 'Presence Detected' or '${presence_ipmi}' == 'Presence detected'
364 Should Be True ${presence_rest} == ${1} and ${functional_rest} == ${1}
365 ELSE IF '${presence_ipmi}' == 'State Asserted'
366 Should Be True ${presence_rest} == ${1} and ${functional_rest} == ${1}
367 ELSE IF '${presence_ipmi}' == 'State Deasserted'
368 Should Be True ${presence_rest} == ${1} and ${functional_rest} == ${0}
369 ELSE
370 Fail msg=Invalid Presence${presence_ipmi}
371 END
Rahul Maheshwari77ab1602018-02-28 07:21:55 -0600372
373
374Test SDR Info
375 [Documentation] Test SDR info for given component.
376 [Arguments] ${component_name}
377
378 # Description of argument(s):
379 # component_name Component name (e.g. "core", "dimm", etc.).
380
381 ${component_uri_list}= Get Component URIs ${component_name}
Sushil Singhab209cd2020-07-01 09:01:14 -0500382
383 FOR ${uri} IN @{component_uri_list}
384 ${component_name}= Fetch From Right ${uri} motherboard/
385 Log To Console ${component_name}
386 Verify SDR ${component_name}
387 END
Rahul Maheshwari77ab1602018-02-28 07:21:55 -0600388
nagarjunb2287138e62022-04-19 16:49:16 +0530389Fetch IPMI Command Support Status
390 [Documentation] Return yes if IPMI command is supported.
391 [Arguments] ${ipmi_cmd}
392
393 # Description of argument(s):
394 # ipmi_cmd IPMI command.
395
ishwaryamathim372cd862023-11-14 18:12:23 +0000396 ${resp}= Run IPMI Command ${ipmi_cmd} fail_on_err=0
nagarjunb2287138e62022-04-19 16:49:16 +0530397 ${resp_code_match}= Get Regexp Matches ${resp} rsp=0xc1
398
399 ${cmd_support}= Set Variable If ${resp_code_match} != [] no yes
400
George Keishing409df052024-01-17 22:36:14 +0530401 RETURN ${cmd_support}
nagarjunb2287138e62022-04-19 16:49:16 +0530402
Rahul Maheshwari77ab1602018-02-28 07:21:55 -0600403
nagarjunb228ea859e2022-07-12 21:39:51 +0530404Get SDR Record ID
405 [Documentation] Fetch one record ID from SDR elist IPMI cmd response.
406
ishwaryamathim372cd862023-11-14 18:12:23 +0000407 ${resp}= Run IPMI Standard Command sdr elist
nagarjunb228ea859e2022-07-12 21:39:51 +0530408 ${record_id}= Get Regexp Matches ${resp} \\|\\s+([0-9]+)h\\s+\\| 1
409
George Keishing409df052024-01-17 22:36:14 +0530410 RETURN ${record_id[0]}
nagarjunb228ea859e2022-07-12 21:39:51 +0530411
412
Rahul Maheshwari77ab1602018-02-28 07:21:55 -0600413Suite Setup Execution
414 [Documentation] Do the initial suite setup.
415
George Keishing2d0edad2021-08-18 11:44:10 -0500416 Redfish.Login
Rahul Maheshwarib6ebe4c2019-07-17 02:02:17 -0500417 Redfish Power On stack_mode=skip quiet=1
Rahul Maheshwari77ab1602018-02-28 07:21:55 -0600418
nagarjunb228ea859e2022-07-12 21:39:51 +0530419 ${record_id}= Get SDR Record ID
420 Set Suite Variable ${record_id}
421
Nagarjun B1168d692023-02-16 16:29:57 +0530422 # If REST is supported, then the uri_list will be returned.
423 ${resp}= OpenBMC Get Request ${OPENBMC_BASE_URI}
424 IF '${resp.status_code}' == '${HTTP_OK}'
425 ${uri_list}= Read Properties ${OPENBMC_BASE_URI}list
426 Set Suite Variable ${SYSTEM_URI} ${uri_list}
427 Log ${uri_list}
428 END
Rahul Maheshwari77ab1602018-02-28 07:21:55 -0600429
430
431Test Teardown Execution
432 [Documentation] Do the post test teardown.
433
434 FFDC On Test Case Fail