xref: /openbmc/openbmc-test-automation/redfish/systems/test_boot_devices.robot (revision 6fb70d98f2f1cb9273ba912deaa2cebe3c23ea86)
1484e10c1SSridevi Ramesh*** Settings ***
2484e10c1SSridevi RameshDocumentation    This suite test various boot types with boot source.
3484e10c1SSridevi RameshResource         ../../lib/resource.robot
4484e10c1SSridevi RameshResource         ../../lib/bmc_redfish_resource.robot
5484e10c1SSridevi RameshResource         ../../lib/common_utils.robot
6484e10c1SSridevi RameshResource         ../../lib/openbmc_ffdc.robot
702a0bb37SAnusha DathatriResource         ../../lib/ipmi_client.robot
8484e10c1SSridevi Ramesh
9ac3b0958SGeorge KeishingTest Setup       Test Setup Execution
10ac3b0958SGeorge KeishingTest Teardown    Test Teardown Execution
11484e10c1SSridevi RameshSuite Teardown   Suite Teardown Execution
12484e10c1SSridevi Ramesh
13*6fb70d98SMatt FischerTest Tags       Boot_Devices
14f699f55dSGeorge Keishing
1502a0bb37SAnusha Dathatri*** Variables ***
1602a0bb37SAnusha Dathatri# Maps for correlating redfish data values to IPMI data values.
1702a0bb37SAnusha Dathatri# The redfish values are obtained with Redfish.Get or Redfish.Get Properties.
1802a0bb37SAnusha Dathatri# The corresponding IPMI values are obtained with the "chassis bootparam get
1902a0bb37SAnusha Dathatri# 5" IPMI command.
2002a0bb37SAnusha Dathatri
2102a0bb37SAnusha Dathatri# This dictionary maps the redfish 'BootSourceOverrideEnabled' value to the
2202a0bb37SAnusha Dathatri# corresponding IPMI output value.
2302a0bb37SAnusha Dathatri&{redfish_ipmi_enabled_map}  Once=Options apply to only next boot
2402a0bb37SAnusha Dathatri...                          Continuous=Options apply to all future boots
2561d2250bSKonstantin Aladyshev...                          Disabled=Boot Flag Invalid
2602a0bb37SAnusha Dathatri
2702a0bb37SAnusha Dathatri# This dictionary maps the redfish 'BootSourceOverrideTarget' value to the
2802a0bb37SAnusha Dathatri# corresponding IPMI output value.
2902a0bb37SAnusha Dathatri&{redfish_ipmi_target_map}  Hdd=Force Boot from default Hard-Drive
3002a0bb37SAnusha Dathatri...                         Pxe=Force PXE
3102a0bb37SAnusha Dathatri...                         Diags=Force Boot from default Hard-Drive, request Safe-Mode
3202a0bb37SAnusha Dathatri...                         Cd=Force Boot from CD/DVD
3302a0bb37SAnusha Dathatri...                         BiosSetup=Force Boot into BIOS Setup
3402a0bb37SAnusha Dathatri...                         None=No override
3502a0bb37SAnusha Dathatri
360043fc59SKonstantin Aladyshev# This dictionary maps the redfish 'BootSourceOverrideMode' value to the
370043fc59SKonstantin Aladyshev# corresponding IPMI output value.
380043fc59SKonstantin Aladyshev&{redfish_ipmi_mode_map}  Legacy=BIOS PC Compatible (legacy) boot
390043fc59SKonstantin Aladyshev...                       UEFI=BIOS EFI boot
400043fc59SKonstantin Aladyshev
41b5138fd8Smanimozhik${loop_count}             2
42b5138fd8Smanimozhik
43484e10c1SSridevi Ramesh*** Test Cases ***
44484e10c1SSridevi Ramesh
450043fc59SKonstantin AladyshevVerify BMC Redfish Boot Source Override with Enabled Mode As Once
460043fc59SKonstantin Aladyshev    [Documentation]  Verify BMC Redfish Boot Source Override with Enabled Mode As Once.
470043fc59SKonstantin Aladyshev    [Tags]           Verify_BMC_Redfish_Boot_Source_Override_with_Enabled_Mode_As_Once
480043fc59SKonstantin Aladyshev    [Template]  Set And Verify Boot Source Override
49484e10c1SSridevi Ramesh
500043fc59SKonstantin Aladyshev    #BootSourceOverrideEnabled    BootSourceOverrideTarget    BootSourceOverrideMode
510043fc59SKonstantin Aladyshev    Once                          Hdd                         UEFI
520043fc59SKonstantin Aladyshev    Once                          Pxe                         UEFI
530043fc59SKonstantin Aladyshev    Once                          Diags                       UEFI
540043fc59SKonstantin Aladyshev    Once                          Cd                          UEFI
550043fc59SKonstantin Aladyshev    Once                          BiosSetup                   UEFI
5661d2250bSKonstantin Aladyshev    Once                          None                        UEFI
570043fc59SKonstantin Aladyshev    Once                          Hdd                         Legacy
580043fc59SKonstantin Aladyshev    Once                          Pxe                         Legacy
590043fc59SKonstantin Aladyshev    Once                          Diags                       Legacy
600043fc59SKonstantin Aladyshev    Once                          Cd                          Legacy
610043fc59SKonstantin Aladyshev    Once                          BiosSetup                   Legacy
6261d2250bSKonstantin Aladyshev    Once                          None                        Legacy
63484e10c1SSridevi Ramesh
64484e10c1SSridevi Ramesh
650043fc59SKonstantin AladyshevVerify BMC Redfish Boot Source Override with Enabled Mode As Continuous
660043fc59SKonstantin Aladyshev    [Documentation]  Verify BMC Redfish Boot Source Override with Enabled Mode As Continuous.
670043fc59SKonstantin Aladyshev    [Tags]           Verify_BMC_Redfish_Boot_Source_Override_with_Enabled_Mode_As_Continuous
680043fc59SKonstantin Aladyshev    [Template]  Set And Verify Boot Source Override
690043fc59SKonstantin Aladyshev
700043fc59SKonstantin Aladyshev    #BootSourceOverrideEnabled    BootSourceOverrideTarget    BootSourceOverrideMode
710043fc59SKonstantin Aladyshev    Continuous                    Hdd                         UEFI
720043fc59SKonstantin Aladyshev    Continuous                    Pxe                         UEFI
730043fc59SKonstantin Aladyshev    Continuous                    Diags                       UEFI
740043fc59SKonstantin Aladyshev    Continuous                    Cd                          UEFI
750043fc59SKonstantin Aladyshev    Continuous                    BiosSetup                   UEFI
7661d2250bSKonstantin Aladyshev    Continuous                    None                        UEFI
770043fc59SKonstantin Aladyshev    Continuous                    Hdd                         Legacy
780043fc59SKonstantin Aladyshev    Continuous                    Pxe                         Legacy
790043fc59SKonstantin Aladyshev    Continuous                    Diags                       Legacy
800043fc59SKonstantin Aladyshev    Continuous                    Cd                          Legacy
810043fc59SKonstantin Aladyshev    Continuous                    BiosSetup                   Legacy
8261d2250bSKonstantin Aladyshev    Continuous                    None                        Legacy
8361d2250bSKonstantin Aladyshev
8461d2250bSKonstantin Aladyshev
8561d2250bSKonstantin AladyshevVerify BMC Redfish Boot Source Override with Enabled Mode As Disabled
8661d2250bSKonstantin Aladyshev    [Documentation]  Verify BMC Redfish Boot Source Override with Enabled Mode As Disabled.
8761d2250bSKonstantin Aladyshev    [Tags]           Verify_BMC_Redfish_Boot_Source_Override_with_Enabled_Mode_As_Disabled
8861d2250bSKonstantin Aladyshev    [Template]  Set And Verify Boot Source Override
8961d2250bSKonstantin Aladyshev
9061d2250bSKonstantin Aladyshev    #BootSourceOverrideEnabled    BootSourceOverrideTarget    BootSourceOverrideMode
9161d2250bSKonstantin Aladyshev    Disabled                      Hdd                         UEFI
9261d2250bSKonstantin Aladyshev    Disabled                      Pxe                         UEFI
9361d2250bSKonstantin Aladyshev    Disabled                      Diags                       UEFI
9461d2250bSKonstantin Aladyshev    Disabled                      Cd                          UEFI
9561d2250bSKonstantin Aladyshev    Disabled                      BiosSetup                   UEFI
9661d2250bSKonstantin Aladyshev    Disabled                      None                        UEFI
9761d2250bSKonstantin Aladyshev    Disabled                      Hdd                         Legacy
9861d2250bSKonstantin Aladyshev    Disabled                      Pxe                         Legacy
9961d2250bSKonstantin Aladyshev    Disabled                      Diags                       Legacy
10061d2250bSKonstantin Aladyshev    Disabled                      Cd                          Legacy
10161d2250bSKonstantin Aladyshev    Disabled                      BiosSetup                   Legacy
10261d2250bSKonstantin Aladyshev    Disabled                      None                        Legacy
1030043fc59SKonstantin Aladyshev
104484e10c1SSridevi Ramesh
105ee0103d5SGeorge KeishingVerify Boot Source Override Policy Persistency With Enabled Mode As Once After BMC Reboot
106b5138fd8Smanimozhik    [Documentation]  Verify Boot Source Override Policy Persistency with Enabled Mode As Once After BMC Reboot.
107b5138fd8Smanimozhik    [Tags]           Verify_Boot_Source_Override_Policy_Persistency_With_Enabled_Mode_As_Once_After_BMC_Reboot
108b5138fd8Smanimozhik    [Template]  Verify Boot Source Override After BMC Reboot
109b5138fd8Smanimozhik
110b5138fd8Smanimozhik    #BootSourceOverrideEnabled    BootSourceOverrideTarget    BootSourceOverrideMode
111b5138fd8Smanimozhik    Once                          Hdd                         UEFI
112b5138fd8Smanimozhik    Once                          Pxe                         UEFI
113b5138fd8Smanimozhik    Once                          Diags                       UEFI
114b5138fd8Smanimozhik    Once                          Cd                          UEFI
115b5138fd8Smanimozhik    Once                          BiosSetup                   UEFI
116b5138fd8Smanimozhik    Once                          None                        UEFI
117b5138fd8Smanimozhik    Once                          Hdd                         Legacy
118b5138fd8Smanimozhik    Once                          Pxe                         Legacy
119b5138fd8Smanimozhik    Once                          Diags                       Legacy
120b5138fd8Smanimozhik    Once                          Cd                          Legacy
121b5138fd8Smanimozhik    Once                          BiosSetup                   Legacy
122b5138fd8Smanimozhik    Once                          None                        Legacy
123b5138fd8Smanimozhik
124b5138fd8Smanimozhik
125ee0103d5SGeorge KeishingVerify Boot Source Override Policy Persistency With Enabled Mode As Continuous After BMC Reboot
126b5138fd8Smanimozhik    [Documentation]  Verify Boot Source Override Policy Persistency with Enabled Mode As Continuous After BMC Reboot.
127b5138fd8Smanimozhik    [Tags]           Verify_Boot_Source_Override_Policy_Persistency_With_Enabled_Mode_As_Continuous_After_BMC_Reboot
128b5138fd8Smanimozhik    [Template]  Verify Boot Source Override After BMC Reboot
129b5138fd8Smanimozhik
130b5138fd8Smanimozhik    #BootSourceOverrideEnabled    BootSourceOverrideTarget    BootSourceOverrideMode
131b5138fd8Smanimozhik    Continuous                    Hdd                         UEFI
132b5138fd8Smanimozhik    Continuous                    Pxe                         UEFI
133b5138fd8Smanimozhik    Continuous                    Diags                       UEFI
134b5138fd8Smanimozhik    Continuous                    Cd                          UEFI
135b5138fd8Smanimozhik    Continuous                    BiosSetup                   UEFI
136b5138fd8Smanimozhik    Continuous                    None                        UEFI
137b5138fd8Smanimozhik    Continuous                    Hdd                         Legacy
138b5138fd8Smanimozhik    Continuous                    Pxe                         Legacy
139b5138fd8Smanimozhik    Continuous                    Diags                       Legacy
140b5138fd8Smanimozhik    Continuous                    Cd                          Legacy
141b5138fd8Smanimozhik    Continuous                    BiosSetup                   Legacy
142b5138fd8Smanimozhik    Continuous                    None                        Legacy
143b5138fd8Smanimozhik
144b5138fd8Smanimozhik
145ee0103d5SGeorge KeishingVerify Boot Source Override Policy With Enabled Mode As Once After Host Reboot
146b5138fd8Smanimozhik    [Documentation]  Verify Boot Source Override Policy with Enabled Mode As Once After Host Reboot.
147b5138fd8Smanimozhik    [Tags]           Verify_Boot_Source_Override_Policy_With_Enabled_Mode_As_Once_After_Host_Reboot
148b5138fd8Smanimozhik    [Template]  Verify Boot Source Override with Enabled Mode As Once After Host Reboot
149b5138fd8Smanimozhik
150b5138fd8Smanimozhik    #BootSourceOverrideTarget    BootSourceOverrideMode
151b5138fd8Smanimozhik    Hdd                         UEFI
152b5138fd8Smanimozhik    Pxe                         UEFI
153b5138fd8Smanimozhik    Diags                       UEFI
154b5138fd8Smanimozhik    Cd                          UEFI
155b5138fd8Smanimozhik    None                        UEFI
156b5138fd8Smanimozhik    Hdd                         Legacy
157b5138fd8Smanimozhik    Pxe                         Legacy
158b5138fd8Smanimozhik    Diags                       Legacy
159b5138fd8Smanimozhik    Cd                          Legacy
160b5138fd8Smanimozhik    None                        Legacy
161b5138fd8Smanimozhik
162b5138fd8Smanimozhik
163ee0103d5SGeorge KeishingVerify Boot Source Override Policy With Enabled Mode As Continuous After Host Reboot
164b5138fd8Smanimozhik    [Documentation]  Verify Boot Source Override Policy With Enabled Mode As Continuous After Host Reboot.
165b5138fd8Smanimozhik    [Tags]           Verify_Boot_Source_Override_Policy_With_Enabled_Mode_As_Continuous_After_Host_Reboot
166b5138fd8Smanimozhik    [Template]  Verify Boot Source Override with Enabled Mode As Continuous After Host Reboot
167b5138fd8Smanimozhik
168b5138fd8Smanimozhik    #BootSourceOverrideTarget    BootSourceOverrideMode
169b5138fd8Smanimozhik    Hdd                         UEFI
170b5138fd8Smanimozhik    Pxe                         UEFI
171b5138fd8Smanimozhik    Diags                       UEFI
172b5138fd8Smanimozhik    Cd                          UEFI
173b5138fd8Smanimozhik    None                        UEFI
174b5138fd8Smanimozhik    Hdd                         Legacy
175b5138fd8Smanimozhik    Pxe                         Legacy
176b5138fd8Smanimozhik    Diags                       Legacy
177b5138fd8Smanimozhik    Cd                          Legacy
178b5138fd8Smanimozhik    None                        Legacy
179b5138fd8Smanimozhik
180b5138fd8Smanimozhik
181ee0103d5SGeorge KeishingVerify Boot Source Override With Enabled Mode As Once After Host Reboot For Bios Setup
182b5138fd8Smanimozhik    [Documentation]  Verify Boot Source Override with Enabled Mode As Once After Host Reboot For Bios Setup.
183b5138fd8Smanimozhik    [Tags]           Verify_Boot_Source_Override_With_Enabled_Mode_As_Once_After_Host_Reboot_For_Bios_Setup
184b5138fd8Smanimozhik    [Template]  Verify Boot Source Override with Enabled Mode As Once After Host Reboot
185b5138fd8Smanimozhik
186b5138fd8Smanimozhik    #BootSourceOverrideTarget   BootSourceOverrideMode   Biosflag
187b5138fd8Smanimozhik    BiosSetup                   UEFI                     True
188b5138fd8Smanimozhik    BiosSetup                   Legacy                   True
189b5138fd8Smanimozhik
190b5138fd8Smanimozhik
191ee0103d5SGeorge KeishingVerify Boot Source Override With Enabled Mode As Continuous After Host Reboot For Bios Setup
192b5138fd8Smanimozhik    [Documentation]  Verify Boot Source Override with Enabled Mode As Continuous After Host Reboot For Bios Setup.
193b5138fd8Smanimozhik    [Tags]           Verify_Boot_Source_Override_With_Enabled_Mode_As_Continuous_After_Host_Reboot_For_Bios_Setup
194b5138fd8Smanimozhik    [Template]  Verify Boot Source Override with Enabled Mode As Continuous After Host Reboot
195b5138fd8Smanimozhik
196b5138fd8Smanimozhik    #BootSourceOverrideTarget   BootSourceOverrideMode   Biosflag
197b5138fd8Smanimozhik    BiosSetup                   UEFI                     True
198b5138fd8Smanimozhik    BiosSetup                   Legacy                   True
199b5138fd8Smanimozhik
200b5138fd8Smanimozhik
201484e10c1SSridevi Ramesh*** Keywords ***
202484e10c1SSridevi Ramesh
2030043fc59SKonstantin AladyshevSet And Verify Boot Source Override
204b5138fd8Smanimozhik    [Documentation]  Set and Verify Boot source override.
2050043fc59SKonstantin Aladyshev    [Arguments]      ${override_enabled}  ${override_target}  ${override_mode}=UEFI
206484e10c1SSridevi Ramesh
207484e10c1SSridevi Ramesh    # Description of argument(s):
2080043fc59SKonstantin Aladyshev    # override_enabled    Boot source override enable type.
209484e10c1SSridevi Ramesh    #                     ('Once', 'Continuous', 'Disabled').
2100043fc59SKonstantin Aladyshev    # override_target     Boot source override target.
211484e10c1SSridevi Ramesh    #                     ('Pxe', 'Cd', 'Hdd', 'Diags', 'BiosSetup', 'None').
2120043fc59SKonstantin Aladyshev    # override_mode       Boot source override mode (relevant only for x86 arch).
2130043fc59SKonstantin Aladyshev    #                     ('Legacy', 'UEFI').
214484e10c1SSridevi Ramesh
215484e10c1SSridevi Ramesh    # Example:
216484e10c1SSridevi Ramesh    # "Boot": {
217484e10c1SSridevi Ramesh    # "BootSourceOverrideEnabled": "Disabled",
218484e10c1SSridevi Ramesh    # "BootSourceOverrideMode": "Legacy",
219484e10c1SSridevi Ramesh    # "BootSourceOverrideTarget": "None",
220484e10c1SSridevi Ramesh    # "BootSourceOverrideTarget@Redfish.AllowableValues": [
221484e10c1SSridevi Ramesh    # "None",
222484e10c1SSridevi Ramesh    # "Pxe",
223484e10c1SSridevi Ramesh    # "Hdd",
224484e10c1SSridevi Ramesh    # "Cd",
225484e10c1SSridevi Ramesh    # "Diags",
226484e10c1SSridevi Ramesh    # "BiosSetup"]}
227484e10c1SSridevi Ramesh
22802a0bb37SAnusha Dathatri    # The values set using Redfish are verified via IPMI using the command:
22902a0bb37SAnusha Dathatri    # chassis bootparam get 5
23002a0bb37SAnusha Dathatri    # Option 5 returns the boot parameters.
23102a0bb37SAnusha Dathatri    #
23202a0bb37SAnusha Dathatri    # Sample output:
23302a0bb37SAnusha Dathatri    # Boot parameter version: 1
23402a0bb37SAnusha Dathatri    # Boot parameter 5 is valid/unlocked
23502a0bb37SAnusha Dathatri    # Boot parameter data: c000000000
23602a0bb37SAnusha Dathatri    # Boot Flags :
23702a0bb37SAnusha Dathatri    # - Boot Flag Valid
23802a0bb37SAnusha Dathatri    # - Options apply to all future boots
23902a0bb37SAnusha Dathatri    # - BIOS PC Compatible (legacy) boot
24002a0bb37SAnusha Dathatri    # - Boot Device Selector : No override
24102a0bb37SAnusha Dathatri    # - Console Redirection control : System Default
24202a0bb37SAnusha Dathatri    # - BIOS verbosity : Console redirection occurs per BIOS configuration
24302a0bb37SAnusha Dathatri    #   setting (default)
24402a0bb37SAnusha Dathatri    # - BIOS Mux Control Override : BIOS uses recommended setting of the mux at
24502a0bb37SAnusha Dathatri    #   the end of POST
24602a0bb37SAnusha Dathatri
2470043fc59SKonstantin Aladyshev    Redfish Set Boot Default  ${override_enabled}  ${override_target}  ${override_mode}
248484e10c1SSridevi Ramesh
24902a0bb37SAnusha Dathatri    ${output}=  Run IPMI Standard Command  chassis bootparam get 5
25002a0bb37SAnusha Dathatri    Should Contain  ${output}  ${redfish_ipmi_enabled_map['${override_enabled}']}
25102a0bb37SAnusha Dathatri    Should Contain  ${output}  ${redfish_ipmi_target_map['${override_target}']}
2520043fc59SKonstantin Aladyshev    Run Keyword If  '${PLATFORM_ARCH_TYPE}' == 'x86'
2530043fc59SKonstantin Aladyshev    ...  Should Contain  ${output}  ${redfish_ipmi_mode_map['${override_mode}']}
2540043fc59SKonstantin Aladyshev
255484e10c1SSridevi Ramesh
256b5138fd8SmanimozhikVerify Boot Source Override After BMC Reboot
257b5138fd8Smanimozhik    [Documentation]  Verify Boot Source Override After BMC Reboot.
258b5138fd8Smanimozhik    [Arguments]      ${override_enabled}  ${override_target}  ${override_mode}=UEFI
259b5138fd8Smanimozhik
260b5138fd8Smanimozhik    # Description of argument(s):
261b5138fd8Smanimozhik    # override_enabled    Boot source override enable type.
262b5138fd8Smanimozhik    #                     ('Once', 'Continuous', 'Disabled').
263b5138fd8Smanimozhik    # override_target     Boot source override target.
264b5138fd8Smanimozhik    #                     ('Pxe', 'Cd', 'Hdd', 'Diags', 'BiosSetup', 'None').
265b5138fd8Smanimozhik    # override_mode       Boot source override mode (relevant only for x86 arch).
266b5138fd8Smanimozhik    #                     ('Legacy', 'UEFI').
267b5138fd8Smanimozhik
268b5138fd8Smanimozhik    # Example:
269b5138fd8Smanimozhik    # "Boot": {
270b5138fd8Smanimozhik    # "BootSourceOverrideEnabled": "Disabled",
271b5138fd8Smanimozhik    # "BootSourceOverrideMode": "Legacy",
272b5138fd8Smanimozhik    # "BootSourceOverrideTarget": "None",
273b5138fd8Smanimozhik    # "BootSourceOverrideTarget@Redfish.AllowableValues": [
274b5138fd8Smanimozhik    # "None",
275b5138fd8Smanimozhik    # "Pxe",
276b5138fd8Smanimozhik    # "Hdd",
277b5138fd8Smanimozhik    # "Cd",
278b5138fd8Smanimozhik    # "Diags",
279b5138fd8Smanimozhik    # "BiosSetup"]}
280b5138fd8Smanimozhik
281b5138fd8Smanimozhik    # The values set using Redfish are verified via IPMI using the command:
282b5138fd8Smanimozhik    # chassis bootparam get 5
283b5138fd8Smanimozhik    # Option 5 returns the boot parameters.
284b5138fd8Smanimozhik    #
285b5138fd8Smanimozhik    # Sample output:
286b5138fd8Smanimozhik    # Boot parameter version: 1
287b5138fd8Smanimozhik    # Boot parameter 5 is valid/unlocked
288b5138fd8Smanimozhik    # Boot parameter data: c000000000
289b5138fd8Smanimozhik    # Boot Flags :
290b5138fd8Smanimozhik    # - Boot Flag Valid
291b5138fd8Smanimozhik    # - Options apply to all future boots
292b5138fd8Smanimozhik    # - BIOS PC Compatible (legacy) boot
293b5138fd8Smanimozhik    # - Boot Device Selector : No override
294b5138fd8Smanimozhik    # - Console Redirection control : System Default
295b5138fd8Smanimozhik    # - BIOS verbosity : Console redirection occurs per BIOS configuration
296b5138fd8Smanimozhik    #   setting (default)
297b5138fd8Smanimozhik    # - BIOS Mux Control Override : BIOS uses recommended setting of the mux at
298b5138fd8Smanimozhik    #   the end of POST
299b5138fd8Smanimozhik
300b5138fd8Smanimozhik    Redfish Set Boot Default  ${override_enabled}  ${override_target}  ${override_mode}
301b5138fd8Smanimozhik
302b5138fd8Smanimozhik    Redfish OBMC Reboot (run)
303b5138fd8Smanimozhik
304b5138fd8Smanimozhik    ${output}=  Run IPMI Standard Command  chassis bootparam get 5
305b5138fd8Smanimozhik    Should Contain  ${output}  ${redfish_ipmi_enabled_map['${override_enabled}']}
306b5138fd8Smanimozhik    Should Contain  ${output}  ${redfish_ipmi_target_map['${override_target}']}
307b5138fd8Smanimozhik    Run Keyword If  '${PLATFORM_ARCH_TYPE}' == 'x86'
308b5138fd8Smanimozhik    ...  Should Contain  ${output}  ${redfish_ipmi_mode_map['${override_mode}']}
309b5138fd8Smanimozhik
310b5138fd8Smanimozhik
311b5138fd8SmanimozhikVerify Boot Source Override with Enabled Mode As Once After Host Reboot
312b5138fd8Smanimozhik    [Documentation]  Verify Boot Source Override with Enabled Mode As Once After Host Reboot.
313b5138fd8Smanimozhik    [Arguments]      ${override_target}  ${override_mode}=UEFI  ${is_bios_setup}=False
314b5138fd8Smanimozhik
315b5138fd8Smanimozhik    # Description of argument(s):
316b5138fd8Smanimozhik    # override_enabled    Boot source override enable type.
317b5138fd8Smanimozhik    #                     ('Once', 'Continuous', 'Disabled').
318b5138fd8Smanimozhik    # override_target     Boot source override target.
319b5138fd8Smanimozhik    #                     ('Pxe', 'Cd', 'Hdd', 'Diags', 'BiosSetup', 'None').
320b5138fd8Smanimozhik    # override_mode       Boot source override mode (relevant only for x86 arch).
321b5138fd8Smanimozhik    #                     ('Legacy', 'UEFI').
322b5138fd8Smanimozhik
323b5138fd8Smanimozhik    # Example:
324b5138fd8Smanimozhik    # "Boot": {
325b5138fd8Smanimozhik    # "BootSourceOverrideEnabled": "Disabled",
326b5138fd8Smanimozhik    # "BootSourceOverrideMode": "Legacy",
327b5138fd8Smanimozhik    # "BootSourceOverrideTarget": "None",
328b5138fd8Smanimozhik    # "BootSourceOverrideTarget@Redfish.AllowableValues": [
329b5138fd8Smanimozhik    # "None",
330b5138fd8Smanimozhik    # "Pxe",
331b5138fd8Smanimozhik    # "Hdd",
332b5138fd8Smanimozhik    # "Cd",
333b5138fd8Smanimozhik    # "Diags",
334b5138fd8Smanimozhik    # "BiosSetup"]}
335b5138fd8Smanimozhik
336b5138fd8Smanimozhik    # The values set using Redfish are verified via IPMI using the command:
337b5138fd8Smanimozhik    # chassis bootparam get 5
338b5138fd8Smanimozhik    # Option 5 returns the boot parameters.
339b5138fd8Smanimozhik    #
340b5138fd8Smanimozhik    # Sample output:
341b5138fd8Smanimozhik    # Boot parameter version: 1
342b5138fd8Smanimozhik    # Boot parameter 5 is valid/unlocked
343b5138fd8Smanimozhik    # Boot parameter data: c000000000
344b5138fd8Smanimozhik    # Boot Flags :
345b5138fd8Smanimozhik    # - Boot Flag Valid
346b5138fd8Smanimozhik    # - Options apply to all future boots
347b5138fd8Smanimozhik    # - BIOS PC Compatible (legacy) boot
348b5138fd8Smanimozhik    # - Boot Device Selector : No override
349b5138fd8Smanimozhik    # - Console Redirection control : System Default
350b5138fd8Smanimozhik    # - BIOS verbosity : Console redirection occurs per BIOS configuration
351b5138fd8Smanimozhik    #   setting (default)
352b5138fd8Smanimozhik    # - BIOS Mux Control Override : BIOS uses recommended setting of the mux at
353b5138fd8Smanimozhik    #   the end of POST
354b5138fd8Smanimozhik
355b5138fd8Smanimozhik    Redfish Set Boot Default  Once  ${override_target}  ${override_mode}
356b5138fd8Smanimozhik
357b5138fd8Smanimozhik    IF  '${is_bios_setup}' == 'True'
358b5138fd8Smanimozhik         Repeat Keyword  ${loop_count} times  Host Reboot For Bios Setup
359b5138fd8Smanimozhik    ELSE
360b5138fd8Smanimozhik         RF SYS GracefulRestart
361b5138fd8Smanimozhik         ${output}=  Run IPMI Standard Command  chassis bootparam get 5
362b5138fd8Smanimozhik         Should Contain  ${output}  ${redfish_ipmi_enabled_map['Once']}
363b5138fd8Smanimozhik         Should Contain  ${output}  ${redfish_ipmi_target_map['None']}
364b5138fd8Smanimozhik         IF  '${PLATFORM_ARCH_TYPE}' == 'x86'
365b5138fd8Smanimozhik             Should Contain  ${output}  ${redfish_ipmi_mode_map['Legacy']}
366b5138fd8Smanimozhik         END
367b5138fd8Smanimozhik    END
368b5138fd8Smanimozhik
369b5138fd8Smanimozhik    ${resp}=  Redfish.Get Attribute  /redfish/v1/Systems/system  Boot
370b5138fd8Smanimozhik    Should Be Equal As Strings  ${resp["BootSourceOverrideEnabled"]}  Disabled
371b5138fd8Smanimozhik    Should Be Equal As Strings  ${resp["BootSourceOverrideTarget"]}  None
372b5138fd8Smanimozhik    Run Keyword If  '${PLATFORM_ARCH_TYPE}' == 'x86'
373b5138fd8Smanimozhik    ...  Should Be Equal As Strings  ${resp["BootSourceOverrideMode"]}  Legacy
374b5138fd8Smanimozhik
375b5138fd8Smanimozhik
376b5138fd8SmanimozhikVerify Boot Source Override with Enabled Mode As Continuous After Host Reboot
377b5138fd8Smanimozhik    [Documentation]  Verify Boot Source Override with Enabled Mode As Continuous After Host Reboot.
378b5138fd8Smanimozhik    [Arguments]      ${override_target}  ${override_mode}=UEFI  ${is_bios_setup}=False
379b5138fd8Smanimozhik
380b5138fd8Smanimozhik    # Description of argument(s):
381b5138fd8Smanimozhik    # override_enabled    Boot source override enable type.
382b5138fd8Smanimozhik    #                     ('Once', 'Continuous', 'Disabled').
383b5138fd8Smanimozhik    # override_target     Boot source override target.
384b5138fd8Smanimozhik    #                     ('Pxe', 'Cd', 'Hdd', 'Diags', 'BiosSetup', 'None').
385b5138fd8Smanimozhik    # override_mode       Boot source override mode (relevant only for x86 arch).
386b5138fd8Smanimozhik    #                     ('Legacy', 'UEFI').
387b5138fd8Smanimozhik
388b5138fd8Smanimozhik    # Example:
389b5138fd8Smanimozhik    # "Boot": {
390b5138fd8Smanimozhik    # "BootSourceOverrideEnabled": "Disabled",
391b5138fd8Smanimozhik    # "BootSourceOverrideMode": "Legacy",
392b5138fd8Smanimozhik    # "BootSourceOverrideTarget": "None",
393b5138fd8Smanimozhik    # "BootSourceOverrideTarget@Redfish.AllowableValues": [
394b5138fd8Smanimozhik    # "None",
395b5138fd8Smanimozhik    # "Pxe",
396b5138fd8Smanimozhik    # "Hdd",
397b5138fd8Smanimozhik    # "Cd",
398b5138fd8Smanimozhik    # "Diags",
399b5138fd8Smanimozhik    # "BiosSetup"]}
400b5138fd8Smanimozhik
401b5138fd8Smanimozhik    # The values set using Redfish are verified via IPMI using the command:
402b5138fd8Smanimozhik    # chassis bootparam get 5
403b5138fd8Smanimozhik    # Option 5 returns the boot parameters.
404b5138fd8Smanimozhik    #
405b5138fd8Smanimozhik    # Sample output:
406b5138fd8Smanimozhik    # Boot parameter version: 1
407b5138fd8Smanimozhik    # Boot parameter 5 is valid/unlocked
408b5138fd8Smanimozhik    # Boot parameter data: c000000000
409b5138fd8Smanimozhik    # Boot Flags :
410b5138fd8Smanimozhik    # - Boot Flag Valid
411b5138fd8Smanimozhik    # - Options apply to all future boots
412b5138fd8Smanimozhik    # - BIOS PC Compatible (legacy) boot
413b5138fd8Smanimozhik    # - Boot Device Selector : No override
414b5138fd8Smanimozhik    # - Console Redirection control : System Default
415b5138fd8Smanimozhik    # - BIOS verbosity : Console redirection occurs per BIOS configuration
416b5138fd8Smanimozhik    #   setting (default)
417b5138fd8Smanimozhik    # - BIOS Mux Control Override : BIOS uses recommended setting of the mux at
418b5138fd8Smanimozhik    #   the end of POST
419b5138fd8Smanimozhik
420b5138fd8Smanimozhik    Redfish Set Boot Default  Continuous  ${override_target}  ${override_mode}
421b5138fd8Smanimozhik
422b5138fd8Smanimozhik    IF  '${is_bios_setup}' == 'True'
423b5138fd8Smanimozhik         Repeat Keyword  ${loop_count} times  Host Reboot For Bios Setup
424b5138fd8Smanimozhik    ELSE
425b5138fd8Smanimozhik         RF SYS GracefulRestart
426b5138fd8Smanimozhik         ${output}=  Run IPMI Standard Command  chassis bootparam get 5
427b5138fd8Smanimozhik         Should Contain  ${output}  ${redfish_ipmi_enabled_map['Continuous']}
428b5138fd8Smanimozhik         Should Contain  ${output}  ${redfish_ipmi_target_map['${override_target}']}
429b5138fd8Smanimozhik         IF  '${PLATFORM_ARCH_TYPE}' == 'x86'
430b5138fd8Smanimozhik             Should Contain  ${output}  ${redfish_ipmi_mode_map['${override_mode}']}
431b5138fd8Smanimozhik         END
432b5138fd8Smanimozhik    END
433b5138fd8Smanimozhik
434b5138fd8Smanimozhik    ${resp}=  Redfish.Get Attribute  /redfish/v1/Systems/system  Boot
435b5138fd8Smanimozhik    Should Be Equal As Strings  ${resp["BootSourceOverrideEnabled"]}  Continuous
436b5138fd8Smanimozhik    Should Be Equal As Strings  ${resp["BootSourceOverrideTarget"]}  ${override_target}
437b5138fd8Smanimozhik    Run Keyword If  '${PLATFORM_ARCH_TYPE}' == 'x86'
438b5138fd8Smanimozhik    ...  Should Be Equal As Strings  ${resp["BootSourceOverrideMode"]}  ${override_mode}
439b5138fd8Smanimozhik
440b5138fd8Smanimozhik
441b5138fd8SmanimozhikHost Reboot For Bios Setup
442b5138fd8Smanimozhik    [Documentation]  Rebooting Host without checking Host state.
443b5138fd8Smanimozhik
444b5138fd8Smanimozhik    Redfish Power Operation  GracefulRestart
445b5138fd8Smanimozhik
446b5138fd8Smanimozhik    Sleep  1min
447b5138fd8Smanimozhik
448b5138fd8Smanimozhik
449484e10c1SSridevi RameshSuite Teardown Execution
450484e10c1SSridevi Ramesh    [Documentation]  Do the post suite teardown.
451484e10c1SSridevi Ramesh
45201644e67SGeorge Keishing    Redfish.Login
4530043fc59SKonstantin Aladyshev    Set And Verify Boot Source Override  Disabled  None  UEFI
45401644e67SGeorge Keishing    Redfish.Logout
455ac3b0958SGeorge Keishing
456ac3b0958SGeorge Keishing
457ac3b0958SGeorge KeishingTest Setup Execution
458ac3b0958SGeorge Keishing    [Documentation]  Do test case setup tasks.
459ac3b0958SGeorge Keishing
460ac3b0958SGeorge Keishing    Redfish.Login
461ac3b0958SGeorge Keishing
462ac3b0958SGeorge Keishing
463ac3b0958SGeorge KeishingTest Teardown Execution
464ac3b0958SGeorge Keishing    [Documentation]  Do the post test teardown.
465ac3b0958SGeorge Keishing
466ac3b0958SGeorge Keishing    FFDC On Test Case Fail
467ac3b0958SGeorge Keishing    Redfish.Logout
468