blob: 215f43c3f8519c396fd32f71e413b7539764d31b [file] [log] [blame]
Chris Austenb29d2e82016-06-07 12:25:35 -05001*** Settings ***
2
3Documentation This testsuite is for testing the Boot Device Functions
4
Sivas SRRe1143ae2016-08-26 22:31:02 -05005Resource ../lib/rest_client.robot
6Resource ../lib/ipmi_client.robot
7Resource ../lib/openbmc_ffdc.robot
George Keishingddc605f2016-09-15 00:46:32 -05008Resource ../lib/utils.robot
Sweta Potthuriaf741cb2017-07-04 09:41:17 -05009Resource ../lib/boot_utils.robot
Chris Austenb29d2e82016-06-07 12:25:35 -050010
George Keishing3ce958c2017-03-27 01:09:02 -050011Suite Setup Test Suite Setup
Sweta Potthurif93a7462017-03-21 06:38:26 -050012Test Teardown Post Test Case Execution
George Keishingec807372016-12-05 03:54:51 -060013
Sivas SRRe1143ae2016-08-26 22:31:02 -050014*** Variables ***
Chris Austenb29d2e82016-06-07 12:25:35 -050015
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050016${stack_mode} skip
17
George Keishingec807372016-12-05 03:54:51 -060018
Chris Austenb29d2e82016-06-07 12:25:35 -050019*** Test Cases ***
20
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050021Set The Boot Source As Default Using REST API
22 [Documentation] Set default boot source via REST and verify with both
23 ... REST and IPMI.
24 [Tags] Set_The_Boot_Source_As_Default_Using_REST_API
Sivas SRRe1143ae2016-08-26 22:31:02 -050025
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050026 Set Boot Source ${BOOT_SOURCE_DEFAULT}
27
28 ${boot_source}=
George Keishingdf3e65f2018-12-18 13:06:56 -060029 ... Read Attribute ${CONTROL_HOST_URI}boot/one_time BootSource
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050030 Should Be Equal As Strings ${boot_source} ${BOOT_SOURCE_DEFAULT}
31
Rahul Maheshwari56d86752017-04-07 14:25:01 -050032 ${output}= Run IPMI Standard Command chassis bootparam get 5
33 Should Contain ${output} No override
Sivas SRRe1143ae2016-08-26 22:31:02 -050034
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050035
36Set The Boot Source As Default Using Ipmitool
37 [Documentation] Set default boot source via IPMI and verify with both
38 ... REST and IPMI.
39 [Tags] Set_The_Boot_Source_As_Default_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -050040
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060041 Run IPMI command 0x0 0x8 0x05 0x80 0x00 0x00 0x00 0x00
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050042
43 ${boot_source}=
George Keishingdf3e65f2018-12-18 13:06:56 -060044 ... Read Attribute ${CONTROL_HOST_URI}boot/one_time BootSource
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050045 Should Be Equal As Strings ${boot_source} ${BOOT_SOURCE_DEFAULT}
46
Rahul Maheshwari56d86752017-04-07 14:25:01 -050047 ${output}= Run IPMI Standard Command chassis bootparam get 5
48 Should Contain ${output} No override
Sivas SRRe1143ae2016-08-26 22:31:02 -050049
Sivas SRRe1143ae2016-08-26 22:31:02 -050050
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050051Set The Boot Source As Network Using REST API
52 [Documentation] Set boot source as Network via REST and verify with both
53 ... REST and IPMI.
54 [Tags] Set_The_Boot_Source_As_Network_Using_REST_API
55
56 Set Boot Source ${BOOT_SOURCE_NETWORK}
57
58 ${boot_source}=
George Keishingdf3e65f2018-12-18 13:06:56 -060059 ... Read Attribute ${CONTROL_HOST_URI}boot/one_time BootSource
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050060 Should Be Equal As Strings ${boot_source} ${BOOT_SOURCE_NETWORK}
61
Rahul Maheshwari56d86752017-04-07 14:25:01 -050062 ${output}= Run IPMI Standard Command chassis bootparam get 5
63 Should Contain ${output} Force PXE
Sivas SRRe1143ae2016-08-26 22:31:02 -050064
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050065
66Set The Boot Source As Network Using Ipmitool
67 [Documentation] Set boot source as Network via IPMI and verify with both
68 ... REST and IPMI.
69 [Tags] Set_The_Boot_Source_As_Network_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -050070
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060071 Run IPMI command 0x0 0x8 0x05 0x80 0x04 0x00 0x00 0x00
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050072
73 ${boot_source}=
George Keishingdf3e65f2018-12-18 13:06:56 -060074 ... Read Attribute ${CONTROL_HOST_URI}boot/one_time BootSource
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050075 Should Be Equal As Strings ${boot_source} ${BOOT_SOURCE_NETWORK}
76
Rahul Maheshwari56d86752017-04-07 14:25:01 -050077 ${output}= Run IPMI Standard Command chassis bootparam get 5
78 Should Contain ${output} Force PXE
Sivas SRRe1143ae2016-08-26 22:31:02 -050079
Sivas SRRe1143ae2016-08-26 22:31:02 -050080
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050081Set The Boot Source As Disk Using REST API
82 [Documentation] Set boot source as Disk via REST and verify with both
83 ... REST and IPMI.
84 [Tags] Set_The_Boot_Source_As_Disk_Using_REST_API
85
86 Set Boot Source ${BOOT_SOURCE_DISK}
87
88 ${boot_source}=
George Keishingdf3e65f2018-12-18 13:06:56 -060089 ... Read Attribute ${CONTROL_HOST_URI}boot/one_time BootSource
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050090 Should Be Equal As Strings ${boot_source} ${BOOT_SOURCE_DISK}
91
Rahul Maheshwari56d86752017-04-07 14:25:01 -050092 ${output}= Run IPMI Standard Command chassis bootparam get 5
93 Should Contain ${output} Force Boot from default Hard-Drive
Sivas SRRe1143ae2016-08-26 22:31:02 -050094
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050095
96Set The Boot Source As Disk Using Ipmitool
97 [Documentation] Set boot source as Disk via IPMI and verify with both
98 ... REST and IPMI.
99 [Tags] Set_The_Boot_Source_As_Disk_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -0500100
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600101 Run IPMI command 0x0 0x8 0x05 0x80 0x08 0x00 0x00 0x00
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500102
103 ${boot_source}=
George Keishingdf3e65f2018-12-18 13:06:56 -0600104 ... Read Attribute ${CONTROL_HOST_URI}boot/one_time BootSource
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500105 Should Be Equal As Strings ${boot_source} ${BOOT_SOURCE_DISK}
106
Rahul Maheshwari56d86752017-04-07 14:25:01 -0500107 ${output}= Run IPMI Standard Command chassis bootparam get 5
108 Should Contain ${output} Force Boot from default Hard-Drive
Sivas SRRe1143ae2016-08-26 22:31:02 -0500109
Sivas SRRe1143ae2016-08-26 22:31:02 -0500110
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500111Set The Boot Mode As Safe Using REST API
112 [Documentation] Set boot mode as Safe via REST and verify with both
113 ... REST and IPMI.
114 [Tags] Set_The_Boot_Mode_As_Safe_Using_REST_API
115
116 Set Boot Mode ${BOOT_MODE_SAFE}
117
George Keishingdf3e65f2018-12-18 13:06:56 -0600118 ${boot_mode}= Read Attribute ${CONTROL_HOST_URI}boot/one_time BootMode
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500119 Should Be Equal As Strings ${boot_mode} ${BOOT_MODE_SAFE}
120
Rahul Maheshwari56d86752017-04-07 14:25:01 -0500121 ${output}= Run IPMI Standard Command chassis bootparam get 5
122 Should Contain ${output} Safe-Mode
Sivas SRRe1143ae2016-08-26 22:31:02 -0500123
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500124
125Set The Boot Mode As Safe Using Ipmitool
126 [Documentation] Set boot mode as Safe via IPMI and verify with both
127 ... REST and IPMI.
128 [Tags] Set_The_Boot_Mode_As_Safe_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -0500129
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600130 Run IPMI command 0x0 0x8 0x05 0x80 0x0C 0x00 0x00 0x00
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500131
George Keishingdf3e65f2018-12-18 13:06:56 -0600132 ${boot_mode}= Read Attribute ${CONTROL_HOST_URI}boot/one_time BootMode
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500133 Should Be Equal As Strings ${boot_mode} ${BOOT_MODE_SAFE}
134
Rahul Maheshwari56d86752017-04-07 14:25:01 -0500135 ${output}= Run IPMI Standard Command chassis bootparam get 5
136 Should Contain ${output} Safe-Mode
Chris Austenb29d2e82016-06-07 12:25:35 -0500137
Sivas SRRe1143ae2016-08-26 22:31:02 -0500138
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500139Set The Boot Source As CDROM Using REST API
140 [Documentation] Set boot source as CDROM via REST and verify with both
141 ... REST and IPMI.
142 [Tags] Set_The_Boot_Source_As_CDROM_Using_REST_API
143
144 Set Boot Source ${BOOT_SOURCE_CDROM}
145
146 ${boot_source}=
George Keishingdf3e65f2018-12-18 13:06:56 -0600147 ... Read Attribute ${CONTROL_HOST_URI}boot/one_time BootSource
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500148 Should Be Equal As Strings ${boot_source} ${BOOT_SOURCE_CDROM}
149
Rahul Maheshwari56d86752017-04-07 14:25:01 -0500150 ${output}= Run IPMI Standard Command chassis bootparam get 5
151 Should Contain ${output} Force Boot from CD/DVD
Sivas SRRe1143ae2016-08-26 22:31:02 -0500152
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500153
154Set The Boot Source As CDROM Using Ipmitool
155 [Documentation] Set boot source as CDROM via IPMI and verify with both
156 ... REST and IPMI.
157 [Tags] Set_The_Boot_Source_As_CDROM_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -0500158
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600159 Run IPMI command 0x0 0x8 0x05 0x80 0x14 0x00 0x00 0x00
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500160
161 ${boot_source}=
George Keishingdf3e65f2018-12-18 13:06:56 -0600162 ... Read Attribute ${CONTROL_HOST_URI}boot/one_time BootSource
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500163 Should Be Equal As Strings ${boot_source} ${BOOT_SOURCE_CDROM}
164
Rahul Maheshwari56d86752017-04-07 14:25:01 -0500165 ${output}= Run IPMI Standard Command chassis bootparam get 5
166 Should Contain ${output} Force Boot from CD/DVD
Sivas SRRe1143ae2016-08-26 22:31:02 -0500167
Sivas SRRe1143ae2016-08-26 22:31:02 -0500168
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500169Set The Boot Mode As Setup Using REST API
170 [Documentation] Set boot mode as Setup via REST and verify with both
171 ... REST and IPMI.
172 [Tags] Set_The_Boot_Mode_As_Setup_Using_REST_API
173
174 Set Boot Mode ${BOOT_MODE_SETUP}
175
George Keishingdf3e65f2018-12-18 13:06:56 -0600176 ${boot_mode}= Read Attribute ${CONTROL_HOST_URI}boot/one_time BootMode
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500177 Should Be Equal As Strings ${boot_mode} ${BOOT_MODE_SETUP}
178
Rahul Maheshwari56d86752017-04-07 14:25:01 -0500179 ${output}= Run IPMI Standard Command chassis bootparam get 5
180 Should Contain ${output} Force Boot into BIOS Setup
Sivas SRRe1143ae2016-08-26 22:31:02 -0500181
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500182
183Set The Boot Mode As Setup Using Ipmitool
184 [Documentation] Set boot mode as Setup via IPMI and verify with both
185 ... REST and IPMI.
186 [Tags] Set_The_Boot_Mode_As_Setup_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -0500187
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600188 Run IPMI command 0x0 0x8 0x05 0x80 0x18 0x00 0x00 0x00
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500189
George Keishingdf3e65f2018-12-18 13:06:56 -0600190 ${boot_mode}= Read Attribute ${CONTROL_HOST_URI}boot/one_time BootMode
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500191 Should Be Equal As Strings ${boot_mode} ${BOOT_MODE_SETUP}
192
Rahul Maheshwari56d86752017-04-07 14:25:01 -0500193 ${output}= Run IPMI Standard Command chassis bootparam get 5
194 Should Contain ${output} Force Boot into BIOS Setup
Chris Austenb29d2e82016-06-07 12:25:35 -0500195
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500196
Konstantin Aladysheve2016fa2021-04-14 12:53:32 +0300197Set The Boot Type As Legacy Using REST API
198 [Documentation] Set boot type as Legacy via REST and verify with both
199 ... REST and IPMI.
200 [Tags] Set_The_Boot_Type_As_Legacy_Using_REST_API
201
202 Set Boot Type ${BOOT_TYPE_LEGACY}
203
204 ${boot_type}= Read Attribute ${CONTROL_HOST_URI}boot/one_time BootType
205 Should Be Equal As Strings ${boot_type} ${BOOT_TYPE_LEGACY}
206
207 ${output}= Run IPMI Standard Command chassis bootparam get 5
208 Should Contain ${output} BIOS PC Compatible (legacy) boot
209
210
211Set The Boot Type As Legacy Using Ipmitool
212 [Documentation] Set boot type as Legacy via IPMI and verify with both
213 ... REST and IPMI.
214 [Tags] Set_The_Boot_Type_As_Legacy_Using_Ipmitool
215
216 Run IPMI command 0x0 0x8 0x05 0x80 0x00 0x00 0x00 0x00
217
218 ${boot_type}= Read Attribute ${CONTROL_HOST_URI}boot/one_time BootType
219 Should Be Equal As Strings ${boot_type} ${BOOT_TYPE_LEGACY}
220
221 ${output}= Run IPMI Standard Command chassis bootparam get 5
222 Should Contain ${output} BIOS PC Compatible (legacy) boot
223
224
225Set The Boot Type As EFI Using REST API
226 [Documentation] Set boot type as EFI via REST and verify with both
227 ... REST and IPMI.
228 [Tags] Set_The_Boot_Type_As_EFI_Using_REST_API
229
230 Set Boot Type ${BOOT_TYPE_EFI}
231
232 ${boot_type}= Read Attribute ${CONTROL_HOST_URI}boot/one_time BootType
233 Should Be Equal As Strings ${boot_type} ${BOOT_TYPE_EFI}
234
235 ${output}= Run IPMI Standard Command chassis bootparam get 5
236 Should Contain ${output} BIOS EFI boot
237
238
239Set The Boot Type As EFI Using Ipmitool
240 [Documentation] Set boot type as EFI via IPMI and verify with both
241 ... REST and IPMI.
242 [Tags] Set_The_Boot_Type_As_EFI_Using_Ipmitool
243
244 Run IPMI command 0x0 0x8 0x05 0xA0 0x00 0x00 0x00 0x00
245
246 ${boot_type}= Read Attribute ${CONTROL_HOST_URI}boot/one_time BootType
247 Should Be Equal As Strings ${boot_type} ${BOOT_TYPE_EFI}
248
249 ${output}= Run IPMI Standard Command chassis bootparam get 5
250 Should Contain ${output} BIOS EFI boot
251
252
Chris Austenb29d2e82016-06-07 12:25:35 -0500253*** Keywords ***
254
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500255Set Boot Source
256 [Documentation] Set given boot source.
257 [Arguments] ${boot_source}
258 # Description of argument(s):
259 # boot_source Boot source which need to be set.
260
261 ${valueDict}= Create Dictionary data=${boot_source}
George Keishingdf3e65f2018-12-18 13:06:56 -0600262 Write Attribute ${CONTROL_HOST_URI}boot/one_time BootSource
Rahul Maheshwari3087f342017-09-22 05:22:44 -0500263 ... data=${valueDict}
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500264
265
266Set Boot Mode
267 [Documentation] Set given boot mode.
268 [Arguments] ${boot_mode}
269 # Description of argument(s):
270 # boot_mode Boot mode which need to be set.
271
272 ${valueDict}= Create Dictionary data=${boot_mode}
George Keishingdf3e65f2018-12-18 13:06:56 -0600273 Write Attribute ${CONTROL_HOST_URI}boot/one_time BootMode
Rahul Maheshwari3087f342017-09-22 05:22:44 -0500274 ... data=${valueDict}
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500275
276
Konstantin Aladysheve2016fa2021-04-14 12:53:32 +0300277Set Boot Type
278 [Documentation] Set given boot type.
279 [Arguments] ${boot_type}
280 # Description of argument(s):
281 # boot_type Boot type which need to be set.
282
283 ${valueDict}= Create Dictionary data=${boot_type}
284 Write Attribute ${CONTROL_HOST_URI}boot/one_time BootType
285 ... data=${valueDict}
286
287
Chris Austenb29d2e82016-06-07 12:25:35 -0500288Response Should Be Equal
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500289 [Documentation] Verify that the output is equal to the given args.
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600290 [Arguments] ${args}
291 Should Be Equal ${OUTPUT} ${args}
Chris Austenb29d2e82016-06-07 12:25:35 -0500292
Sivas SRRe1143ae2016-08-26 22:31:02 -0500293Read the Attribute
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500294 [Documentation] Read the given attribute.
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600295 [Arguments] ${uri} ${parm}
296 ${output}= Read Attribute ${uri} ${parm}
297 Set Test Variable ${OUTPUT} ${output}
Sweta Potthurif93a7462017-03-21 06:38:26 -0500298
Sweta Potthurif93a7462017-03-21 06:38:26 -0500299Post Test Case Execution
300 [Documentation] Do the post test teardown.
301
302 FFDC On Test Case Fail
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500303 Set Boot Source ${BOOT_SOURCE_DEFAULT}
304 Set Boot Mode ${BOOT_MODE_REGULAR}
George Keishing3ce958c2017-03-27 01:09:02 -0500305
306Test Suite Setup
307 [Documentation] Do the initial suite setup.
George Keishingf1426682017-07-12 23:17:17 -0500308
Rahul Maheshwari3087f342017-09-22 05:22:44 -0500309 Smart Power Off
310
311 # Set boot policy to default i.e. one time enabled.
312 ${valueDict}= Create Dictionary data=${1}
George Keishingdf3e65f2018-12-18 13:06:56 -0600313 Write Attribute ${CONTROL_HOST_URI}boot/one_time Enabled
Rahul Maheshwari3087f342017-09-22 05:22:44 -0500314 ... data=${valueDict}