blob: c43b30923ab57413872e964b0aeefd0564e49b55 [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
Konstantin Aladyshev61d22502021-06-18 15:47:53 +030023... Disabled=Boot Flag Invalid
Anusha Dathatri02a0bb32019-04-05 00:50:38 -050024
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
Konstantin Aladyshev61d22502021-06-18 15:47:53 +030052 Once None UEFI
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +030053 Once Hdd Legacy
54 Once Pxe Legacy
55 Once Diags Legacy
56 Once Cd Legacy
57 Once BiosSetup Legacy
Konstantin Aladyshev61d22502021-06-18 15:47:53 +030058 Once None Legacy
Sridevi Ramesh484e10c2019-02-28 06:14:46 -060059
Sridevi Ramesh484e10c2019-02-28 06:14:46 -060060
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +030061Verify BMC Redfish Boot Source Override with Enabled Mode As Continuous
62 [Documentation] Verify BMC Redfish Boot Source Override with Enabled Mode As Continuous.
63 [Tags] Verify_BMC_Redfish_Boot_Source_Override_with_Enabled_Mode_As_Continuous
64 [Template] Set And Verify Boot Source Override
65
66 #BootSourceOverrideEnabled BootSourceOverrideTarget BootSourceOverrideMode
67 Continuous Hdd UEFI
68 Continuous Pxe UEFI
69 Continuous Diags UEFI
70 Continuous Cd UEFI
71 Continuous BiosSetup UEFI
Konstantin Aladyshev61d22502021-06-18 15:47:53 +030072 Continuous None UEFI
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +030073 Continuous Hdd Legacy
74 Continuous Pxe Legacy
75 Continuous Diags Legacy
76 Continuous Cd Legacy
77 Continuous BiosSetup Legacy
Konstantin Aladyshev61d22502021-06-18 15:47:53 +030078 Continuous None Legacy
79
80
81Verify BMC Redfish Boot Source Override with Enabled Mode As Disabled
82 [Documentation] Verify BMC Redfish Boot Source Override with Enabled Mode As Disabled.
83 [Tags] Verify_BMC_Redfish_Boot_Source_Override_with_Enabled_Mode_As_Disabled
84 [Template] Set And Verify Boot Source Override
85
86 #BootSourceOverrideEnabled BootSourceOverrideTarget BootSourceOverrideMode
87 Disabled Hdd UEFI
88 Disabled Pxe UEFI
89 Disabled Diags UEFI
90 Disabled Cd UEFI
91 Disabled BiosSetup UEFI
92 Disabled None UEFI
93 Disabled Hdd Legacy
94 Disabled Pxe Legacy
95 Disabled Diags Legacy
96 Disabled Cd Legacy
97 Disabled BiosSetup Legacy
98 Disabled None Legacy
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +030099
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600100
101*** Keywords ***
102
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +0300103Set And Verify Boot Source Override
104 [Documentation] Set and Verify Boot source override
105 [Arguments] ${override_enabled} ${override_target} ${override_mode}=UEFI
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600106
107 # Description of argument(s):
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +0300108 # override_enabled Boot source override enable type.
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600109 # ('Once', 'Continuous', 'Disabled').
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +0300110 # override_target Boot source override target.
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600111 # ('Pxe', 'Cd', 'Hdd', 'Diags', 'BiosSetup', 'None').
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +0300112 # override_mode Boot source override mode (relevant only for x86 arch).
113 # ('Legacy', 'UEFI').
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600114
115 # Example:
116 # "Boot": {
117 # "BootSourceOverrideEnabled": "Disabled",
118 # "BootSourceOverrideMode": "Legacy",
119 # "BootSourceOverrideTarget": "None",
120 # "BootSourceOverrideTarget@Redfish.AllowableValues": [
121 # "None",
122 # "Pxe",
123 # "Hdd",
124 # "Cd",
125 # "Diags",
126 # "BiosSetup"]}
127
Anusha Dathatri02a0bb32019-04-05 00:50:38 -0500128 # The values set using Redfish are verified via IPMI using the command:
129 # chassis bootparam get 5
130 # Option 5 returns the boot parameters.
131 #
132 # Sample output:
133 # Boot parameter version: 1
134 # Boot parameter 5 is valid/unlocked
135 # Boot parameter data: c000000000
136 # Boot Flags :
137 # - Boot Flag Valid
138 # - Options apply to all future boots
139 # - BIOS PC Compatible (legacy) boot
140 # - Boot Device Selector : No override
141 # - Console Redirection control : System Default
142 # - BIOS verbosity : Console redirection occurs per BIOS configuration
143 # setting (default)
144 # - BIOS Mux Control Override : BIOS uses recommended setting of the mux at
145 # the end of POST
146
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +0300147 Redfish Set Boot Default ${override_enabled} ${override_target} ${override_mode}
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600148
Anusha Dathatri02a0bb32019-04-05 00:50:38 -0500149 ${output}= Run IPMI Standard Command chassis bootparam get 5
150 Should Contain ${output} ${redfish_ipmi_enabled_map['${override_enabled}']}
151 Should Contain ${output} ${redfish_ipmi_target_map['${override_target}']}
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +0300152 Run Keyword If '${PLATFORM_ARCH_TYPE}' == 'x86'
153 ... Should Contain ${output} ${redfish_ipmi_mode_map['${override_mode}']}
154
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600155
156Suite Teardown Execution
157 [Documentation] Do the post suite teardown.
158
George Keishing01644e62019-03-26 04:10:17 -0500159 Redfish.Login
Konstantin Aladyshev0043fc52021-04-15 12:07:29 +0300160 Set And Verify Boot Source Override Disabled None UEFI
George Keishing01644e62019-03-26 04:10:17 -0500161 Redfish.Logout
George Keishingac3b0952019-03-11 06:02:28 -0500162
163
164Test Setup Execution
165 [Documentation] Do test case setup tasks.
166
167 Redfish.Login
168
169
170Test Teardown Execution
171 [Documentation] Do the post test teardown.
172
173 FFDC On Test Case Fail
174 Redfish.Logout