blob: 5459dc02ee2e156ad08f46986ee2506986df7569 [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
Sweta Potthurif93a7462017-03-21 06:38:26 -050010Test Setup Pre Test Case Execution
11Test Teardown Post Test Case Execution
12
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 Maheshwari8dc8a482017-01-29 21:41:55 -060016${HOST_SETTINGS} ${SETTINGS_URI}host0
George Keishingec807372016-12-05 03:54:51 -060017
Chris Austenb29d2e82016-06-07 12:25:35 -050018*** Test Cases ***
19
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060020Set The Boot Device As Default Using REST API
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060021 [Documentation] This testcase is to set the boot device as default using REST
22 ... URI. The Boot device is read using REST API and ipmitool.
23 [Tags] Set_The_Boot_Device_As_Default_Using_REST_API
Sivas SRRe1143ae2016-08-26 22:31:02 -050024
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060025 ${bootDevice}= Set Variable default
26 ${valueDict}= Create Dictionary data=${bootDevice}
27 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
28 Read the Attribute ${HOST_SETTINGS} boot_flags
29 Response Should Be Equal default
30 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
31 Should Be Empty ${stderr}
32 Should Contain ${output} default
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
42 Response Should Be Equal default
43 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
44 Should Be Empty ${stderr}
45 Should Contain ${output} default
Sivas SRRe1143ae2016-08-26 22:31:02 -050046
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060047Set The Boot Device As Network Using REST API
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060048 [Documentation] This testcase is to set the boot device as Network using REST
49 ... URI. The Boot device is read using REST API and ipmitool.
50 [Tags] Set_The_Boot_Device_As_Network_Using_REST_API
Sivas SRRe1143ae2016-08-26 22:31:02 -050051
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060052 ${bootDevice}= Set Variable Network
53 ${valueDict}= Create Dictionary data=${bootDevice}
54 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
55 Read the Attribute ${HOST_SETTINGS} boot_flags
56 Response Should Be Equal Network
57 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
58 Should Be Empty ${stderr}
59 Should Contain ${output} Network
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
70 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
71 Should Be Empty ${stderr}
72 Should Contain ${output} Network
Sivas SRRe1143ae2016-08-26 22:31:02 -050073
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060074Set The Boot Device As Disk Using REST API
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060075 [Documentation] This testcase is to set the boot device as Disk using REST
76 ... URI. The Boot device is read using REST API and ipmitool.
77 [Tags] Set_The_Boot_Device_As_Disk_Using_REST_API
Sivas SRRe1143ae2016-08-26 22:31:02 -050078
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060079 ${bootDevice}= Set Variable Disk
80 ${valueDict}= Create Dictionary data=${bootDevice}
81 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
George Keishingec807372016-12-05 03:54:51 -060082 Read the Attribute ${HOST_SETTINGS} boot_flags
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060083 Response Should Be Equal Disk
84 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
85 Should Be Empty ${stderr}
86 Should Contain ${output} Disk
Sivas SRRe1143ae2016-08-26 22:31:02 -050087
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060088Set The Boot Device As Disk Using Ipmitool
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060089 [Documentation] This testcase is to set the boot device as Disk using
90 ... ipmitool. The Boot device is read using REST API and
91 ... ipmitool.
92 [Tags] Set_The_Boot_Device_As_Disk_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -050093
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060094 Run IPMI command 0x0 0x8 0x05 0x80 0x08 0x00 0x00 0x00
95 Read the Attribute ${HOST_SETTINGS} boot_flags
96 Response Should Be Equal Disk
97 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
98 Should Be Empty ${stderr}
99 Should Contain ${output} Disk
Sivas SRRe1143ae2016-08-26 22:31:02 -0500100
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600101Set The Boot Device As Safe Using REST API
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600102 [Documentation] This testcase is to set the boot device as Safe using REST
103 ... URI. The Boot device is read using REST API and ipmitool.
104 [Tags] Set_The_Boot_Device_As_Safe_Using_REST_API
Sivas SRRe1143ae2016-08-26 22:31:02 -0500105
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600106 ${bootDevice}= Set Variable Safe
107 ${valueDict}= Create Dictionary data=${bootDevice}
108 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
109 Read the Attribute ${HOST_SETTINGS} boot_flags
110 Response Should Be Equal Safe
111 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
112 Should Be Empty ${stderr}
113 Should Contain ${output} Safe
Sivas SRRe1143ae2016-08-26 22:31:02 -0500114
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600115Set The Boot Device As Safe Using Ipmitool
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600116 [Documentation] This testcase is to set the boot device as Safe using
117 ... ipmitool. The Boot device is read using REST API and
118 ... ipmitool.
119 [Tags] Set_The_Boot_Device_As_Safe_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -0500120
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600121 Run IPMI command 0x0 0x8 0x05 0x80 0x0C 0x00 0x00 0x00
122 Read the Attribute ${HOST_SETTINGS} boot_flags
123 Response Should Be Equal Safe
124 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
125 Should Be Empty ${stderr}
126 Should Contain ${output} Safe
Chris Austenb29d2e82016-06-07 12:25:35 -0500127
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600128Set The Boot Device As CDROM Using REST API
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600129 [Documentation] This testcase is to set the boot device as CDROM using REST
130 ... URI. The Boot device is read using REST API and ipmitool.
131 [Tags] Set_The_Boot_Device_As_CDROM_Using_REST_API
Sivas SRRe1143ae2016-08-26 22:31:02 -0500132
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600133 ${bootDevice}= Set Variable CDROM
134 ${valueDict}= Create Dictionary data=${bootDevice}
135 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
136 Read the Attribute ${HOST_SETTINGS} boot_flags
137 Response Should Be Equal CDROM
138 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
139 Should Be Empty ${stderr}
140 Should Contain ${output} CDROM
Sivas SRRe1143ae2016-08-26 22:31:02 -0500141
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600142Set The Boot Device As CDROM Using Ipmitool
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600143 [Documentation] This testcase is to set the boot device as CDROM using
144 ... ipmitool. The Boot device is read using REST API and
145 ... ipmitool.
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600146 [Tags] Set_The_Boot_Device_As_CDROM_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -0500147
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600148 Run IPMI command 0x0 0x8 0x05 0x80 0x14 0x00 0x00 0x00
149 Read the Attribute ${HOST_SETTINGS} boot_flags
150 Response Should Be Equal CDROM
151 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
152 Should Be Empty ${stderr}
153 Should Contain ${output} CDROM
Sivas SRRe1143ae2016-08-26 22:31:02 -0500154
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600155Set The Boot Device As Setup Using REST API
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600156 [Documentation] This testcase is to set the boot device as Setup using REST
157 ... URI. The Boot device is read using REST API and ipmitool.
158 [Tags] Set_The_Boot_Device_As_Setup_Using_REST_API
Sivas SRRe1143ae2016-08-26 22:31:02 -0500159
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600160 ${bootDevice}= Set Variable Setup
161 ${valueDict}= Create Dictionary data=${bootDevice}
162 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
163 Read the Attribute ${HOST_SETTINGS} boot_flags
164 Response Should Be Equal Setup
165 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
166 Should Be Empty ${stderr}
167 Should Contain ${output} Setup
Sivas SRRe1143ae2016-08-26 22:31:02 -0500168
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600169Set The Boot Device As Setup Using Ipmitool
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600170 [Documentation] This testcase is to set the boot device as Setup using
171 ... ipmitool. The Boot device is read using REST API and
172 ... ipmitool.
173 [Tags] Set_The_Boot_Device_As_Setup_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -0500174
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600175 Run IPMI command 0x0 0x8 0x05 0x80 0x18 0x00 0x00 0x00
176 Read the Attribute ${HOST_SETTINGS} boot_flags
177 Response Should Be Equal Setup
178 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
179 Should Be Empty ${stderr}
180 Should Contain ${output} Setup
Chris Austenb29d2e82016-06-07 12:25:35 -0500181
182*** Keywords ***
183
184Response Should Be Equal
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600185 [Arguments] ${args}
186 Should Be Equal ${OUTPUT} ${args}
Chris Austenb29d2e82016-06-07 12:25:35 -0500187
Sivas SRRe1143ae2016-08-26 22:31:02 -0500188Read the Attribute
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600189 [Arguments] ${uri} ${parm}
190 ${output}= Read Attribute ${uri} ${parm}
191 Set Test Variable ${OUTPUT} ${output}
Sweta Potthurif93a7462017-03-21 06:38:26 -0500192
193Pre Test Case Execution
194 [Documentation] Do the pre test setup.
195
196 Open Connection And Log In
197 Initialize DBUS cmd "boot_flags"
198
199Post Test Case Execution
200 [Documentation] Do the post test teardown.
201
202 FFDC On Test Case Fail
203 Close All Connections