blob: 574b33013f8e4eb09c50435ad712ade729788638 [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
Sridevi Ramesh484e10c2019-02-28 06:14:46 -060041*** Test Cases ***
42
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +030043Verify BMC Redfish Boot Source Override with Enabled Mode As Once
44 [Documentation] Verify BMC Redfish Boot Source Override with Enabled Mode As Once.
45 [Tags] Verify_BMC_Redfish_Boot_Source_Override_with_Enabled_Mode_As_Once
46 [Template] Set And Verify Boot Source Override
Sridevi Ramesh484e10c2019-02-28 06:14:46 -060047
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +030048 #BootSourceOverrideEnabled BootSourceOverrideTarget BootSourceOverrideMode
49 Once Hdd UEFI
50 Once Pxe UEFI
51 Once Diags UEFI
52 Once Cd UEFI
53 Once BiosSetup UEFI
Konstantin Aladyshev61d22502021-06-18 15:47:53 +030054 Once None UEFI
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +030055 Once Hdd Legacy
56 Once Pxe Legacy
57 Once Diags Legacy
58 Once Cd Legacy
59 Once BiosSetup Legacy
Konstantin Aladyshev61d22502021-06-18 15:47:53 +030060 Once None Legacy
Sridevi Ramesh484e10c2019-02-28 06:14:46 -060061
Sridevi Ramesh484e10c2019-02-28 06:14:46 -060062
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +030063Verify BMC Redfish Boot Source Override with Enabled Mode As Continuous
64 [Documentation] Verify BMC Redfish Boot Source Override with Enabled Mode As Continuous.
65 [Tags] Verify_BMC_Redfish_Boot_Source_Override_with_Enabled_Mode_As_Continuous
66 [Template] Set And Verify Boot Source Override
67
68 #BootSourceOverrideEnabled BootSourceOverrideTarget BootSourceOverrideMode
69 Continuous Hdd UEFI
70 Continuous Pxe UEFI
71 Continuous Diags UEFI
72 Continuous Cd UEFI
73 Continuous BiosSetup UEFI
Konstantin Aladyshev61d22502021-06-18 15:47:53 +030074 Continuous None UEFI
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +030075 Continuous Hdd Legacy
76 Continuous Pxe Legacy
77 Continuous Diags Legacy
78 Continuous Cd Legacy
79 Continuous BiosSetup Legacy
Konstantin Aladyshev61d22502021-06-18 15:47:53 +030080 Continuous None Legacy
81
82
83Verify BMC Redfish Boot Source Override with Enabled Mode As Disabled
84 [Documentation] Verify BMC Redfish Boot Source Override with Enabled Mode As Disabled.
85 [Tags] Verify_BMC_Redfish_Boot_Source_Override_with_Enabled_Mode_As_Disabled
86 [Template] Set And Verify Boot Source Override
87
88 #BootSourceOverrideEnabled BootSourceOverrideTarget BootSourceOverrideMode
89 Disabled Hdd UEFI
90 Disabled Pxe UEFI
91 Disabled Diags UEFI
92 Disabled Cd UEFI
93 Disabled BiosSetup UEFI
94 Disabled None UEFI
95 Disabled Hdd Legacy
96 Disabled Pxe Legacy
97 Disabled Diags Legacy
98 Disabled Cd Legacy
99 Disabled BiosSetup Legacy
100 Disabled None Legacy
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +0300101
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600102
103*** Keywords ***
104
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +0300105Set And Verify Boot Source Override
106 [Documentation] Set and Verify Boot source override
107 [Arguments] ${override_enabled} ${override_target} ${override_mode}=UEFI
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600108
109 # Description of argument(s):
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +0300110 # override_enabled Boot source override enable type.
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600111 # ('Once', 'Continuous', 'Disabled').
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +0300112 # override_target Boot source override target.
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600113 # ('Pxe', 'Cd', 'Hdd', 'Diags', 'BiosSetup', 'None').
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +0300114 # override_mode Boot source override mode (relevant only for x86 arch).
115 # ('Legacy', 'UEFI').
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600116
117 # Example:
118 # "Boot": {
119 # "BootSourceOverrideEnabled": "Disabled",
120 # "BootSourceOverrideMode": "Legacy",
121 # "BootSourceOverrideTarget": "None",
122 # "BootSourceOverrideTarget@Redfish.AllowableValues": [
123 # "None",
124 # "Pxe",
125 # "Hdd",
126 # "Cd",
127 # "Diags",
128 # "BiosSetup"]}
129
Anusha Dathatri02a0bb32019-04-05 00:50:38 -0500130 # The values set using Redfish are verified via IPMI using the command:
131 # chassis bootparam get 5
132 # Option 5 returns the boot parameters.
133 #
134 # Sample output:
135 # Boot parameter version: 1
136 # Boot parameter 5 is valid/unlocked
137 # Boot parameter data: c000000000
138 # Boot Flags :
139 # - Boot Flag Valid
140 # - Options apply to all future boots
141 # - BIOS PC Compatible (legacy) boot
142 # - Boot Device Selector : No override
143 # - Console Redirection control : System Default
144 # - BIOS verbosity : Console redirection occurs per BIOS configuration
145 # setting (default)
146 # - BIOS Mux Control Override : BIOS uses recommended setting of the mux at
147 # the end of POST
148
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +0300149 Redfish Set Boot Default ${override_enabled} ${override_target} ${override_mode}
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600150
Anusha Dathatri02a0bb32019-04-05 00:50:38 -0500151 ${output}= Run IPMI Standard Command chassis bootparam get 5
152 Should Contain ${output} ${redfish_ipmi_enabled_map['${override_enabled}']}
153 Should Contain ${output} ${redfish_ipmi_target_map['${override_target}']}
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +0300154 Run Keyword If '${PLATFORM_ARCH_TYPE}' == 'x86'
155 ... Should Contain ${output} ${redfish_ipmi_mode_map['${override_mode}']}
156
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600157
158Suite Teardown Execution
159 [Documentation] Do the post suite teardown.
160
George Keishing01644e62019-03-26 04:10:17 -0500161 Redfish.Login
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +0300162 Set And Verify Boot Source Override Disabled None UEFI
George Keishing01644e62019-03-26 04:10:17 -0500163 Redfish.Logout
George Keishingac3b0952019-03-11 06:02:28 -0500164
165
166Test Setup Execution
167 [Documentation] Do test case setup tasks.
168
169 Redfish.Login
170
171
172Test Teardown Execution
173 [Documentation] Do the post test teardown.
174
175 FFDC On Test Case Fail
176 Redfish.Logout