blob: 4a17741d3421db275ae25c0bcef3ad14c5f9c661 [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
Sivas SRRe1143ae2016-08-26 22:31:02 -050010Suite Setup Open Connection And Log In
11Suite Teardown Close All Connections
12Test Setup Initialize DBUS cmd "boot_flags"
Gunnar Millseac1af22016-11-14 15:30:09 -060013Test Teardown FFDC On Test Case Fail
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 Maheshwari8dc8a482017-01-29 21:41:55 -060026 ${bootDevice}= Set Variable default
27 ${valueDict}= Create Dictionary data=${bootDevice}
28 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
29 Read the Attribute ${HOST_SETTINGS} boot_flags
30 Response Should Be Equal default
31 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
32 Should Be Empty ${stderr}
33 Should Contain ${output} default
Sivas SRRe1143ae2016-08-26 22:31:02 -050034
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060035Set The Boot Device As Default Using Ipmitool
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060036 [Documentation] This testcase is to set the boot device as default using
37 ... ipmitool. The Boot device is read using REST API and
38 ... ipmitool.
39 [Tags] Set_The_Boot_Device_As_Default_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -050040
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060041 Run IPMI command 0x0 0x8 0x05 0x80 0x00 0x00 0x00 0x00
42 Read the Attribute ${HOST_SETTINGS} boot_flags
43 Response Should Be Equal default
44 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
45 Should Be Empty ${stderr}
46 Should Contain ${output} default
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
58 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
59 Should Be Empty ${stderr}
60 Should Contain ${output} Network
Sivas SRRe1143ae2016-08-26 22:31:02 -050061
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060062Set The Boot Device As Network Using Ipmitool
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060063 [Documentation] This testcase is to set the boot device as Network using
64 ... ipmitool. The Boot device is read using REST API and
65 ... ipmitool.
66 [Tags] Set_The_Boot_Device_As_Network_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -050067
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060068 Run IPMI command 0x0 0x8 0x05 0x80 0x04 0x00 0x00 0x00
69 Read the Attribute ${HOST_SETTINGS} boot_flags
70 Response Should Be Equal Network
71 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
72 Should Be Empty ${stderr}
73 Should Contain ${output} Network
Sivas SRRe1143ae2016-08-26 22:31:02 -050074
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060075Set The Boot Device As Disk Using REST API
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060076 [Documentation] This testcase is to set the boot device as Disk using REST
77 ... URI. The Boot device is read using REST API and ipmitool.
78 [Tags] Set_The_Boot_Device_As_Disk_Using_REST_API
Sivas SRRe1143ae2016-08-26 22:31:02 -050079
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060080 ${bootDevice}= Set Variable Disk
81 ${valueDict}= Create Dictionary data=${bootDevice}
82 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
George Keishingec807372016-12-05 03:54:51 -060083 Read the Attribute ${HOST_SETTINGS} boot_flags
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060084 Response Should Be Equal Disk
85 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
86 Should Be Empty ${stderr}
87 Should Contain ${output} Disk
Sivas SRRe1143ae2016-08-26 22:31:02 -050088
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060089Set The Boot Device As Disk Using Ipmitool
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060090 [Documentation] This testcase is to set the boot device as Disk using
91 ... ipmitool. The Boot device is read using REST API and
92 ... ipmitool.
93 [Tags] Set_The_Boot_Device_As_Disk_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -050094
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -060095 Run IPMI command 0x0 0x8 0x05 0x80 0x08 0x00 0x00 0x00
96 Read the Attribute ${HOST_SETTINGS} boot_flags
97 Response Should Be Equal Disk
98 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
99 Should Be Empty ${stderr}
100 Should Contain ${output} Disk
Sivas SRRe1143ae2016-08-26 22:31:02 -0500101
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600102Set The Boot Device As Safe Using REST API
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600103 [Documentation] This testcase is to set the boot device as Safe using REST
104 ... URI. The Boot device is read using REST API and ipmitool.
105 [Tags] Set_The_Boot_Device_As_Safe_Using_REST_API
Sivas SRRe1143ae2016-08-26 22:31:02 -0500106
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600107 ${bootDevice}= Set Variable Safe
108 ${valueDict}= Create Dictionary data=${bootDevice}
109 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
110 Read the Attribute ${HOST_SETTINGS} boot_flags
111 Response Should Be Equal Safe
112 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
113 Should Be Empty ${stderr}
114 Should Contain ${output} Safe
Sivas SRRe1143ae2016-08-26 22:31:02 -0500115
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600116Set The Boot Device As Safe Using Ipmitool
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600117 [Documentation] This testcase is to set the boot device as Safe using
118 ... ipmitool. The Boot device is read using REST API and
119 ... ipmitool.
120 [Tags] Set_The_Boot_Device_As_Safe_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -0500121
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600122 Run IPMI command 0x0 0x8 0x05 0x80 0x0C 0x00 0x00 0x00
123 Read the Attribute ${HOST_SETTINGS} boot_flags
124 Response Should Be Equal Safe
125 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
126 Should Be Empty ${stderr}
127 Should Contain ${output} Safe
Chris Austenb29d2e82016-06-07 12:25:35 -0500128
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600129Set The Boot Device As CDROM Using REST API
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600130 [Documentation] This testcase is to set the boot device as CDROM using REST
131 ... URI. The Boot device is read using REST API and ipmitool.
132 [Tags] Set_The_Boot_Device_As_CDROM_Using_REST_API
Sivas SRRe1143ae2016-08-26 22:31:02 -0500133
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600134 ${bootDevice}= Set Variable CDROM
135 ${valueDict}= Create Dictionary data=${bootDevice}
136 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
137 Read the Attribute ${HOST_SETTINGS} boot_flags
138 Response Should Be Equal CDROM
139 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
140 Should Be Empty ${stderr}
141 Should Contain ${output} CDROM
Sivas SRRe1143ae2016-08-26 22:31:02 -0500142
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600143Set The Boot Device As CDROM Using Ipmitool
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600144 [Documentation] This testcase is to set the boot device as CDROM using
145 ... ipmitool. The Boot device is read using REST API and
146 ... ipmitool.
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600147 [Tags] Set_The_Boot_Device_As_CDROM_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -0500148
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600149 Run IPMI command 0x0 0x8 0x05 0x80 0x14 0x00 0x00 0x00
150 Read the Attribute ${HOST_SETTINGS} boot_flags
151 Response Should Be Equal CDROM
152 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
153 Should Be Empty ${stderr}
154 Should Contain ${output} CDROM
Sivas SRRe1143ae2016-08-26 22:31:02 -0500155
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600156Set The Boot Device As Setup Using REST API
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600157 [Documentation] This testcase is to set the boot device as Setup using REST
158 ... URI. The Boot device is read using REST API and ipmitool.
159 [Tags] Set_The_Boot_Device_As_Setup_Using_REST_API
Sivas SRRe1143ae2016-08-26 22:31:02 -0500160
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600161 ${bootDevice}= Set Variable Setup
162 ${valueDict}= Create Dictionary data=${bootDevice}
163 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
164 Read the Attribute ${HOST_SETTINGS} boot_flags
165 Response Should Be Equal Setup
166 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
167 Should Be Empty ${stderr}
168 Should Contain ${output} Setup
Sivas SRRe1143ae2016-08-26 22:31:02 -0500169
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600170Set The Boot Device As Setup Using Ipmitool
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600171 [Documentation] This testcase is to set the boot device as Setup using
172 ... ipmitool. The Boot device is read using REST API and
173 ... ipmitool.
174 [Tags] Set_The_Boot_Device_As_Setup_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -0500175
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600176 Run IPMI command 0x0 0x8 0x05 0x80 0x18 0x00 0x00 0x00
177 Read the Attribute ${HOST_SETTINGS} boot_flags
178 Response Should Be Equal Setup
179 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
180 Should Be Empty ${stderr}
181 Should Contain ${output} Setup
Chris Austenb29d2e82016-06-07 12:25:35 -0500182
183*** Keywords ***
184
185Response Should Be Equal
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600186 [Arguments] ${args}
187 Should Be Equal ${OUTPUT} ${args}
Chris Austenb29d2e82016-06-07 12:25:35 -0500188
Sivas SRRe1143ae2016-08-26 22:31:02 -0500189Read the Attribute
Rahul Maheshwari8dc8a482017-01-29 21:41:55 -0600190 [Arguments] ${uri} ${parm}
191 ${output}= Read Attribute ${uri} ${parm}
192 Set Test Variable ${OUTPUT} ${output}