blob: 94e00e3fdcd404de9450c01878e00c0c7f17c0c8 [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
Chris Austenb29d2e82016-06-07 12:25:35 -05009
George Keishing3ce958c2017-03-27 01:09:02 -050010Suite Setup Test Suite Setup
Sweta Potthurif93a7462017-03-21 06:38:26 -050011Test Setup Pre Test Case Execution
12Test Teardown Post Test Case Execution
George Keishing3ce958c2017-03-27 01:09:02 -050013Suite Teardown Close All Connections
George Keishingec807372016-12-05 03:54:51 -060014
Sivas SRRe1143ae2016-08-26 22:31:02 -050015*** Variables ***
Chris Austenb29d2e82016-06-07 12:25:35 -050016
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060017${HOST_SETTINGS} ${SETTINGS_URI}host0
George Keishingec807372016-12-05 03:54:51 -060018
Chris Austenb29d2e82016-06-07 12:25:35 -050019*** Test Cases ***
20
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060021Set The Boot Device As Default Using REST API
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060022 [Documentation] This testcase is to set the boot device as default using REST
23 ... URI. The Boot device is read using REST API and ipmitool.
24 [Tags] Set_The_Boot_Device_As_Default_Using_REST_API
Sivas SRRe1143ae2016-08-26 22:31:02 -050025
Rahul Maheshwari28087e92017-04-07 07:12:49 -050026 ${bootDevice}= Set Variable Default
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060027 ${valueDict}= Create Dictionary data=${bootDevice}
28 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
29 Read the Attribute ${HOST_SETTINGS} boot_flags
Rahul Maheshwari28087e92017-04-07 07:12:49 -050030 Response Should Be Equal Default
Rahul Maheshwari56d86752017-04-07 14:25:01 -050031 ${output}= Run IPMI Standard Command chassis bootparam get 5
32 Should Contain ${output} No override
Sivas SRRe1143ae2016-08-26 22:31:02 -050033
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060034Set The Boot Device As Default Using Ipmitool
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060035 [Documentation] This testcase is to set the boot device as default using
36 ... ipmitool. The Boot device is read using REST API and
37 ... ipmitool.
38 [Tags] Set_The_Boot_Device_As_Default_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -050039
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060040 Run IPMI command 0x0 0x8 0x05 0x80 0x00 0x00 0x00 0x00
41 Read the Attribute ${HOST_SETTINGS} boot_flags
Rahul Maheshwari28087e92017-04-07 07:12:49 -050042 Response Should Be Equal Default
Rahul Maheshwari56d86752017-04-07 14:25:01 -050043 ${output}= Run IPMI Standard Command chassis bootparam get 5
44 Should Contain ${output} No override
Sivas SRRe1143ae2016-08-26 22:31:02 -050045
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060046Set The Boot Device As Network Using REST API
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060047 [Documentation] This testcase is to set the boot device as Network using REST
48 ... URI. The Boot device is read using REST API and ipmitool.
49 [Tags] Set_The_Boot_Device_As_Network_Using_REST_API
Sivas SRRe1143ae2016-08-26 22:31:02 -050050
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060051 ${bootDevice}= Set Variable Network
52 ${valueDict}= Create Dictionary data=${bootDevice}
53 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
54 Read the Attribute ${HOST_SETTINGS} boot_flags
55 Response Should Be Equal Network
Rahul Maheshwari56d86752017-04-07 14:25:01 -050056 ${output}= Run IPMI Standard Command chassis bootparam get 5
57 Should Contain ${output} Force PXE
Sivas SRRe1143ae2016-08-26 22:31:02 -050058
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060059Set The Boot Device As Network Using Ipmitool
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060060 [Documentation] This testcase is to set the boot device as Network using
61 ... ipmitool. The Boot device is read using REST API and
62 ... ipmitool.
63 [Tags] Set_The_Boot_Device_As_Network_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -050064
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060065 Run IPMI command 0x0 0x8 0x05 0x80 0x04 0x00 0x00 0x00
66 Read the Attribute ${HOST_SETTINGS} boot_flags
67 Response Should Be Equal Network
Rahul Maheshwari56d86752017-04-07 14:25:01 -050068 ${output}= Run IPMI Standard Command chassis bootparam get 5
69 Should Contain ${output} Force PXE
Sivas SRRe1143ae2016-08-26 22:31:02 -050070
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060071Set The Boot Device As Disk Using REST API
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060072 [Documentation] This testcase is to set the boot device as Disk using REST
73 ... URI. The Boot device is read using REST API and ipmitool.
74 [Tags] Set_The_Boot_Device_As_Disk_Using_REST_API
Sivas SRRe1143ae2016-08-26 22:31:02 -050075
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060076 ${bootDevice}= Set Variable Disk
77 ${valueDict}= Create Dictionary data=${bootDevice}
78 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
George Keishingec807372016-12-05 03:54:51 -060079 Read the Attribute ${HOST_SETTINGS} boot_flags
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060080 Response Should Be Equal Disk
Rahul Maheshwari56d86752017-04-07 14:25:01 -050081 ${output}= Run IPMI Standard Command chassis bootparam get 5
82 Should Contain ${output} Force Boot from default Hard-Drive
Sivas SRRe1143ae2016-08-26 22:31:02 -050083
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060084Set The Boot Device As Disk Using Ipmitool
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060085 [Documentation] This testcase is to set the boot device as Disk using
86 ... ipmitool. The Boot device is read using REST API and
87 ... ipmitool.
88 [Tags] Set_The_Boot_Device_As_Disk_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -050089
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060090 Run IPMI command 0x0 0x8 0x05 0x80 0x08 0x00 0x00 0x00
91 Read the Attribute ${HOST_SETTINGS} boot_flags
92 Response Should Be Equal Disk
Rahul Maheshwari56d86752017-04-07 14:25:01 -050093 ${output}= Run IPMI Standard Command chassis bootparam get 5
94 Should Contain ${output} Force Boot from default Hard-Drive
Sivas SRRe1143ae2016-08-26 22:31:02 -050095
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060096Set The Boot Device As Safe Using REST API
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060097 [Documentation] This testcase is to set the boot device as Safe using REST
98 ... URI. The Boot device is read using REST API and ipmitool.
99 [Tags] Set_The_Boot_Device_As_Safe_Using_REST_API
Sivas SRRe1143ae2016-08-26 22:31:02 -0500100
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600101 ${bootDevice}= Set Variable Safe
102 ${valueDict}= Create Dictionary data=${bootDevice}
103 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
104 Read the Attribute ${HOST_SETTINGS} boot_flags
105 Response Should Be Equal Safe
Rahul Maheshwari56d86752017-04-07 14:25:01 -0500106 ${output}= Run IPMI Standard Command chassis bootparam get 5
107 Should Contain ${output} Safe-Mode
Sivas SRRe1143ae2016-08-26 22:31:02 -0500108
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600109Set The Boot Device As Safe Using Ipmitool
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600110 [Documentation] This testcase is to set the boot device as Safe using
111 ... ipmitool. The Boot device is read using REST API and
112 ... ipmitool.
113 [Tags] Set_The_Boot_Device_As_Safe_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -0500114
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600115 Run IPMI command 0x0 0x8 0x05 0x80 0x0C 0x00 0x00 0x00
116 Read the Attribute ${HOST_SETTINGS} boot_flags
117 Response Should Be Equal Safe
Rahul Maheshwari56d86752017-04-07 14:25:01 -0500118 ${output}= Run IPMI Standard Command chassis bootparam get 5
119 Should Contain ${output} Safe-Mode
Chris Austenb29d2e82016-06-07 12:25:35 -0500120
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600121Set The Boot Device As CDROM Using REST API
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600122 [Documentation] This testcase is to set the boot device as CDROM using REST
123 ... URI. The Boot device is read using REST API and ipmitool.
124 [Tags] Set_The_Boot_Device_As_CDROM_Using_REST_API
Sivas SRRe1143ae2016-08-26 22:31:02 -0500125
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600126 ${bootDevice}= Set Variable CDROM
127 ${valueDict}= Create Dictionary data=${bootDevice}
128 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
129 Read the Attribute ${HOST_SETTINGS} boot_flags
130 Response Should Be Equal CDROM
Rahul Maheshwari56d86752017-04-07 14:25:01 -0500131 ${output}= Run IPMI Standard Command chassis bootparam get 5
132 Should Contain ${output} Force Boot from CD/DVD
Sivas SRRe1143ae2016-08-26 22:31:02 -0500133
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600134Set The Boot Device As CDROM Using Ipmitool
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600135 [Documentation] This testcase is to set the boot device as CDROM using
136 ... ipmitool. The Boot device is read using REST API and
137 ... ipmitool.
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600138 [Tags] Set_The_Boot_Device_As_CDROM_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -0500139
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600140 Run IPMI command 0x0 0x8 0x05 0x80 0x14 0x00 0x00 0x00
141 Read the Attribute ${HOST_SETTINGS} boot_flags
142 Response Should Be Equal CDROM
Rahul Maheshwari56d86752017-04-07 14:25:01 -0500143 ${output}= Run IPMI Standard Command chassis bootparam get 5
144 Should Contain ${output} Force Boot from CD/DVD
Sivas SRRe1143ae2016-08-26 22:31:02 -0500145
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600146Set The Boot Device As Setup Using REST API
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600147 [Documentation] This testcase is to set the boot device as Setup using REST
148 ... URI. The Boot device is read using REST API and ipmitool.
149 [Tags] Set_The_Boot_Device_As_Setup_Using_REST_API
Sivas SRRe1143ae2016-08-26 22:31:02 -0500150
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600151 ${bootDevice}= Set Variable Setup
152 ${valueDict}= Create Dictionary data=${bootDevice}
153 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
154 Read the Attribute ${HOST_SETTINGS} boot_flags
155 Response Should Be Equal Setup
Rahul Maheshwari56d86752017-04-07 14:25:01 -0500156 ${output}= Run IPMI Standard Command chassis bootparam get 5
157 Should Contain ${output} Force Boot into BIOS Setup
Sivas SRRe1143ae2016-08-26 22:31:02 -0500158
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600159Set The Boot Device As Setup Using Ipmitool
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600160 [Documentation] This testcase is to set the boot device as Setup using
161 ... ipmitool. The Boot device is read using REST API and
162 ... ipmitool.
163 [Tags] Set_The_Boot_Device_As_Setup_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -0500164
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600165 Run IPMI command 0x0 0x8 0x05 0x80 0x18 0x00 0x00 0x00
166 Read the Attribute ${HOST_SETTINGS} boot_flags
167 Response Should Be Equal Setup
Rahul Maheshwari56d86752017-04-07 14:25:01 -0500168 ${output}= Run IPMI Standard Command chassis bootparam get 5
169 Should Contain ${output} Force Boot into BIOS Setup
Chris Austenb29d2e82016-06-07 12:25:35 -0500170
171*** Keywords ***
172
173Response Should Be Equal
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600174 [Arguments] ${args}
175 Should Be Equal ${OUTPUT} ${args}
Chris Austenb29d2e82016-06-07 12:25:35 -0500176
Sivas SRRe1143ae2016-08-26 22:31:02 -0500177Read the Attribute
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600178 [Arguments] ${uri} ${parm}
179 ${output}= Read Attribute ${uri} ${parm}
180 Set Test Variable ${OUTPUT} ${output}
Sweta Potthurif93a7462017-03-21 06:38:26 -0500181
182Pre Test Case Execution
183 [Documentation] Do the pre test setup.
184
185 Open Connection And Log In
186 Initialize DBUS cmd "boot_flags"
187
188Post Test Case Execution
189 [Documentation] Do the post test teardown.
190
191 FFDC On Test Case Fail
192 Close All Connections
George Keishing3ce958c2017-03-27 01:09:02 -0500193
194Test Suite Setup
195 [Documentation] Do the initial suite setup.
196 ${current_state}= Get Host State
197 Run Keyword If '${current_state}' == 'Off'
198 ... Initiate Host Boot
199
200 Wait Until Keyword Succeeds
201 ... 10 min 10 sec Is OS Starting