blob: 1ff303003bebd6981e481a05c60b92abdc2c4fe9 [file] [log] [blame]
Sridevi Ramesh484e10c2019-02-28 06:14:46 -06001*** Settings ***
2Documentation This suite test various boot types with boot source.
3Resource ../../lib/resource.robot
4Resource ../../lib/bmc_redfish_resource.robot
5Resource ../../lib/common_utils.robot
6Resource ../../lib/openbmc_ffdc.robot
Anusha Dathatri02a0bb32019-04-05 00:50:38 -05007Resource ../../lib/ipmi_client.robot
Sridevi Ramesh484e10c2019-02-28 06:14:46 -06008
George Keishingac3b0952019-03-11 06:02:28 -05009Test Setup Test Setup Execution
10Test Teardown Test Teardown Execution
Sridevi Ramesh484e10c2019-02-28 06:14:46 -060011Suite Teardown Suite Teardown Execution
12
Matt Fischer6fb70d92023-10-24 19:06:33 -060013Test Tags Boot_Devices
George Keishingf699f552023-09-14 19:05:01 +053014
Anusha Dathatri02a0bb32019-04-05 00:50:38 -050015*** Variables ***
16# Maps for correlating redfish data values to IPMI data values.
17# The redfish values are obtained with Redfish.Get or Redfish.Get Properties.
18# The corresponding IPMI values are obtained with the "chassis bootparam get
19# 5" IPMI command.
20
21# This dictionary maps the redfish 'BootSourceOverrideEnabled' value to the
22# corresponding IPMI output value.
23&{redfish_ipmi_enabled_map} Once=Options apply to only next boot
24... Continuous=Options apply to all future boots
Konstantin Aladyshev61d22502021-06-18 15:47:53 +030025... Disabled=Boot Flag Invalid
Anusha Dathatri02a0bb32019-04-05 00:50:38 -050026
27# This dictionary maps the redfish 'BootSourceOverrideTarget' value to the
28# corresponding IPMI output value.
29&{redfish_ipmi_target_map} Hdd=Force Boot from default Hard-Drive
30... Pxe=Force PXE
31... Diags=Force Boot from default Hard-Drive, request Safe-Mode
32... Cd=Force Boot from CD/DVD
33... BiosSetup=Force Boot into BIOS Setup
34... None=No override
35
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +030036# This dictionary maps the redfish 'BootSourceOverrideMode' value to the
37# corresponding IPMI output value.
38&{redfish_ipmi_mode_map} Legacy=BIOS PC Compatible (legacy) boot
39... UEFI=BIOS EFI boot
40
manimozhikb5138fd2023-11-14 05:16:30 +000041${loop_count} 2
42
Sridevi Ramesh484e10c2019-02-28 06:14:46 -060043*** Test Cases ***
44
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +030045Verify BMC Redfish Boot Source Override with Enabled Mode As Once
46 [Documentation] Verify BMC Redfish Boot Source Override with Enabled Mode As Once.
47 [Tags] Verify_BMC_Redfish_Boot_Source_Override_with_Enabled_Mode_As_Once
48 [Template] Set And Verify Boot Source Override
Sridevi Ramesh484e10c2019-02-28 06:14:46 -060049
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +030050 #BootSourceOverrideEnabled BootSourceOverrideTarget BootSourceOverrideMode
51 Once Hdd UEFI
52 Once Pxe UEFI
53 Once Diags UEFI
54 Once Cd UEFI
55 Once BiosSetup UEFI
Konstantin Aladyshev61d22502021-06-18 15:47:53 +030056 Once None UEFI
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +030057 Once Hdd Legacy
58 Once Pxe Legacy
59 Once Diags Legacy
60 Once Cd Legacy
61 Once BiosSetup Legacy
Konstantin Aladyshev61d22502021-06-18 15:47:53 +030062 Once None Legacy
Sridevi Ramesh484e10c2019-02-28 06:14:46 -060063
Sridevi Ramesh484e10c2019-02-28 06:14:46 -060064
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +030065Verify BMC Redfish Boot Source Override with Enabled Mode As Continuous
66 [Documentation] Verify BMC Redfish Boot Source Override with Enabled Mode As Continuous.
67 [Tags] Verify_BMC_Redfish_Boot_Source_Override_with_Enabled_Mode_As_Continuous
68 [Template] Set And Verify Boot Source Override
69
70 #BootSourceOverrideEnabled BootSourceOverrideTarget BootSourceOverrideMode
71 Continuous Hdd UEFI
72 Continuous Pxe UEFI
73 Continuous Diags UEFI
74 Continuous Cd UEFI
75 Continuous BiosSetup UEFI
Konstantin Aladyshev61d22502021-06-18 15:47:53 +030076 Continuous None UEFI
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +030077 Continuous Hdd Legacy
78 Continuous Pxe Legacy
79 Continuous Diags Legacy
80 Continuous Cd Legacy
81 Continuous BiosSetup Legacy
Konstantin Aladyshev61d22502021-06-18 15:47:53 +030082 Continuous None Legacy
83
84
85Verify BMC Redfish Boot Source Override with Enabled Mode As Disabled
86 [Documentation] Verify BMC Redfish Boot Source Override with Enabled Mode As Disabled.
87 [Tags] Verify_BMC_Redfish_Boot_Source_Override_with_Enabled_Mode_As_Disabled
88 [Template] Set And Verify Boot Source Override
89
90 #BootSourceOverrideEnabled BootSourceOverrideTarget BootSourceOverrideMode
91 Disabled Hdd UEFI
92 Disabled Pxe UEFI
93 Disabled Diags UEFI
94 Disabled Cd UEFI
95 Disabled BiosSetup UEFI
96 Disabled None UEFI
97 Disabled Hdd Legacy
98 Disabled Pxe Legacy
99 Disabled Diags Legacy
100 Disabled Cd Legacy
101 Disabled BiosSetup Legacy
102 Disabled None Legacy
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +0300103
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600104
George Keishingee0103d2024-01-30 12:35:37 +0530105Verify Boot Source Override Policy Persistency With Enabled Mode As Once After BMC Reboot
manimozhikb5138fd2023-11-14 05:16:30 +0000106 [Documentation] Verify Boot Source Override Policy Persistency with Enabled Mode As Once After BMC Reboot.
107 [Tags] Verify_Boot_Source_Override_Policy_Persistency_With_Enabled_Mode_As_Once_After_BMC_Reboot
108 [Template] Verify Boot Source Override After BMC Reboot
109
110 #BootSourceOverrideEnabled BootSourceOverrideTarget BootSourceOverrideMode
111 Once Hdd UEFI
112 Once Pxe UEFI
113 Once Diags UEFI
114 Once Cd UEFI
115 Once BiosSetup UEFI
116 Once None UEFI
117 Once Hdd Legacy
118 Once Pxe Legacy
119 Once Diags Legacy
120 Once Cd Legacy
121 Once BiosSetup Legacy
122 Once None Legacy
123
124
George Keishingee0103d2024-01-30 12:35:37 +0530125Verify Boot Source Override Policy Persistency With Enabled Mode As Continuous After BMC Reboot
manimozhikb5138fd2023-11-14 05:16:30 +0000126 [Documentation] Verify Boot Source Override Policy Persistency with Enabled Mode As Continuous After BMC Reboot.
127 [Tags] Verify_Boot_Source_Override_Policy_Persistency_With_Enabled_Mode_As_Continuous_After_BMC_Reboot
128 [Template] Verify Boot Source Override After BMC Reboot
129
130 #BootSourceOverrideEnabled BootSourceOverrideTarget BootSourceOverrideMode
131 Continuous Hdd UEFI
132 Continuous Pxe UEFI
133 Continuous Diags UEFI
134 Continuous Cd UEFI
135 Continuous BiosSetup UEFI
136 Continuous None UEFI
137 Continuous Hdd Legacy
138 Continuous Pxe Legacy
139 Continuous Diags Legacy
140 Continuous Cd Legacy
141 Continuous BiosSetup Legacy
142 Continuous None Legacy
143
144
George Keishingee0103d2024-01-30 12:35:37 +0530145Verify Boot Source Override Policy With Enabled Mode As Once After Host Reboot
manimozhikb5138fd2023-11-14 05:16:30 +0000146 [Documentation] Verify Boot Source Override Policy with Enabled Mode As Once After Host Reboot.
147 [Tags] Verify_Boot_Source_Override_Policy_With_Enabled_Mode_As_Once_After_Host_Reboot
148 [Template] Verify Boot Source Override with Enabled Mode As Once After Host Reboot
149
150 #BootSourceOverrideTarget BootSourceOverrideMode
151 Hdd UEFI
152 Pxe UEFI
153 Diags UEFI
154 Cd UEFI
155 None UEFI
156 Hdd Legacy
157 Pxe Legacy
158 Diags Legacy
159 Cd Legacy
160 None Legacy
161
162
George Keishingee0103d2024-01-30 12:35:37 +0530163Verify Boot Source Override Policy With Enabled Mode As Continuous After Host Reboot
manimozhikb5138fd2023-11-14 05:16:30 +0000164 [Documentation] Verify Boot Source Override Policy With Enabled Mode As Continuous After Host Reboot.
165 [Tags] Verify_Boot_Source_Override_Policy_With_Enabled_Mode_As_Continuous_After_Host_Reboot
166 [Template] Verify Boot Source Override with Enabled Mode As Continuous After Host Reboot
167
168 #BootSourceOverrideTarget BootSourceOverrideMode
169 Hdd UEFI
170 Pxe UEFI
171 Diags UEFI
172 Cd UEFI
173 None UEFI
174 Hdd Legacy
175 Pxe Legacy
176 Diags Legacy
177 Cd Legacy
178 None Legacy
179
180
George Keishingee0103d2024-01-30 12:35:37 +0530181Verify Boot Source Override With Enabled Mode As Once After Host Reboot For Bios Setup
manimozhikb5138fd2023-11-14 05:16:30 +0000182 [Documentation] Verify Boot Source Override with Enabled Mode As Once After Host Reboot For Bios Setup.
183 [Tags] Verify_Boot_Source_Override_With_Enabled_Mode_As_Once_After_Host_Reboot_For_Bios_Setup
184 [Template] Verify Boot Source Override with Enabled Mode As Once After Host Reboot
185
186 #BootSourceOverrideTarget BootSourceOverrideMode Biosflag
187 BiosSetup UEFI True
188 BiosSetup Legacy True
189
190
George Keishingee0103d2024-01-30 12:35:37 +0530191Verify Boot Source Override With Enabled Mode As Continuous After Host Reboot For Bios Setup
manimozhikb5138fd2023-11-14 05:16:30 +0000192 [Documentation] Verify Boot Source Override with Enabled Mode As Continuous After Host Reboot For Bios Setup.
193 [Tags] Verify_Boot_Source_Override_With_Enabled_Mode_As_Continuous_After_Host_Reboot_For_Bios_Setup
194 [Template] Verify Boot Source Override with Enabled Mode As Continuous After Host Reboot
195
196 #BootSourceOverrideTarget BootSourceOverrideMode Biosflag
197 BiosSetup UEFI True
198 BiosSetup Legacy True
199
200
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600201*** Keywords ***
202
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +0300203Set And Verify Boot Source Override
manimozhikb5138fd2023-11-14 05:16:30 +0000204 [Documentation] Set and Verify Boot source override.
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +0300205 [Arguments] ${override_enabled} ${override_target} ${override_mode}=UEFI
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600206
207 # Description of argument(s):
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +0300208 # override_enabled Boot source override enable type.
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600209 # ('Once', 'Continuous', 'Disabled').
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +0300210 # override_target Boot source override target.
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600211 # ('Pxe', 'Cd', 'Hdd', 'Diags', 'BiosSetup', 'None').
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +0300212 # override_mode Boot source override mode (relevant only for x86 arch).
213 # ('Legacy', 'UEFI').
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600214
215 # Example:
216 # "Boot": {
217 # "BootSourceOverrideEnabled": "Disabled",
218 # "BootSourceOverrideMode": "Legacy",
219 # "BootSourceOverrideTarget": "None",
220 # "BootSourceOverrideTarget@Redfish.AllowableValues": [
221 # "None",
222 # "Pxe",
223 # "Hdd",
224 # "Cd",
225 # "Diags",
226 # "BiosSetup"]}
227
Anusha Dathatri02a0bb32019-04-05 00:50:38 -0500228 # The values set using Redfish are verified via IPMI using the command:
229 # chassis bootparam get 5
230 # Option 5 returns the boot parameters.
231 #
232 # Sample output:
233 # Boot parameter version: 1
234 # Boot parameter 5 is valid/unlocked
235 # Boot parameter data: c000000000
236 # Boot Flags :
237 # - Boot Flag Valid
238 # - Options apply to all future boots
239 # - BIOS PC Compatible (legacy) boot
240 # - Boot Device Selector : No override
241 # - Console Redirection control : System Default
242 # - BIOS verbosity : Console redirection occurs per BIOS configuration
243 # setting (default)
244 # - BIOS Mux Control Override : BIOS uses recommended setting of the mux at
245 # the end of POST
246
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +0300247 Redfish Set Boot Default ${override_enabled} ${override_target} ${override_mode}
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600248
Anusha Dathatri02a0bb32019-04-05 00:50:38 -0500249 ${output}= Run IPMI Standard Command chassis bootparam get 5
250 Should Contain ${output} ${redfish_ipmi_enabled_map['${override_enabled}']}
251 Should Contain ${output} ${redfish_ipmi_target_map['${override_target}']}
Sridevi Ramesh162c52a2025-05-13 23:47:09 -0500252 IF '${PLATFORM_ARCH_TYPE}' == 'x86'
253 Should Contain ${output} ${redfish_ipmi_mode_map['${override_mode}']}
254 END
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600255
manimozhikb5138fd2023-11-14 05:16:30 +0000256Verify Boot Source Override After BMC Reboot
257 [Documentation] Verify Boot Source Override After BMC Reboot.
258 [Arguments] ${override_enabled} ${override_target} ${override_mode}=UEFI
259
260 # Description of argument(s):
261 # override_enabled Boot source override enable type.
262 # ('Once', 'Continuous', 'Disabled').
263 # override_target Boot source override target.
264 # ('Pxe', 'Cd', 'Hdd', 'Diags', 'BiosSetup', 'None').
265 # override_mode Boot source override mode (relevant only for x86 arch).
266 # ('Legacy', 'UEFI').
267
268 # Example:
269 # "Boot": {
270 # "BootSourceOverrideEnabled": "Disabled",
271 # "BootSourceOverrideMode": "Legacy",
272 # "BootSourceOverrideTarget": "None",
273 # "BootSourceOverrideTarget@Redfish.AllowableValues": [
274 # "None",
275 # "Pxe",
276 # "Hdd",
277 # "Cd",
278 # "Diags",
279 # "BiosSetup"]}
280
281 # The values set using Redfish are verified via IPMI using the command:
282 # chassis bootparam get 5
283 # Option 5 returns the boot parameters.
284 #
285 # Sample output:
286 # Boot parameter version: 1
287 # Boot parameter 5 is valid/unlocked
288 # Boot parameter data: c000000000
289 # Boot Flags :
290 # - Boot Flag Valid
291 # - Options apply to all future boots
292 # - BIOS PC Compatible (legacy) boot
293 # - Boot Device Selector : No override
294 # - Console Redirection control : System Default
295 # - BIOS verbosity : Console redirection occurs per BIOS configuration
296 # setting (default)
297 # - BIOS Mux Control Override : BIOS uses recommended setting of the mux at
298 # the end of POST
299
300 Redfish Set Boot Default ${override_enabled} ${override_target} ${override_mode}
301
302 Redfish OBMC Reboot (run)
303
304 ${output}= Run IPMI Standard Command chassis bootparam get 5
305 Should Contain ${output} ${redfish_ipmi_enabled_map['${override_enabled}']}
306 Should Contain ${output} ${redfish_ipmi_target_map['${override_target}']}
Sridevi Ramesh162c52a2025-05-13 23:47:09 -0500307 IF '${PLATFORM_ARCH_TYPE}' == 'x86'
308 Should Contain ${output} ${redfish_ipmi_mode_map['${override_mode}']}
309 END
manimozhikb5138fd2023-11-14 05:16:30 +0000310
311
312Verify Boot Source Override with Enabled Mode As Once After Host Reboot
313 [Documentation] Verify Boot Source Override with Enabled Mode As Once After Host Reboot.
314 [Arguments] ${override_target} ${override_mode}=UEFI ${is_bios_setup}=False
315
316 # Description of argument(s):
317 # override_enabled Boot source override enable type.
318 # ('Once', 'Continuous', 'Disabled').
319 # override_target Boot source override target.
320 # ('Pxe', 'Cd', 'Hdd', 'Diags', 'BiosSetup', 'None').
321 # override_mode Boot source override mode (relevant only for x86 arch).
322 # ('Legacy', 'UEFI').
323
324 # Example:
325 # "Boot": {
326 # "BootSourceOverrideEnabled": "Disabled",
327 # "BootSourceOverrideMode": "Legacy",
328 # "BootSourceOverrideTarget": "None",
329 # "BootSourceOverrideTarget@Redfish.AllowableValues": [
330 # "None",
331 # "Pxe",
332 # "Hdd",
333 # "Cd",
334 # "Diags",
335 # "BiosSetup"]}
336
337 # The values set using Redfish are verified via IPMI using the command:
338 # chassis bootparam get 5
339 # Option 5 returns the boot parameters.
340 #
341 # Sample output:
342 # Boot parameter version: 1
343 # Boot parameter 5 is valid/unlocked
344 # Boot parameter data: c000000000
345 # Boot Flags :
346 # - Boot Flag Valid
347 # - Options apply to all future boots
348 # - BIOS PC Compatible (legacy) boot
349 # - Boot Device Selector : No override
350 # - Console Redirection control : System Default
351 # - BIOS verbosity : Console redirection occurs per BIOS configuration
352 # setting (default)
353 # - BIOS Mux Control Override : BIOS uses recommended setting of the mux at
354 # the end of POST
355
356 Redfish Set Boot Default Once ${override_target} ${override_mode}
357
358 IF '${is_bios_setup}' == 'True'
359 Repeat Keyword ${loop_count} times Host Reboot For Bios Setup
360 ELSE
361 RF SYS GracefulRestart
362 ${output}= Run IPMI Standard Command chassis bootparam get 5
363 Should Contain ${output} ${redfish_ipmi_enabled_map['Once']}
364 Should Contain ${output} ${redfish_ipmi_target_map['None']}
365 IF '${PLATFORM_ARCH_TYPE}' == 'x86'
366 Should Contain ${output} ${redfish_ipmi_mode_map['Legacy']}
367 END
368 END
369
370 ${resp}= Redfish.Get Attribute /redfish/v1/Systems/system Boot
371 Should Be Equal As Strings ${resp["BootSourceOverrideEnabled"]} Disabled
372 Should Be Equal As Strings ${resp["BootSourceOverrideTarget"]} None
Sridevi Ramesh162c52a2025-05-13 23:47:09 -0500373 IF '${PLATFORM_ARCH_TYPE}' == 'x86'
374 Should Be Equal As Strings ${resp["BootSourceOverrideMode"]} Legacy
375 END
manimozhikb5138fd2023-11-14 05:16:30 +0000376
377Verify Boot Source Override with Enabled Mode As Continuous After Host Reboot
378 [Documentation] Verify Boot Source Override with Enabled Mode As Continuous After Host Reboot.
379 [Arguments] ${override_target} ${override_mode}=UEFI ${is_bios_setup}=False
380
381 # Description of argument(s):
382 # override_enabled Boot source override enable type.
383 # ('Once', 'Continuous', 'Disabled').
384 # override_target Boot source override target.
385 # ('Pxe', 'Cd', 'Hdd', 'Diags', 'BiosSetup', 'None').
386 # override_mode Boot source override mode (relevant only for x86 arch).
387 # ('Legacy', 'UEFI').
388
389 # Example:
390 # "Boot": {
391 # "BootSourceOverrideEnabled": "Disabled",
392 # "BootSourceOverrideMode": "Legacy",
393 # "BootSourceOverrideTarget": "None",
394 # "BootSourceOverrideTarget@Redfish.AllowableValues": [
395 # "None",
396 # "Pxe",
397 # "Hdd",
398 # "Cd",
399 # "Diags",
400 # "BiosSetup"]}
401
402 # The values set using Redfish are verified via IPMI using the command:
403 # chassis bootparam get 5
404 # Option 5 returns the boot parameters.
405 #
406 # Sample output:
407 # Boot parameter version: 1
408 # Boot parameter 5 is valid/unlocked
409 # Boot parameter data: c000000000
410 # Boot Flags :
411 # - Boot Flag Valid
412 # - Options apply to all future boots
413 # - BIOS PC Compatible (legacy) boot
414 # - Boot Device Selector : No override
415 # - Console Redirection control : System Default
416 # - BIOS verbosity : Console redirection occurs per BIOS configuration
417 # setting (default)
418 # - BIOS Mux Control Override : BIOS uses recommended setting of the mux at
419 # the end of POST
420
421 Redfish Set Boot Default Continuous ${override_target} ${override_mode}
422
423 IF '${is_bios_setup}' == 'True'
424 Repeat Keyword ${loop_count} times Host Reboot For Bios Setup
425 ELSE
426 RF SYS GracefulRestart
427 ${output}= Run IPMI Standard Command chassis bootparam get 5
428 Should Contain ${output} ${redfish_ipmi_enabled_map['Continuous']}
429 Should Contain ${output} ${redfish_ipmi_target_map['${override_target}']}
430 IF '${PLATFORM_ARCH_TYPE}' == 'x86'
431 Should Contain ${output} ${redfish_ipmi_mode_map['${override_mode}']}
432 END
433 END
434
435 ${resp}= Redfish.Get Attribute /redfish/v1/Systems/system Boot
436 Should Be Equal As Strings ${resp["BootSourceOverrideEnabled"]} Continuous
437 Should Be Equal As Strings ${resp["BootSourceOverrideTarget"]} ${override_target}
manimozhikb5138fd2023-11-14 05:16:30 +0000438
Sridevi Ramesh162c52a2025-05-13 23:47:09 -0500439 IF '${PLATFORM_ARCH_TYPE}' == 'x86'
440 Should Be Equal As Strings ${resp["BootSourceOverrideMode"]} ${override_mode}
441 END
manimozhikb5138fd2023-11-14 05:16:30 +0000442
443Host Reboot For Bios Setup
444 [Documentation] Rebooting Host without checking Host state.
445
446 Redfish Power Operation GracefulRestart
447
448 Sleep 1min
449
450
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600451Suite Teardown Execution
452 [Documentation] Do the post suite teardown.
453
George Keishing01644e62019-03-26 04:10:17 -0500454 Redfish.Login
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +0300455 Set And Verify Boot Source Override Disabled None UEFI
George Keishing01644e62019-03-26 04:10:17 -0500456 Redfish.Logout
George Keishingac3b0952019-03-11 06:02:28 -0500457
458
459Test Setup Execution
460 [Documentation] Do test case setup tasks.
461
462 Redfish.Login
463
464
465Test Teardown Execution
466 [Documentation] Do the post test teardown.
467
468 FFDC On Test Case Fail
469 Redfish.Logout