blob: 150db1520169a692e3ed19e0b211f86df54fde41 [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 Setup Pre Test Case Execution
13Test Teardown Post Test Case Execution
George Keishing3ce958c2017-03-27 01:09:02 -050014Suite Teardown Close All Connections
George Keishingec807372016-12-05 03:54:51 -060015
Sivas SRRe1143ae2016-08-26 22:31:02 -050016*** Variables ***
Chris Austenb29d2e82016-06-07 12:25:35 -050017
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050018${stack_mode} skip
19
George Keishingec807372016-12-05 03:54:51 -060020
Chris Austenb29d2e82016-06-07 12:25:35 -050021*** Test Cases ***
22
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050023Set The Boot Source As Default Using REST API
24 [Documentation] Set default boot source via REST and verify with both
25 ... REST and IPMI.
26 [Tags] Set_The_Boot_Source_As_Default_Using_REST_API
Sivas SRRe1143ae2016-08-26 22:31:02 -050027
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050028 Set Boot Source ${BOOT_SOURCE_DEFAULT}
29
30 ${boot_source}=
Rahul Maheshwari3087f342017-09-22 05:22:44 -050031 ... Read Attribute ${CONTROL_HOST_URI}/boot/one_time BootSource
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050032 Should Be Equal As Strings ${boot_source} ${BOOT_SOURCE_DEFAULT}
33
Rahul Maheshwari56d86752017-04-07 14:25:01 -050034 ${output}= Run IPMI Standard Command chassis bootparam get 5
35 Should Contain ${output} No override
Sivas SRRe1143ae2016-08-26 22:31:02 -050036
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050037
38Set The Boot Source As Default Using Ipmitool
39 [Documentation] Set default boot source via IPMI and verify with both
40 ... REST and IPMI.
41 [Tags] Set_The_Boot_Source_As_Default_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -050042
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060043 Run IPMI command 0x0 0x8 0x05 0x80 0x00 0x00 0x00 0x00
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050044
45 ${boot_source}=
Rahul Maheshwari3087f342017-09-22 05:22:44 -050046 ... Read Attribute ${CONTROL_HOST_URI}/boot/one_time BootSource
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050047 Should Be Equal As Strings ${boot_source} ${BOOT_SOURCE_DEFAULT}
48
Rahul Maheshwari56d86752017-04-07 14:25:01 -050049 ${output}= Run IPMI Standard Command chassis bootparam get 5
50 Should Contain ${output} No override
Sivas SRRe1143ae2016-08-26 22:31:02 -050051
Sivas SRRe1143ae2016-08-26 22:31:02 -050052
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050053Set The Boot Source As Network Using REST API
54 [Documentation] Set boot source as Network via REST and verify with both
55 ... REST and IPMI.
56 [Tags] Set_The_Boot_Source_As_Network_Using_REST_API
57
58 Set Boot Source ${BOOT_SOURCE_NETWORK}
59
60 ${boot_source}=
Rahul Maheshwari3087f342017-09-22 05:22:44 -050061 ... Read Attribute ${CONTROL_HOST_URI}/boot/one_time BootSource
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050062 Should Be Equal As Strings ${boot_source} ${BOOT_SOURCE_NETWORK}
63
Rahul Maheshwari56d86752017-04-07 14:25:01 -050064 ${output}= Run IPMI Standard Command chassis bootparam get 5
65 Should Contain ${output} Force PXE
Sivas SRRe1143ae2016-08-26 22:31:02 -050066
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050067
68Set The Boot Source As Network Using Ipmitool
69 [Documentation] Set boot source as Network via IPMI and verify with both
70 ... REST and IPMI.
71 [Tags] Set_The_Boot_Source_As_Network_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -050072
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060073 Run IPMI command 0x0 0x8 0x05 0x80 0x04 0x00 0x00 0x00
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050074
75 ${boot_source}=
Rahul Maheshwari3087f342017-09-22 05:22:44 -050076 ... Read Attribute ${CONTROL_HOST_URI}/boot/one_time BootSource
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050077 Should Be Equal As Strings ${boot_source} ${BOOT_SOURCE_NETWORK}
78
Rahul Maheshwari56d86752017-04-07 14:25:01 -050079 ${output}= Run IPMI Standard Command chassis bootparam get 5
80 Should Contain ${output} Force PXE
Sivas SRRe1143ae2016-08-26 22:31:02 -050081
Sivas SRRe1143ae2016-08-26 22:31:02 -050082
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050083Set The Boot Source As Disk Using REST API
84 [Documentation] Set boot source as Disk via REST and verify with both
85 ... REST and IPMI.
86 [Tags] Set_The_Boot_Source_As_Disk_Using_REST_API
87
88 Set Boot Source ${BOOT_SOURCE_DISK}
89
90 ${boot_source}=
Rahul Maheshwari3087f342017-09-22 05:22:44 -050091 ... Read Attribute ${CONTROL_HOST_URI}/boot/one_time BootSource
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050092 Should Be Equal As Strings ${boot_source} ${BOOT_SOURCE_DISK}
93
Rahul Maheshwari56d86752017-04-07 14:25:01 -050094 ${output}= Run IPMI Standard Command chassis bootparam get 5
95 Should Contain ${output} Force Boot from default Hard-Drive
Sivas SRRe1143ae2016-08-26 22:31:02 -050096
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050097
98Set The Boot Source As Disk Using Ipmitool
99 [Documentation] Set boot source as Disk via IPMI and verify with both
100 ... REST and IPMI.
101 [Tags] Set_The_Boot_Source_As_Disk_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -0500102
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600103 Run IPMI command 0x0 0x8 0x05 0x80 0x08 0x00 0x00 0x00
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500104
105 ${boot_source}=
Rahul Maheshwari3087f342017-09-22 05:22:44 -0500106 ... Read Attribute ${CONTROL_HOST_URI}/boot/one_time BootSource
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500107 Should Be Equal As Strings ${boot_source} ${BOOT_SOURCE_DISK}
108
Rahul Maheshwari56d86752017-04-07 14:25:01 -0500109 ${output}= Run IPMI Standard Command chassis bootparam get 5
110 Should Contain ${output} Force Boot from default Hard-Drive
Sivas SRRe1143ae2016-08-26 22:31:02 -0500111
Sivas SRRe1143ae2016-08-26 22:31:02 -0500112
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500113Set The Boot Mode As Safe Using REST API
114 [Documentation] Set boot mode as Safe via REST and verify with both
115 ... REST and IPMI.
116 [Tags] Set_The_Boot_Mode_As_Safe_Using_REST_API
117
118 Set Boot Mode ${BOOT_MODE_SAFE}
119
Rahul Maheshwari3087f342017-09-22 05:22:44 -0500120 ${boot_mode}= Read Attribute ${CONTROL_HOST_URI}/boot/one_time BootMode
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500121 Should Be Equal As Strings ${boot_mode} ${BOOT_MODE_SAFE}
122
Rahul Maheshwari56d86752017-04-07 14:25:01 -0500123 ${output}= Run IPMI Standard Command chassis bootparam get 5
124 Should Contain ${output} Safe-Mode
Sivas SRRe1143ae2016-08-26 22:31:02 -0500125
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500126
127Set The Boot Mode As Safe Using Ipmitool
128 [Documentation] Set boot mode as Safe via IPMI and verify with both
129 ... REST and IPMI.
130 [Tags] Set_The_Boot_Mode_As_Safe_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -0500131
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600132 Run IPMI command 0x0 0x8 0x05 0x80 0x0C 0x00 0x00 0x00
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500133
Rahul Maheshwari3087f342017-09-22 05:22:44 -0500134 ${boot_mode}= Read Attribute ${CONTROL_HOST_URI}/boot/one_time BootMode
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500135 Should Be Equal As Strings ${boot_mode} ${BOOT_MODE_SAFE}
136
Rahul Maheshwari56d86752017-04-07 14:25:01 -0500137 ${output}= Run IPMI Standard Command chassis bootparam get 5
138 Should Contain ${output} Safe-Mode
Chris Austenb29d2e82016-06-07 12:25:35 -0500139
Sivas SRRe1143ae2016-08-26 22:31:02 -0500140
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500141Set The Boot Source As CDROM Using REST API
142 [Documentation] Set boot source as CDROM via REST and verify with both
143 ... REST and IPMI.
144 [Tags] Set_The_Boot_Source_As_CDROM_Using_REST_API
145
146 Set Boot Source ${BOOT_SOURCE_CDROM}
147
148 ${boot_source}=
Rahul Maheshwari3087f342017-09-22 05:22:44 -0500149 ... Read Attribute ${CONTROL_HOST_URI}/boot/one_time BootSource
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500150 Should Be Equal As Strings ${boot_source} ${BOOT_SOURCE_CDROM}
151
Rahul Maheshwari56d86752017-04-07 14:25:01 -0500152 ${output}= Run IPMI Standard Command chassis bootparam get 5
153 Should Contain ${output} Force Boot from CD/DVD
Sivas SRRe1143ae2016-08-26 22:31:02 -0500154
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500155
156Set The Boot Source As CDROM Using Ipmitool
157 [Documentation] Set boot source as CDROM via IPMI and verify with both
158 ... REST and IPMI.
159 [Tags] Set_The_Boot_Source_As_CDROM_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -0500160
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600161 Run IPMI command 0x0 0x8 0x05 0x80 0x14 0x00 0x00 0x00
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500162
163 ${boot_source}=
Rahul Maheshwari3087f342017-09-22 05:22:44 -0500164 ... Read Attribute ${CONTROL_HOST_URI}/boot/one_time BootSource
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500165 Should Be Equal As Strings ${boot_source} ${BOOT_SOURCE_CDROM}
166
Rahul Maheshwari56d86752017-04-07 14:25:01 -0500167 ${output}= Run IPMI Standard Command chassis bootparam get 5
168 Should Contain ${output} Force Boot from CD/DVD
Sivas SRRe1143ae2016-08-26 22:31:02 -0500169
Sivas SRRe1143ae2016-08-26 22:31:02 -0500170
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500171Set The Boot Mode As Setup Using REST API
172 [Documentation] Set boot mode as Setup via REST and verify with both
173 ... REST and IPMI.
174 [Tags] Set_The_Boot_Mode_As_Setup_Using_REST_API
175
176 Set Boot Mode ${BOOT_MODE_SETUP}
177
Rahul Maheshwari3087f342017-09-22 05:22:44 -0500178 ${boot_mode}= Read Attribute ${CONTROL_HOST_URI}/boot/one_time BootMode
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500179 Should Be Equal As Strings ${boot_mode} ${BOOT_MODE_SETUP}
180
Rahul Maheshwari56d86752017-04-07 14:25:01 -0500181 ${output}= Run IPMI Standard Command chassis bootparam get 5
182 Should Contain ${output} Force Boot into BIOS Setup
Sivas SRRe1143ae2016-08-26 22:31:02 -0500183
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500184
185Set The Boot Mode As Setup Using Ipmitool
186 [Documentation] Set boot mode as Setup via IPMI and verify with both
187 ... REST and IPMI.
188 [Tags] Set_The_Boot_Mode_As_Setup_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -0500189
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600190 Run IPMI command 0x0 0x8 0x05 0x80 0x18 0x00 0x00 0x00
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500191
Rahul Maheshwari3087f342017-09-22 05:22:44 -0500192 ${boot_mode}= Read Attribute ${CONTROL_HOST_URI}/boot/one_time BootMode
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500193 Should Be Equal As Strings ${boot_mode} ${BOOT_MODE_SETUP}
194
Rahul Maheshwari56d86752017-04-07 14:25:01 -0500195 ${output}= Run IPMI Standard Command chassis bootparam get 5
196 Should Contain ${output} Force Boot into BIOS Setup
Chris Austenb29d2e82016-06-07 12:25:35 -0500197
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500198
Chris Austenb29d2e82016-06-07 12:25:35 -0500199*** Keywords ***
200
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500201Set Boot Source
202 [Documentation] Set given boot source.
203 [Arguments] ${boot_source}
204 # Description of argument(s):
205 # boot_source Boot source which need to be set.
206
207 ${valueDict}= Create Dictionary data=${boot_source}
Rahul Maheshwari3087f342017-09-22 05:22:44 -0500208 Write Attribute ${CONTROL_HOST_URI}/boot/one_time BootSource
209 ... data=${valueDict}
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500210
211
212Set Boot Mode
213 [Documentation] Set given boot mode.
214 [Arguments] ${boot_mode}
215 # Description of argument(s):
216 # boot_mode Boot mode which need to be set.
217
218 ${valueDict}= Create Dictionary data=${boot_mode}
Rahul Maheshwari3087f342017-09-22 05:22:44 -0500219 Write Attribute ${CONTROL_HOST_URI}/boot/one_time BootMode
220 ... data=${valueDict}
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500221
222
Chris Austenb29d2e82016-06-07 12:25:35 -0500223Response Should Be Equal
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600224 [Arguments] ${args}
225 Should Be Equal ${OUTPUT} ${args}
Chris Austenb29d2e82016-06-07 12:25:35 -0500226
Sivas SRRe1143ae2016-08-26 22:31:02 -0500227Read the 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
232Pre Test Case Execution
233 [Documentation] Do the pre test setup.
234
235 Open Connection And Log In
236 Initialize DBUS cmd "boot_flags"
237
238Post Test Case Execution
239 [Documentation] Do the post test teardown.
240
241 FFDC On Test Case Fail
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500242 Set Boot Source ${BOOT_SOURCE_DEFAULT}
243 Set Boot Mode ${BOOT_MODE_REGULAR}
Sweta Potthurif93a7462017-03-21 06:38:26 -0500244 Close All Connections
George Keishing3ce958c2017-03-27 01:09:02 -0500245
246Test Suite Setup
247 [Documentation] Do the initial suite setup.
George Keishingf1426682017-07-12 23:17:17 -0500248
Rahul Maheshwari3087f342017-09-22 05:22:44 -0500249 Smart Power Off
250
251 # Set boot policy to default i.e. one time enabled.
252 ${valueDict}= Create Dictionary data=${1}
253 Write Attribute ${CONTROL_HOST_URI}/boot/one_time Enabled
254 ... data=${valueDict}