blob: e417ce82600f7967e99d433b41f7afa5bd925e97 [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
George Keishingec807372016-12-05 03:54:51 -060017${HOST_SETTINGS} ${SETTINGS_URI}host0
18
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
Chris Austenb29d2e82016-06-07 12:25:35 -050022 [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.
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060024 [Tags] Set_The_Boot_Device_As_Default_Using_REST_API
Sivas SRRe1143ae2016-08-26 22:31:02 -050025
Gunnar Mills1cd544d2016-12-06 11:19:22 -060026 ${bootDevice}= Set Variable Default
27 ${valueDict}= create dictionary data=${bootDevice}
George Keishingec807372016-12-05 03:54:51 -060028 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
29 Read the Attribute ${HOST_SETTINGS} boot_flags
Chris Austenb29d2e82016-06-07 12:25:35 -050030 Response Should Be Equal Default
Sivas SRRe1143ae2016-08-26 22:31:02 -050031 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
32 Should Be Empty ${stderr}
33 Should Contain ${output} Default
34
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060035Set The Boot Device As Default Using Ipmitool
Chris Austenb29d2e82016-06-07 12:25:35 -050036 [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.
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060039 [Tags] Set_The_Boot_Device_As_Default_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -050040
Chris Austenb29d2e82016-06-07 12:25:35 -050041 Run IPMI command 0x0 0x8 0x05 0x80 0x00 0x00 0x00 0x00
George Keishingec807372016-12-05 03:54:51 -060042 Read the Attribute ${HOST_SETTINGS} boot_flags
Chris Austenb29d2e82016-06-07 12:25:35 -050043 Response Should Be Equal Default
Sivas SRRe1143ae2016-08-26 22:31:02 -050044 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
45 Should Be Empty ${stderr}
46 Should Contain ${output} Default
47
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060048Set The Boot Device As Network Using REST API
Chris Austenb29d2e82016-06-07 12:25:35 -050049 [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.
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060051 [Tags] Set_The_Boot_Device_As_Network_Using_REST_API
Sivas SRRe1143ae2016-08-26 22:31:02 -050052
Gunnar Mills1cd544d2016-12-06 11:19:22 -060053 ${bootDevice}= Set Variable Network
54 ${valueDict}= create dictionary data=${bootDevice}
George Keishingec807372016-12-05 03:54:51 -060055 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
56 Read the Attribute ${HOST_SETTINGS} boot_flags
Chris Austenb29d2e82016-06-07 12:25:35 -050057 Response Should Be Equal Network
Sivas SRRe1143ae2016-08-26 22:31:02 -050058 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
59 Should Be Empty ${stderr}
60 Should Contain ${output} Network
61
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060062Set The Boot Device As Network Using Ipmitool
Chris Austenb29d2e82016-06-07 12:25:35 -050063 [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.
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060066 [Tags] Set_The_Boot_Device_As_Network_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -050067
Chris Austenb29d2e82016-06-07 12:25:35 -050068 Run IPMI command 0x0 0x8 0x05 0x80 0x04 0x00 0x00 0x00
George Keishingec807372016-12-05 03:54:51 -060069 Read the Attribute ${HOST_SETTINGS} boot_flags
Chris Austenb29d2e82016-06-07 12:25:35 -050070 Response Should Be Equal Network
Sivas SRRe1143ae2016-08-26 22:31:02 -050071 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
72 Should Be Empty ${stderr}
73 Should Contain ${output} Network
74
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060075Set The Boot Device As Disk Using REST API
Chris Austenb29d2e82016-06-07 12:25:35 -050076 [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.
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060078 [Tags] Set_The_Boot_Device_As_Disk_Using_REST_API
Sivas SRRe1143ae2016-08-26 22:31:02 -050079
Gunnar Mills1cd544d2016-12-06 11:19:22 -060080 ${bootDevice}= Set Variable Disk
81 ${valueDict}= create dictionary data=${bootDevice}
George Keishingec807372016-12-05 03:54:51 -060082 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
83 Read the Attribute ${HOST_SETTINGS} boot_flags
Chris Austenb29d2e82016-06-07 12:25:35 -050084 Response Should Be Equal Disk
Sivas SRRe1143ae2016-08-26 22:31:02 -050085 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
86 Should Be Empty ${stderr}
87 Should Contain ${output} Disk
88
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060089Set The Boot Device As Disk Using Ipmitool
Chris Austenb29d2e82016-06-07 12:25:35 -050090 [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.
Sridevi Ramesh32c93f42017-01-19 06:36:54 -060093 [Tags] Set_The_Boot_Device_As_Disk_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -050094
Chris Austenb29d2e82016-06-07 12:25:35 -050095 Run IPMI command 0x0 0x8 0x05 0x80 0x08 0x00 0x00 0x00
George Keishingec807372016-12-05 03:54:51 -060096 Read the Attribute ${HOST_SETTINGS} boot_flags
Chris Austenb29d2e82016-06-07 12:25:35 -050097 Response Should Be Equal Disk
Sivas SRRe1143ae2016-08-26 22:31:02 -050098 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
99 Should Be Empty ${stderr}
100 Should Contain ${output} Disk
101
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600102Set The Boot Device As Safe Using REST API
Chris Austenb29d2e82016-06-07 12:25:35 -0500103 [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.
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600105 [Tags] Set_The_Boot_Device_As_Safe_Using_REST_API
Sivas SRRe1143ae2016-08-26 22:31:02 -0500106
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600107 ${bootDevice}= Set Variable Safe
108 ${valueDict}= create dictionary data=${bootDevice}
George Keishingec807372016-12-05 03:54:51 -0600109 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
110 Read the Attribute ${HOST_SETTINGS} boot_flags
Chris Austenb29d2e82016-06-07 12:25:35 -0500111 Response Should Be Equal Safe
Sivas SRRe1143ae2016-08-26 22:31:02 -0500112 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
113 Should Be Empty ${stderr}
114 Should Contain ${output} Safe
115
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600116Set The Boot Device As Safe Using Ipmitool
Chris Austenb29d2e82016-06-07 12:25:35 -0500117 [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.
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600120 [Tags] Set_The_Boot_Device_As_Safe_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -0500121
Chris Austenb29d2e82016-06-07 12:25:35 -0500122 Run IPMI command 0x0 0x8 0x05 0x80 0x0C 0x00 0x00 0x00
George Keishingec807372016-12-05 03:54:51 -0600123 Read the Attribute ${HOST_SETTINGS} boot_flags
Chris Austenb29d2e82016-06-07 12:25:35 -0500124 Response Should Be Equal Safe
Sivas SRRe1143ae2016-08-26 22:31:02 -0500125 ${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
Chris Austenb29d2e82016-06-07 12:25:35 -0500130 [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.
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600132 [Tags] Set_The_Boot_Device_As_CDROM_Using_REST_API
Sivas SRRe1143ae2016-08-26 22:31:02 -0500133
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600134 ${bootDevice}= Set Variable CDROM
135 ${valueDict}= create dictionary data=${bootDevice}
George Keishingec807372016-12-05 03:54:51 -0600136 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
137 Read the Attribute ${HOST_SETTINGS} boot_flags
Chris Austenb29d2e82016-06-07 12:25:35 -0500138 Response Should Be Equal CDROM
Sivas SRRe1143ae2016-08-26 22:31:02 -0500139 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
140 Should Be Empty ${stderr}
141 Should Contain ${output} CDROM
142
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600143Set The Boot Device As CDROM Using Ipmitool
Chris Austenb29d2e82016-06-07 12:25:35 -0500144 [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
Chris Austenb29d2e82016-06-07 12:25:35 -0500149 Run IPMI command 0x0 0x8 0x05 0x80 0x14 0x00 0x00 0x00
George Keishingec807372016-12-05 03:54:51 -0600150 Read the Attribute ${HOST_SETTINGS} boot_flags
Chris Austenb29d2e82016-06-07 12:25:35 -0500151 Response Should Be Equal CDROM
Sivas SRRe1143ae2016-08-26 22:31:02 -0500152 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
153 Should Be Empty ${stderr}
154 Should Contain ${output} CDROM
155
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600156Set The Boot Device As Setup Using REST API
Chris Austenb29d2e82016-06-07 12:25:35 -0500157 [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.
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600159 [Tags] Set_The_Boot_Device_As_Setup_Using_REST_API
Sivas SRRe1143ae2016-08-26 22:31:02 -0500160
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600161 ${bootDevice}= Set Variable Setup
162 ${valueDict}= create dictionary data=${bootDevice}
George Keishingec807372016-12-05 03:54:51 -0600163 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
164 Read the Attribute ${HOST_SETTINGS} boot_flags
Chris Austenb29d2e82016-06-07 12:25:35 -0500165 Response Should Be Equal Setup
Sivas SRRe1143ae2016-08-26 22:31:02 -0500166 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
167 Should Be Empty ${stderr}
168 Should Contain ${output} Setup
169
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600170Set The Boot Device As Setup Using Ipmitool
Chris Austenb29d2e82016-06-07 12:25:35 -0500171 [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.
Sridevi Ramesh32c93f42017-01-19 06:36:54 -0600174 [Tags] Set_The_Boot_Device_As_Setup_Using_Ipmitool
Sivas SRRe1143ae2016-08-26 22:31:02 -0500175
Chris Austenb29d2e82016-06-07 12:25:35 -0500176 Run IPMI command 0x0 0x8 0x05 0x80 0x18 0x00 0x00 0x00
George Keishingec807372016-12-05 03:54:51 -0600177 Read the Attribute ${HOST_SETTINGS} boot_flags
Chris Austenb29d2e82016-06-07 12:25:35 -0500178 Response Should Be Equal Setup
Sivas SRRe1143ae2016-08-26 22:31:02 -0500179 ${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
Gunnar Mills38032802016-12-12 13:43:40 -0600186 [Arguments] ${args}
Chris Austenb29d2e82016-06-07 12:25:35 -0500187 Should Be Equal ${OUTPUT} ${args}
188
Sivas SRRe1143ae2016-08-26 22:31:02 -0500189Read the Attribute
Gunnar Mills38032802016-12-12 13:43:40 -0600190 [Arguments] ${uri} ${parm}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600191 ${output}= Read Attribute ${uri} ${parm}
Chris Austenb29d2e82016-06-07 12:25:35 -0500192 set test variable ${OUTPUT} ${output}