blob: bbe203fe498974c1e7fb854e93c68634b3765df7 [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
Sweta Potthuriaf741cb2017-07-04 09:41:17 -050018${stack_mode} skip
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060019${HOST_SETTINGS} ${SETTINGS_URI}host0
George Keishingec807372016-12-05 03:54:51 -060020
Chris Austenb29d2e82016-06-07 12:25:35 -050021*** Test Cases ***
22
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060023Set The Boot Device As Default Using REST API
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060024 [Documentation] This testcase is to set the boot device as default using REST
25 ... URI. The Boot device is read using REST API and ipmitool.
26 [Tags] Set_The_Boot_Device_As_Default_Using_REST_API
Sivas SRRe1143ae2016-08-26 22:31:02 -050027
Rahul Maheshwari28087e92017-04-07 07:12:49 -050028 ${bootDevice}= Set Variable Default
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060029 ${valueDict}= Create Dictionary data=${bootDevice}
30 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
31 Read the Attribute ${HOST_SETTINGS} boot_flags
Rahul Maheshwari28087e92017-04-07 07:12:49 -050032 Response Should Be Equal Default
Rahul Maheshwari56d86752017-04-07 14:25:01 -050033 ${output}= Run IPMI Standard Command chassis bootparam get 5
34 Should Contain ${output} No override
Sivas SRRe1143ae2016-08-26 22:31:02 -050035
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060036Set The Boot Device As Default Using Ipmitool
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060037 [Documentation] This testcase is to set the boot device as default using
38 ... ipmitool. The Boot device is read using REST API and
39 ... ipmitool.
40 [Tags] Set_The_Boot_Device_As_Default_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -050041
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060042 Run IPMI command 0x0 0x8 0x05 0x80 0x00 0x00 0x00 0x00
43 Read the Attribute ${HOST_SETTINGS} boot_flags
Rahul Maheshwari28087e92017-04-07 07:12:49 -050044 Response Should Be Equal Default
Rahul Maheshwari56d86752017-04-07 14:25:01 -050045 ${output}= Run IPMI Standard Command chassis bootparam get 5
46 Should Contain ${output} No override
Sivas SRRe1143ae2016-08-26 22:31:02 -050047
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060048Set The Boot Device As Network Using REST API
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060049 [Documentation] This testcase is to set the boot device as Network using REST
50 ... URI. The Boot device is read using REST API and ipmitool.
51 [Tags] Set_The_Boot_Device_As_Network_Using_REST_API
Sivas SRRe1143ae2016-08-26 22:31:02 -050052
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060053 ${bootDevice}= Set Variable Network
54 ${valueDict}= Create Dictionary data=${bootDevice}
55 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
56 Read the Attribute ${HOST_SETTINGS} boot_flags
57 Response Should Be Equal Network
Rahul Maheshwari56d86752017-04-07 14:25:01 -050058 ${output}= Run IPMI Standard Command chassis bootparam get 5
59 Should Contain ${output} Force PXE
Sivas SRRe1143ae2016-08-26 22:31:02 -050060
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060061Set The Boot Device As Network Using Ipmitool
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060062 [Documentation] This testcase is to set the boot device as Network using
63 ... ipmitool. The Boot device is read using REST API and
64 ... ipmitool.
65 [Tags] Set_The_Boot_Device_As_Network_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -050066
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060067 Run IPMI command 0x0 0x8 0x05 0x80 0x04 0x00 0x00 0x00
68 Read the Attribute ${HOST_SETTINGS} boot_flags
69 Response Should Be Equal Network
Rahul Maheshwari56d86752017-04-07 14:25:01 -050070 ${output}= Run IPMI Standard Command chassis bootparam get 5
71 Should Contain ${output} Force PXE
Sivas SRRe1143ae2016-08-26 22:31:02 -050072
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060073Set The Boot Device As Disk Using REST API
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060074 [Documentation] This testcase is to set the boot device as Disk using REST
75 ... URI. The Boot device is read using REST API and ipmitool.
76 [Tags] Set_The_Boot_Device_As_Disk_Using_REST_API
Sivas SRRe1143ae2016-08-26 22:31:02 -050077
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060078 ${bootDevice}= Set Variable Disk
79 ${valueDict}= Create Dictionary data=${bootDevice}
80 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
George Keishingec807372016-12-05 03:54:51 -060081 Read the Attribute ${HOST_SETTINGS} boot_flags
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060082 Response Should Be Equal Disk
Rahul Maheshwari56d86752017-04-07 14:25:01 -050083 ${output}= Run IPMI Standard Command chassis bootparam get 5
84 Should Contain ${output} Force Boot from default Hard-Drive
Sivas SRRe1143ae2016-08-26 22:31:02 -050085
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060086Set The Boot Device As Disk Using Ipmitool
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060087 [Documentation] This testcase is to set the boot device as Disk using
88 ... ipmitool. The Boot device is read using REST API and
89 ... ipmitool.
90 [Tags] Set_The_Boot_Device_As_Disk_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -050091
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060092 Run IPMI command 0x0 0x8 0x05 0x80 0x08 0x00 0x00 0x00
93 Read the Attribute ${HOST_SETTINGS} boot_flags
94 Response Should Be Equal Disk
Rahul Maheshwari56d86752017-04-07 14:25:01 -050095 ${output}= Run IPMI Standard Command chassis bootparam get 5
96 Should Contain ${output} Force Boot from default Hard-Drive
Sivas SRRe1143ae2016-08-26 22:31:02 -050097
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060098Set The Boot Device As Safe Using REST API
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060099 [Documentation] This testcase is to set the boot device as Safe using REST
100 ... URI. The Boot device is read using REST API and ipmitool.
101 [Tags] Set_The_Boot_Device_As_Safe_Using_REST_API
Sivas SRRe1143ae2016-08-26 22:31:02 -0500102
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600103 ${bootDevice}= Set Variable Safe
104 ${valueDict}= Create Dictionary data=${bootDevice}
105 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
106 Read the Attribute ${HOST_SETTINGS} boot_flags
107 Response Should Be Equal Safe
Rahul Maheshwari56d86752017-04-07 14:25:01 -0500108 ${output}= Run IPMI Standard Command chassis bootparam get 5
109 Should Contain ${output} Safe-Mode
Sivas SRRe1143ae2016-08-26 22:31:02 -0500110
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600111Set The Boot Device As Safe Using Ipmitool
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600112 [Documentation] This testcase is to set the boot device as Safe using
113 ... ipmitool. The Boot device is read using REST API and
114 ... ipmitool.
115 [Tags] Set_The_Boot_Device_As_Safe_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -0500116
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600117 Run IPMI command 0x0 0x8 0x05 0x80 0x0C 0x00 0x00 0x00
118 Read the Attribute ${HOST_SETTINGS} boot_flags
119 Response Should Be Equal Safe
Rahul Maheshwari56d86752017-04-07 14:25:01 -0500120 ${output}= Run IPMI Standard Command chassis bootparam get 5
121 Should Contain ${output} Safe-Mode
Chris Austenb29d2e82016-06-07 12:25:35 -0500122
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600123Set The Boot Device As CDROM Using REST API
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600124 [Documentation] This testcase is to set the boot device as CDROM using REST
125 ... URI. The Boot device is read using REST API and ipmitool.
126 [Tags] Set_The_Boot_Device_As_CDROM_Using_REST_API
Sivas SRRe1143ae2016-08-26 22:31:02 -0500127
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600128 ${bootDevice}= Set Variable CDROM
129 ${valueDict}= Create Dictionary data=${bootDevice}
130 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
131 Read the Attribute ${HOST_SETTINGS} boot_flags
132 Response Should Be Equal CDROM
Rahul Maheshwari56d86752017-04-07 14:25:01 -0500133 ${output}= Run IPMI Standard Command chassis bootparam get 5
134 Should Contain ${output} Force Boot from CD/DVD
Sivas SRRe1143ae2016-08-26 22:31:02 -0500135
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600136Set The Boot Device As CDROM Using Ipmitool
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600137 [Documentation] This testcase is to set the boot device as CDROM using
138 ... ipmitool. The Boot device is read using REST API and
139 ... ipmitool.
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600140 [Tags] Set_The_Boot_Device_As_CDROM_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -0500141
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600142 Run IPMI command 0x0 0x8 0x05 0x80 0x14 0x00 0x00 0x00
143 Read the Attribute ${HOST_SETTINGS} boot_flags
144 Response Should Be Equal CDROM
Rahul Maheshwari56d86752017-04-07 14:25:01 -0500145 ${output}= Run IPMI Standard Command chassis bootparam get 5
146 Should Contain ${output} Force Boot from CD/DVD
Sivas SRRe1143ae2016-08-26 22:31:02 -0500147
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600148Set The Boot Device As Setup Using REST API
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600149 [Documentation] This testcase is to set the boot device as Setup using REST
150 ... URI. The Boot device is read using REST API and ipmitool.
151 [Tags] Set_The_Boot_Device_As_Setup_Using_REST_API
Sivas SRRe1143ae2016-08-26 22:31:02 -0500152
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600153 ${bootDevice}= Set Variable Setup
154 ${valueDict}= Create Dictionary data=${bootDevice}
155 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
156 Read the Attribute ${HOST_SETTINGS} boot_flags
157 Response Should Be Equal Setup
Rahul Maheshwari56d86752017-04-07 14:25:01 -0500158 ${output}= Run IPMI Standard Command chassis bootparam get 5
159 Should Contain ${output} Force Boot into BIOS Setup
Sivas SRRe1143ae2016-08-26 22:31:02 -0500160
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600161Set The Boot Device As Setup Using Ipmitool
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600162 [Documentation] This testcase is to set the boot device as Setup using
163 ... ipmitool. The Boot device is read using REST API and
164 ... ipmitool.
165 [Tags] Set_The_Boot_Device_As_Setup_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -0500166
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600167 Run IPMI command 0x0 0x8 0x05 0x80 0x18 0x00 0x00 0x00
168 Read the Attribute ${HOST_SETTINGS} boot_flags
169 Response Should Be Equal Setup
Rahul Maheshwari56d86752017-04-07 14:25:01 -0500170 ${output}= Run IPMI Standard Command chassis bootparam get 5
171 Should Contain ${output} Force Boot into BIOS Setup
Chris Austenb29d2e82016-06-07 12:25:35 -0500172
173*** Keywords ***
174
175Response Should Be Equal
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600176 [Arguments] ${args}
177 Should Be Equal ${OUTPUT} ${args}
Chris Austenb29d2e82016-06-07 12:25:35 -0500178
Sivas SRRe1143ae2016-08-26 22:31:02 -0500179Read the Attribute
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600180 [Arguments] ${uri} ${parm}
181 ${output}= Read Attribute ${uri} ${parm}
182 Set Test Variable ${OUTPUT} ${output}
Sweta Potthurif93a7462017-03-21 06:38:26 -0500183
184Pre Test Case Execution
185 [Documentation] Do the pre test setup.
186
187 Open Connection And Log In
188 Initialize DBUS cmd "boot_flags"
189
190Post Test Case Execution
191 [Documentation] Do the post test teardown.
192
193 FFDC On Test Case Fail
194 Close All Connections
George Keishing3ce958c2017-03-27 01:09:02 -0500195
196Test Suite Setup
197 [Documentation] Do the initial suite setup.
George Keishingf1426682017-07-12 23:17:17 -0500198
Sweta Potthuriaf741cb2017-07-04 09:41:17 -0500199 # Boot Host.
200 REST Power On