blob: ee84659362857aa4e5c06d75be759769bb251d7f [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
Anusha Dathatri02a0bb32019-04-05 00:50:38 -050013*** Variables ***
14# Maps for correlating redfish data values to IPMI data values.
15# The redfish values are obtained with Redfish.Get or Redfish.Get Properties.
16# The corresponding IPMI values are obtained with the "chassis bootparam get
17# 5" IPMI command.
18
19# This dictionary maps the redfish 'BootSourceOverrideEnabled' value to the
20# corresponding IPMI output value.
21&{redfish_ipmi_enabled_map} Once=Options apply to only next boot
22... Continuous=Options apply to all future boots
23... Disabled=Options apply to all future boots
24
25# This dictionary maps the redfish 'BootSourceOverrideTarget' value to the
26# corresponding IPMI output value.
27&{redfish_ipmi_target_map} Hdd=Force Boot from default Hard-Drive
28... Pxe=Force PXE
29... Diags=Force Boot from default Hard-Drive, request Safe-Mode
30... Cd=Force Boot from CD/DVD
31... BiosSetup=Force Boot into BIOS Setup
32... None=No override
33
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +030034# This dictionary maps the redfish 'BootSourceOverrideMode' value to the
35# corresponding IPMI output value.
36&{redfish_ipmi_mode_map} Legacy=BIOS PC Compatible (legacy) boot
37... UEFI=BIOS EFI boot
38
Sridevi Ramesh484e10c2019-02-28 06:14:46 -060039*** Test Cases ***
40
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +030041Verify BMC Redfish Boot Source Override with Enabled Mode As Once
42 [Documentation] Verify BMC Redfish Boot Source Override with Enabled Mode As Once.
43 [Tags] Verify_BMC_Redfish_Boot_Source_Override_with_Enabled_Mode_As_Once
44 [Template] Set And Verify Boot Source Override
Sridevi Ramesh484e10c2019-02-28 06:14:46 -060045
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +030046 #BootSourceOverrideEnabled BootSourceOverrideTarget BootSourceOverrideMode
47 Once Hdd UEFI
48 Once Pxe UEFI
49 Once Diags UEFI
50 Once Cd UEFI
51 Once BiosSetup UEFI
52 Once Hdd Legacy
53 Once Pxe Legacy
54 Once Diags Legacy
55 Once Cd Legacy
56 Once BiosSetup Legacy
Sridevi Ramesh484e10c2019-02-28 06:14:46 -060057
Sridevi Ramesh484e10c2019-02-28 06:14:46 -060058
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +030059Verify BMC Redfish Boot Source Override with Enabled Mode As Continuous
60 [Documentation] Verify BMC Redfish Boot Source Override with Enabled Mode As Continuous.
61 [Tags] Verify_BMC_Redfish_Boot_Source_Override_with_Enabled_Mode_As_Continuous
62 [Template] Set And Verify Boot Source Override
63
64 #BootSourceOverrideEnabled BootSourceOverrideTarget BootSourceOverrideMode
65 Continuous Hdd UEFI
66 Continuous Pxe UEFI
67 Continuous Diags UEFI
68 Continuous Cd UEFI
69 Continuous BiosSetup UEFI
70 Continuous Hdd Legacy
71 Continuous Pxe Legacy
72 Continuous Diags Legacy
73 Continuous Cd Legacy
74 Continuous BiosSetup Legacy
75
Sridevi Ramesh484e10c2019-02-28 06:14:46 -060076
77*** Keywords ***
78
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +030079Set And Verify Boot Source Override
80 [Documentation] Set and Verify Boot source override
81 [Arguments] ${override_enabled} ${override_target} ${override_mode}=UEFI
Sridevi Ramesh484e10c2019-02-28 06:14:46 -060082
83 # Description of argument(s):
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +030084 # override_enabled Boot source override enable type.
Sridevi Ramesh484e10c2019-02-28 06:14:46 -060085 # ('Once', 'Continuous', 'Disabled').
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +030086 # override_target Boot source override target.
Sridevi Ramesh484e10c2019-02-28 06:14:46 -060087 # ('Pxe', 'Cd', 'Hdd', 'Diags', 'BiosSetup', 'None').
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +030088 # override_mode Boot source override mode (relevant only for x86 arch).
89 # ('Legacy', 'UEFI').
Sridevi Ramesh484e10c2019-02-28 06:14:46 -060090
91 # Example:
92 # "Boot": {
93 # "BootSourceOverrideEnabled": "Disabled",
94 # "BootSourceOverrideMode": "Legacy",
95 # "BootSourceOverrideTarget": "None",
96 # "BootSourceOverrideTarget@Redfish.AllowableValues": [
97 # "None",
98 # "Pxe",
99 # "Hdd",
100 # "Cd",
101 # "Diags",
102 # "BiosSetup"]}
103
Anusha Dathatri02a0bb32019-04-05 00:50:38 -0500104 # The values set using Redfish are verified via IPMI using the command:
105 # chassis bootparam get 5
106 # Option 5 returns the boot parameters.
107 #
108 # Sample output:
109 # Boot parameter version: 1
110 # Boot parameter 5 is valid/unlocked
111 # Boot parameter data: c000000000
112 # Boot Flags :
113 # - Boot Flag Valid
114 # - Options apply to all future boots
115 # - BIOS PC Compatible (legacy) boot
116 # - Boot Device Selector : No override
117 # - Console Redirection control : System Default
118 # - BIOS verbosity : Console redirection occurs per BIOS configuration
119 # setting (default)
120 # - BIOS Mux Control Override : BIOS uses recommended setting of the mux at
121 # the end of POST
122
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +0300123 Redfish Set Boot Default ${override_enabled} ${override_target} ${override_mode}
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600124
Anusha Dathatri02a0bb32019-04-05 00:50:38 -0500125 ${output}= Run IPMI Standard Command chassis bootparam get 5
126 Should Contain ${output} ${redfish_ipmi_enabled_map['${override_enabled}']}
127 Should Contain ${output} ${redfish_ipmi_target_map['${override_target}']}
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +0300128 Run Keyword If '${PLATFORM_ARCH_TYPE}' == 'x86'
129 ... Should Contain ${output} ${redfish_ipmi_mode_map['${override_mode}']}
130
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600131
132Suite Teardown Execution
133 [Documentation] Do the post suite teardown.
134
George Keishing01644e62019-03-26 04:10:17 -0500135 Redfish.Login
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +0300136 Set And Verify Boot Source Override Disabled None UEFI
George Keishing01644e62019-03-26 04:10:17 -0500137 Redfish.Logout
George Keishingac3b0952019-03-11 06:02:28 -0500138
139
140Test Setup Execution
141 [Documentation] Do test case setup tasks.
142
143 Redfish.Login
144
145
146Test Teardown Execution
147 [Documentation] Do the post test teardown.
148
149 FFDC On Test Case Fail
150 Redfish.Logout