blob: 95f1696a5cbe287a0319594de27857bdb0471cef [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
21Set the Boot Device as Default using REST API
22 [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.
Sivas SRRe1143ae2016-08-26 22:31:02 -050024
Gunnar Mills1cd544d2016-12-06 11:19:22 -060025 ${bootDevice}= Set Variable Default
26 ${valueDict}= create dictionary data=${bootDevice}
George Keishingec807372016-12-05 03:54:51 -060027 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
28 Read the Attribute ${HOST_SETTINGS} boot_flags
Chris Austenb29d2e82016-06-07 12:25:35 -050029 Response Should Be Equal Default
Sivas SRRe1143ae2016-08-26 22:31:02 -050030 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
31 Should Be Empty ${stderr}
32 Should Contain ${output} Default
33
Chris Austenb29d2e82016-06-07 12:25:35 -050034Set the Boot Device as Default using ipmitool
35 [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.
Sivas SRRe1143ae2016-08-26 22:31:02 -050038
Chris Austenb29d2e82016-06-07 12:25:35 -050039 Run IPMI command 0x0 0x8 0x05 0x80 0x00 0x00 0x00 0x00
George Keishingec807372016-12-05 03:54:51 -060040 Read the Attribute ${HOST_SETTINGS} boot_flags
Chris Austenb29d2e82016-06-07 12:25:35 -050041 Response Should Be Equal Default
Sivas SRRe1143ae2016-08-26 22:31:02 -050042 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
43 Should Be Empty ${stderr}
44 Should Contain ${output} Default
45
Chris Austenb29d2e82016-06-07 12:25:35 -050046Set the Boot Device as Network using REST API
47 [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.
Sivas SRRe1143ae2016-08-26 22:31:02 -050049
Gunnar Mills1cd544d2016-12-06 11:19:22 -060050 ${bootDevice}= Set Variable Network
51 ${valueDict}= create dictionary data=${bootDevice}
George Keishingec807372016-12-05 03:54:51 -060052 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
53 Read the Attribute ${HOST_SETTINGS} boot_flags
Chris Austenb29d2e82016-06-07 12:25:35 -050054 Response Should Be Equal Network
Sivas SRRe1143ae2016-08-26 22:31:02 -050055 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
56 Should Be Empty ${stderr}
57 Should Contain ${output} Network
58
Chris Austenb29d2e82016-06-07 12:25:35 -050059Set the Boot Device as Network using ipmitool
60 [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.
Sivas SRRe1143ae2016-08-26 22:31:02 -050063
Chris Austenb29d2e82016-06-07 12:25:35 -050064 Run IPMI command 0x0 0x8 0x05 0x80 0x04 0x00 0x00 0x00
George Keishingec807372016-12-05 03:54:51 -060065 Read the Attribute ${HOST_SETTINGS} boot_flags
Chris Austenb29d2e82016-06-07 12:25:35 -050066 Response Should Be Equal Network
Sivas SRRe1143ae2016-08-26 22:31:02 -050067 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
68 Should Be Empty ${stderr}
69 Should Contain ${output} Network
70
Chris Austenb29d2e82016-06-07 12:25:35 -050071Set the Boot Device as Disk using REST API
72 [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.
Sivas SRRe1143ae2016-08-26 22:31:02 -050074
Gunnar Mills1cd544d2016-12-06 11:19:22 -060075 ${bootDevice}= Set Variable Disk
76 ${valueDict}= create dictionary data=${bootDevice}
George Keishingec807372016-12-05 03:54:51 -060077 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
78 Read the Attribute ${HOST_SETTINGS} boot_flags
Chris Austenb29d2e82016-06-07 12:25:35 -050079 Response Should Be Equal Disk
Sivas SRRe1143ae2016-08-26 22:31:02 -050080 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
81 Should Be Empty ${stderr}
82 Should Contain ${output} Disk
83
Chris Austenb29d2e82016-06-07 12:25:35 -050084Set the Boot Device as Disk using ipmitool
85 [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.
Sivas SRRe1143ae2016-08-26 22:31:02 -050088
Chris Austenb29d2e82016-06-07 12:25:35 -050089 Run IPMI command 0x0 0x8 0x05 0x80 0x08 0x00 0x00 0x00
George Keishingec807372016-12-05 03:54:51 -060090 Read the Attribute ${HOST_SETTINGS} boot_flags
Chris Austenb29d2e82016-06-07 12:25:35 -050091 Response Should Be Equal Disk
Sivas SRRe1143ae2016-08-26 22:31:02 -050092 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
93 Should Be Empty ${stderr}
94 Should Contain ${output} Disk
95
Chris Austenb29d2e82016-06-07 12:25:35 -050096Set the Boot Device as Safe using REST API
97 [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.
Sivas SRRe1143ae2016-08-26 22:31:02 -050099
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600100 ${bootDevice}= Set Variable Safe
101 ${valueDict}= create dictionary data=${bootDevice}
George Keishingec807372016-12-05 03:54:51 -0600102 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
103 Read the Attribute ${HOST_SETTINGS} boot_flags
Chris Austenb29d2e82016-06-07 12:25:35 -0500104 Response Should Be Equal Safe
Sivas SRRe1143ae2016-08-26 22:31:02 -0500105 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
106 Should Be Empty ${stderr}
107 Should Contain ${output} Safe
108
Chris Austenb29d2e82016-06-07 12:25:35 -0500109Set the Boot Device as Safe using ipmitool
110 [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.
Sivas SRRe1143ae2016-08-26 22:31:02 -0500113
Chris Austenb29d2e82016-06-07 12:25:35 -0500114 Run IPMI command 0x0 0x8 0x05 0x80 0x0C 0x00 0x00 0x00
George Keishingec807372016-12-05 03:54:51 -0600115 Read the Attribute ${HOST_SETTINGS} boot_flags
Chris Austenb29d2e82016-06-07 12:25:35 -0500116 Response Should Be Equal Safe
Sivas SRRe1143ae2016-08-26 22:31:02 -0500117 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
118 Should Be Empty ${stderr}
119 Should Contain ${output} Safe
Chris Austenb29d2e82016-06-07 12:25:35 -0500120
121Set the Boot Device as CDROM using REST API
122 [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.
Sivas SRRe1143ae2016-08-26 22:31:02 -0500124
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600125 ${bootDevice}= Set Variable CDROM
126 ${valueDict}= create dictionary data=${bootDevice}
George Keishingec807372016-12-05 03:54:51 -0600127 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
128 Read the Attribute ${HOST_SETTINGS} boot_flags
Chris Austenb29d2e82016-06-07 12:25:35 -0500129 Response Should Be Equal CDROM
Sivas SRRe1143ae2016-08-26 22:31:02 -0500130 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
131 Should Be Empty ${stderr}
132 Should Contain ${output} CDROM
133
Chris Austenb29d2e82016-06-07 12:25:35 -0500134Set the Boot Device as CDROM using ipmitool
135 [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.
Sivas SRRe1143ae2016-08-26 22:31:02 -0500138
Chris Austenb29d2e82016-06-07 12:25:35 -0500139 Run IPMI command 0x0 0x8 0x05 0x80 0x14 0x00 0x00 0x00
George Keishingec807372016-12-05 03:54:51 -0600140 Read the Attribute ${HOST_SETTINGS} boot_flags
Chris Austenb29d2e82016-06-07 12:25:35 -0500141 Response Should Be Equal CDROM
Sivas SRRe1143ae2016-08-26 22:31:02 -0500142 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
143 Should Be Empty ${stderr}
144 Should Contain ${output} CDROM
145
Chris Austenb29d2e82016-06-07 12:25:35 -0500146Set the Boot Device as Setup using REST API
147 [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.
Sivas SRRe1143ae2016-08-26 22:31:02 -0500149
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600150 ${bootDevice}= Set Variable Setup
151 ${valueDict}= create dictionary data=${bootDevice}
George Keishingec807372016-12-05 03:54:51 -0600152 Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
153 Read the Attribute ${HOST_SETTINGS} boot_flags
Chris Austenb29d2e82016-06-07 12:25:35 -0500154 Response Should Be Equal Setup
Sivas SRRe1143ae2016-08-26 22:31:02 -0500155 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
156 Should Be Empty ${stderr}
157 Should Contain ${output} Setup
158
Chris Austenb29d2e82016-06-07 12:25:35 -0500159Set the Boot Device as Setup using ipmitool
160 [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.
Sivas SRRe1143ae2016-08-26 22:31:02 -0500163
Chris Austenb29d2e82016-06-07 12:25:35 -0500164 Run IPMI command 0x0 0x8 0x05 0x80 0x18 0x00 0x00 0x00
George Keishingec807372016-12-05 03:54:51 -0600165 Read the Attribute ${HOST_SETTINGS} boot_flags
Chris Austenb29d2e82016-06-07 12:25:35 -0500166 Response Should Be Equal Setup
Sivas SRRe1143ae2016-08-26 22:31:02 -0500167 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
168 Should Be Empty ${stderr}
169 Should Contain ${output} Setup
Chris Austenb29d2e82016-06-07 12:25:35 -0500170
171*** Keywords ***
172
173Response Should Be Equal
Gunnar Mills38032802016-12-12 13:43:40 -0600174 [Arguments] ${args}
Chris Austenb29d2e82016-06-07 12:25:35 -0500175 Should Be Equal ${OUTPUT} ${args}
176
Sivas SRRe1143ae2016-08-26 22:31:02 -0500177Read the Attribute
Gunnar Mills38032802016-12-12 13:43:40 -0600178 [Arguments] ${uri} ${parm}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600179 ${output}= Read Attribute ${uri} ${parm}
Chris Austenb29d2e82016-06-07 12:25:35 -0500180 set test variable ${OUTPUT} ${output}
181
Sivas SRRe1143ae2016-08-26 22:31:02 -0500182