blob: 9811532680ad3cfeaa669610798c3cffd00cbe53 [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}=
Rahul Maheshwari3087f342017-09-22 05:22:44 -050029 ... 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}=
Rahul Maheshwari3087f342017-09-22 05:22:44 -050044 ... 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}=
Rahul Maheshwari3087f342017-09-22 05:22:44 -050059 ... 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}=
Rahul Maheshwari3087f342017-09-22 05:22:44 -050074 ... 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}=
Rahul Maheshwari3087f342017-09-22 05:22:44 -050089 ... 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}=
Rahul Maheshwari3087f342017-09-22 05:22:44 -0500104 ... 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
Rahul Maheshwari3087f342017-09-22 05:22:44 -0500118 ${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
Rahul Maheshwari3087f342017-09-22 05:22:44 -0500132 ${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}=
Rahul Maheshwari3087f342017-09-22 05:22:44 -0500147 ... 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}=
Rahul Maheshwari3087f342017-09-22 05:22:44 -0500162 ... 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
Rahul Maheshwari3087f342017-09-22 05:22:44 -0500176 ${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
Rahul Maheshwari3087f342017-09-22 05:22:44 -0500190 ${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
Chris Austenb29d2e82016-06-07 12:25:35 -0500197*** Keywords ***
198
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500199Set Boot Source
200 [Documentation] Set given boot source.
201 [Arguments] ${boot_source}
202 # Description of argument(s):
203 # boot_source Boot source which need to be set.
204
205 ${valueDict}= Create Dictionary data=${boot_source}
Rahul Maheshwari3087f342017-09-22 05:22:44 -0500206 Write Attribute ${CONTROL_HOST_URI}/boot/one_time BootSource
207 ... data=${valueDict}
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500208
209
210Set Boot Mode
211 [Documentation] Set given boot mode.
212 [Arguments] ${boot_mode}
213 # Description of argument(s):
214 # boot_mode Boot mode which need to be set.
215
216 ${valueDict}= Create Dictionary data=${boot_mode}
Rahul Maheshwari3087f342017-09-22 05:22:44 -0500217 Write Attribute ${CONTROL_HOST_URI}/boot/one_time BootMode
218 ... data=${valueDict}
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500219
220
Chris Austenb29d2e82016-06-07 12:25:35 -0500221Response Should Be Equal
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500222 [Documentation] Verify that the output is equal to the given args.
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600223 [Arguments] ${args}
224 Should Be Equal ${OUTPUT} ${args}
Chris Austenb29d2e82016-06-07 12:25:35 -0500225
Sivas SRRe1143ae2016-08-26 22:31:02 -0500226Read the Attribute
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500227 [Documentation] Read the given attribute.
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600228 [Arguments] ${uri} ${parm}
229 ${output}= Read Attribute ${uri} ${parm}
230 Set Test Variable ${OUTPUT} ${output}
Sweta Potthurif93a7462017-03-21 06:38:26 -0500231
Sweta Potthurif93a7462017-03-21 06:38:26 -0500232Post Test Case Execution
233 [Documentation] Do the post test teardown.
234
235 FFDC On Test Case Fail
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500236 Set Boot Source ${BOOT_SOURCE_DEFAULT}
237 Set Boot Mode ${BOOT_MODE_REGULAR}
George Keishing3ce958c2017-03-27 01:09:02 -0500238
239Test Suite Setup
240 [Documentation] Do the initial suite setup.
George Keishingf1426682017-07-12 23:17:17 -0500241
Rahul Maheshwari3087f342017-09-22 05:22:44 -0500242 Smart Power Off
243
244 # Set boot policy to default i.e. one time enabled.
245 ${valueDict}= Create Dictionary data=${1}
246 Write Attribute ${CONTROL_HOST_URI}/boot/one_time Enabled
247 ... data=${valueDict}