blob: e567027d696d28a14b9216af8fc270173fa6f1e5 [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
George Keishingf699f552023-09-14 19:05:01 +053013Force Tags Boot_Devices
14
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}']}
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +0300252 Run Keyword If '${PLATFORM_ARCH_TYPE}' == 'x86'
253 ... Should Contain ${output} ${redfish_ipmi_mode_map['${override_mode}']}
254
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}']}
307 Run Keyword If '${PLATFORM_ARCH_TYPE}' == 'x86'
308 ... Should Contain ${output} ${redfish_ipmi_mode_map['${override_mode}']}
309
310
311Verify Boot Source Override with Enabled Mode As Once After Host Reboot
312 [Documentation] Verify Boot Source Override with Enabled Mode As Once After Host Reboot.
313 [Arguments] ${override_target} ${override_mode}=UEFI ${is_bios_setup}=False
314
315 # Description of argument(s):
316 # override_enabled Boot source override enable type.
317 # ('Once', 'Continuous', 'Disabled').
318 # override_target Boot source override target.
319 # ('Pxe', 'Cd', 'Hdd', 'Diags', 'BiosSetup', 'None').
320 # override_mode Boot source override mode (relevant only for x86 arch).
321 # ('Legacy', 'UEFI').
322
323 # Example:
324 # "Boot": {
325 # "BootSourceOverrideEnabled": "Disabled",
326 # "BootSourceOverrideMode": "Legacy",
327 # "BootSourceOverrideTarget": "None",
328 # "BootSourceOverrideTarget@Redfish.AllowableValues": [
329 # "None",
330 # "Pxe",
331 # "Hdd",
332 # "Cd",
333 # "Diags",
334 # "BiosSetup"]}
335
336 # The values set using Redfish are verified via IPMI using the command:
337 # chassis bootparam get 5
338 # Option 5 returns the boot parameters.
339 #
340 # Sample output:
341 # Boot parameter version: 1
342 # Boot parameter 5 is valid/unlocked
343 # Boot parameter data: c000000000
344 # Boot Flags :
345 # - Boot Flag Valid
346 # - Options apply to all future boots
347 # - BIOS PC Compatible (legacy) boot
348 # - Boot Device Selector : No override
349 # - Console Redirection control : System Default
350 # - BIOS verbosity : Console redirection occurs per BIOS configuration
351 # setting (default)
352 # - BIOS Mux Control Override : BIOS uses recommended setting of the mux at
353 # the end of POST
354
355 Redfish Set Boot Default Once ${override_target} ${override_mode}
356
357 IF '${is_bios_setup}' == 'True'
358 Repeat Keyword ${loop_count} times Host Reboot For Bios Setup
359 ELSE
360 RF SYS GracefulRestart
361 ${output}= Run IPMI Standard Command chassis bootparam get 5
362 Should Contain ${output} ${redfish_ipmi_enabled_map['Once']}
363 Should Contain ${output} ${redfish_ipmi_target_map['None']}
364 IF '${PLATFORM_ARCH_TYPE}' == 'x86'
365 Should Contain ${output} ${redfish_ipmi_mode_map['Legacy']}
366 END
367 END
368
369 ${resp}= Redfish.Get Attribute /redfish/v1/Systems/system Boot
370 Should Be Equal As Strings ${resp["BootSourceOverrideEnabled"]} Disabled
371 Should Be Equal As Strings ${resp["BootSourceOverrideTarget"]} None
372 Run Keyword If '${PLATFORM_ARCH_TYPE}' == 'x86'
373 ... Should Be Equal As Strings ${resp["BootSourceOverrideMode"]} Legacy
374
375
376Verify Boot Source Override with Enabled Mode As Continuous After Host Reboot
377 [Documentation] Verify Boot Source Override with Enabled Mode As Continuous After Host Reboot.
378 [Arguments] ${override_target} ${override_mode}=UEFI ${is_bios_setup}=False
379
380 # Description of argument(s):
381 # override_enabled Boot source override enable type.
382 # ('Once', 'Continuous', 'Disabled').
383 # override_target Boot source override target.
384 # ('Pxe', 'Cd', 'Hdd', 'Diags', 'BiosSetup', 'None').
385 # override_mode Boot source override mode (relevant only for x86 arch).
386 # ('Legacy', 'UEFI').
387
388 # Example:
389 # "Boot": {
390 # "BootSourceOverrideEnabled": "Disabled",
391 # "BootSourceOverrideMode": "Legacy",
392 # "BootSourceOverrideTarget": "None",
393 # "BootSourceOverrideTarget@Redfish.AllowableValues": [
394 # "None",
395 # "Pxe",
396 # "Hdd",
397 # "Cd",
398 # "Diags",
399 # "BiosSetup"]}
400
401 # The values set using Redfish are verified via IPMI using the command:
402 # chassis bootparam get 5
403 # Option 5 returns the boot parameters.
404 #
405 # Sample output:
406 # Boot parameter version: 1
407 # Boot parameter 5 is valid/unlocked
408 # Boot parameter data: c000000000
409 # Boot Flags :
410 # - Boot Flag Valid
411 # - Options apply to all future boots
412 # - BIOS PC Compatible (legacy) boot
413 # - Boot Device Selector : No override
414 # - Console Redirection control : System Default
415 # - BIOS verbosity : Console redirection occurs per BIOS configuration
416 # setting (default)
417 # - BIOS Mux Control Override : BIOS uses recommended setting of the mux at
418 # the end of POST
419
420 Redfish Set Boot Default Continuous ${override_target} ${override_mode}
421
422 IF '${is_bios_setup}' == 'True'
423 Repeat Keyword ${loop_count} times Host Reboot For Bios Setup
424 ELSE
425 RF SYS GracefulRestart
426 ${output}= Run IPMI Standard Command chassis bootparam get 5
427 Should Contain ${output} ${redfish_ipmi_enabled_map['Continuous']}
428 Should Contain ${output} ${redfish_ipmi_target_map['${override_target}']}
429 IF '${PLATFORM_ARCH_TYPE}' == 'x86'
430 Should Contain ${output} ${redfish_ipmi_mode_map['${override_mode}']}
431 END
432 END
433
434 ${resp}= Redfish.Get Attribute /redfish/v1/Systems/system Boot
435 Should Be Equal As Strings ${resp["BootSourceOverrideEnabled"]} Continuous
436 Should Be Equal As Strings ${resp["BootSourceOverrideTarget"]} ${override_target}
437 Run Keyword If '${PLATFORM_ARCH_TYPE}' == 'x86'
438 ... Should Be Equal As Strings ${resp["BootSourceOverrideMode"]} ${override_mode}
439
440
441Host Reboot For Bios Setup
442 [Documentation] Rebooting Host without checking Host state.
443
444 Redfish Power Operation GracefulRestart
445
446 Sleep 1min
447
448
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600449Suite Teardown Execution
450 [Documentation] Do the post suite teardown.
451
George Keishing01644e62019-03-26 04:10:17 -0500452 Redfish.Login
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +0300453 Set And Verify Boot Source Override Disabled None UEFI
George Keishing01644e62019-03-26 04:10:17 -0500454 Redfish.Logout
George Keishingac3b0952019-03-11 06:02:28 -0500455
456
457Test Setup Execution
458 [Documentation] Do test case setup tasks.
459
460 Redfish.Login
461
462
463Test Teardown Execution
464 [Documentation] Do the post test teardown.
465
466 FFDC On Test Case Fail
467 Redfish.Logout