blob: 67c194559c02c5e39ed1b71e51d81138f20c6eb3 [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}=
31 ... Read Attribute ${CONTROL_HOST_URI}/boot_source BootSource
32 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}=
46 ... Read Attribute ${CONTROL_HOST_URI}/boot_source BootSource
47 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}=
61 ... Read Attribute ${CONTROL_HOST_URI}/boot_source BootSource
62 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}=
76 ... Read Attribute ${CONTROL_HOST_URI}/boot_source BootSource
77 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}=
91 ... Read Attribute ${CONTROL_HOST_URI}/boot_source BootSource
92 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}=
106 ... Read Attribute ${CONTROL_HOST_URI}/boot_source BootSource
107 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
120 ${boot_mode}= Read Attribute ${CONTROL_HOST_URI}/boot_mode BootMode
121 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
134 ${boot_mode}= Read Attribute ${CONTROL_HOST_URI}/boot_mode BootMode
135 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}=
149 ... Read Attribute ${CONTROL_HOST_URI}/boot_source BootSource
150 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}=
164 ... Read Attribute ${CONTROL_HOST_URI}/boot_source BootSource
165 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
178 ${boot_mode}= Read Attribute ${CONTROL_HOST_URI}/boot_mode BootMode
179 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
192 ${boot_mode}= Read Attribute ${CONTROL_HOST_URI}/boot_mode BootMode
193 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}
208 Write Attribute ${CONTROL_HOST_URI}/boot_source BootSource data=${valueDict}
209
210
211Set Boot Mode
212 [Documentation] Set given boot mode.
213 [Arguments] ${boot_mode}
214 # Description of argument(s):
215 # boot_mode Boot mode which need to be set.
216
217 ${valueDict}= Create Dictionary data=${boot_mode}
218 Write Attribute ${CONTROL_HOST_URI}/boot_mode BootMode data=${valueDict}
219
220
Chris Austenb29d2e82016-06-07 12:25:35 -0500221Response Should Be Equal
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600222 [Arguments] ${args}
223 Should Be Equal ${OUTPUT} ${args}
Chris Austenb29d2e82016-06-07 12:25:35 -0500224
Sivas SRRe1143ae2016-08-26 22:31:02 -0500225Read the Attribute
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600226 [Arguments] ${uri} ${parm}
227 ${output}= Read Attribute ${uri} ${parm}
228 Set Test Variable ${OUTPUT} ${output}
Sweta Potthurif93a7462017-03-21 06:38:26 -0500229
230Pre Test Case Execution
231 [Documentation] Do the pre test setup.
232
233 Open Connection And Log In
234 Initialize DBUS cmd "boot_flags"
235
236Post Test Case Execution
237 [Documentation] Do the post test teardown.
238
239 FFDC On Test Case Fail
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500240 Set Boot Source ${BOOT_SOURCE_DEFAULT}
241 Set Boot Mode ${BOOT_MODE_REGULAR}
Sweta Potthurif93a7462017-03-21 06:38:26 -0500242 Close All Connections
George Keishing3ce958c2017-03-27 01:09:02 -0500243
244Test Suite Setup
245 [Documentation] Do the initial suite setup.
George Keishingf1426682017-07-12 23:17:17 -0500246
Sweta Potthuriaf741cb2017-07-04 09:41:17 -0500247 # Boot Host.
248 REST Power On