blob: e7dee226996461c0a4f0237191628489a135329d [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
Sivas SRRe1143ae2016-08-26 22:31:02 -050014*** Variables ***
Chris Austenb29d2e82016-06-07 12:25:35 -050015
16*** Test Cases ***
17
18Set the Boot Device as Default using REST API
19 [Documentation] This testcase is to set the boot device as Default using REST
20 ... URI. The Boot device is read using REST API and ipmitool.
Sivas SRRe1143ae2016-08-26 22:31:02 -050021
Chris Austenb29d2e82016-06-07 12:25:35 -050022 ${bootDevice} = Set Variable Default
23 ${valueDict} = create dictionary data=${bootDevice}
24 Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict}
25 Read the Attribute /org/openbmc/settings/host0 boot_flags
26 Response Should Be Equal Default
Sivas SRRe1143ae2016-08-26 22:31:02 -050027 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
28 Should Be Empty ${stderr}
29 Should Contain ${output} Default
30
Chris Austenb29d2e82016-06-07 12:25:35 -050031Set the Boot Device as Default using ipmitool
32 [Documentation] This testcase is to set the boot device as Default using
33 ... ipmitool. The Boot device is read using REST API and
34 ... ipmitool.
Sivas SRRe1143ae2016-08-26 22:31:02 -050035
Chris Austenb29d2e82016-06-07 12:25:35 -050036 Run IPMI command 0x0 0x8 0x05 0x80 0x00 0x00 0x00 0x00
37 Read the Attribute /org/openbmc/settings/host0 boot_flags
38 Response Should Be Equal Default
Sivas SRRe1143ae2016-08-26 22:31:02 -050039 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
40 Should Be Empty ${stderr}
41 Should Contain ${output} Default
42
Chris Austenb29d2e82016-06-07 12:25:35 -050043Set the Boot Device as Network using REST API
44 [Documentation] This testcase is to set the boot device as Network using REST
45 ... URI. The Boot device is read using REST API and ipmitool.
Sivas SRRe1143ae2016-08-26 22:31:02 -050046
Chris Austenb29d2e82016-06-07 12:25:35 -050047 ${bootDevice} = Set Variable Network
48 ${valueDict} = create dictionary data=${bootDevice}
49 Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict}
50 Read the Attribute /org/openbmc/settings/host0 boot_flags
51 Response Should Be Equal Network
Sivas SRRe1143ae2016-08-26 22:31:02 -050052 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
53 Should Be Empty ${stderr}
54 Should Contain ${output} Network
55
Chris Austenb29d2e82016-06-07 12:25:35 -050056Set the Boot Device as Network using ipmitool
57 [Documentation] This testcase is to set the boot device as Network using
58 ... ipmitool. The Boot device is read using REST API and
59 ... ipmitool.
Sivas SRRe1143ae2016-08-26 22:31:02 -050060
Chris Austenb29d2e82016-06-07 12:25:35 -050061 Run IPMI command 0x0 0x8 0x05 0x80 0x04 0x00 0x00 0x00
62 Read the Attribute /org/openbmc/settings/host0 boot_flags
63 Response Should Be Equal Network
Sivas SRRe1143ae2016-08-26 22:31:02 -050064 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
65 Should Be Empty ${stderr}
66 Should Contain ${output} Network
67
Chris Austenb29d2e82016-06-07 12:25:35 -050068Set the Boot Device as Disk using REST API
69 [Documentation] This testcase is to set the boot device as Disk using REST
70 ... URI. The Boot device is read using REST API and ipmitool.
Sivas SRRe1143ae2016-08-26 22:31:02 -050071
Chris Austenb29d2e82016-06-07 12:25:35 -050072 ${bootDevice} = Set Variable Disk
73 ${valueDict} = create dictionary data=${bootDevice}
74 Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict}
75 Read the Attribute /org/openbmc/settings/host0 boot_flags
76 Response Should Be Equal Disk
Sivas SRRe1143ae2016-08-26 22:31:02 -050077 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
78 Should Be Empty ${stderr}
79 Should Contain ${output} Disk
80
Chris Austenb29d2e82016-06-07 12:25:35 -050081Set the Boot Device as Disk using ipmitool
82 [Documentation] This testcase is to set the boot device as Disk using
83 ... ipmitool. The Boot device is read using REST API and
84 ... ipmitool.
Sivas SRRe1143ae2016-08-26 22:31:02 -050085
Chris Austenb29d2e82016-06-07 12:25:35 -050086 Run IPMI command 0x0 0x8 0x05 0x80 0x08 0x00 0x00 0x00
87 Read the Attribute /org/openbmc/settings/host0 boot_flags
88 Response Should Be Equal Disk
Sivas SRRe1143ae2016-08-26 22:31:02 -050089 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
90 Should Be Empty ${stderr}
91 Should Contain ${output} Disk
92
Chris Austenb29d2e82016-06-07 12:25:35 -050093Set the Boot Device as Safe using REST API
94 [Documentation] This testcase is to set the boot device as Safe using REST
95 ... URI. The Boot device is read using REST API and ipmitool.
Sivas SRRe1143ae2016-08-26 22:31:02 -050096
Chris Austenb29d2e82016-06-07 12:25:35 -050097 ${bootDevice} = Set Variable Safe
98 ${valueDict} = create dictionary data=${bootDevice}
99 Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict}
100 Read the Attribute /org/openbmc/settings/host0 boot_flags
101 Response Should Be Equal Safe
Sivas SRRe1143ae2016-08-26 22:31:02 -0500102 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
103 Should Be Empty ${stderr}
104 Should Contain ${output} Safe
105
Chris Austenb29d2e82016-06-07 12:25:35 -0500106Set the Boot Device as Safe using ipmitool
107 [Documentation] This testcase is to set the boot device as Safe using
108 ... ipmitool. The Boot device is read using REST API and
109 ... ipmitool.
Sivas SRRe1143ae2016-08-26 22:31:02 -0500110
Chris Austenb29d2e82016-06-07 12:25:35 -0500111 Run IPMI command 0x0 0x8 0x05 0x80 0x0C 0x00 0x00 0x00
112 Read the Attribute /org/openbmc/settings/host0 boot_flags
113 Response Should Be Equal Safe
Sivas SRRe1143ae2016-08-26 22:31:02 -0500114 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
115 Should Be Empty ${stderr}
116 Should Contain ${output} Safe
Chris Austenb29d2e82016-06-07 12:25:35 -0500117
118Set the Boot Device as CDROM using REST API
119 [Documentation] This testcase is to set the boot device as CDROM using REST
120 ... URI. The Boot device is read using REST API and ipmitool.
Sivas SRRe1143ae2016-08-26 22:31:02 -0500121
Chris Austenb29d2e82016-06-07 12:25:35 -0500122 ${bootDevice} = Set Variable CDROM
123 ${valueDict} = create dictionary data=${bootDevice}
124 Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict}
125 Read the Attribute /org/openbmc/settings/host0 boot_flags
126 Response Should Be Equal CDROM
Sivas SRRe1143ae2016-08-26 22:31:02 -0500127 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
128 Should Be Empty ${stderr}
129 Should Contain ${output} CDROM
130
Chris Austenb29d2e82016-06-07 12:25:35 -0500131Set the Boot Device as CDROM using ipmitool
132 [Documentation] This testcase is to set the boot device as CDROM using
133 ... ipmitool. The Boot device is read using REST API and
134 ... ipmitool.
Sivas SRRe1143ae2016-08-26 22:31:02 -0500135
Chris Austenb29d2e82016-06-07 12:25:35 -0500136 Run IPMI command 0x0 0x8 0x05 0x80 0x14 0x00 0x00 0x00
137 Read the Attribute /org/openbmc/settings/host0 boot_flags
138 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
Chris Austenb29d2e82016-06-07 12:25:35 -0500143Set the Boot Device as Setup using REST API
144 [Documentation] This testcase is to set the boot device as Setup using REST
145 ... URI. The Boot device is read using REST API and ipmitool.
Sivas SRRe1143ae2016-08-26 22:31:02 -0500146
Chris Austenb29d2e82016-06-07 12:25:35 -0500147 ${bootDevice} = Set Variable Setup
148 ${valueDict} = create dictionary data=${bootDevice}
149 Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict}
150 Read the Attribute /org/openbmc/settings/host0 boot_flags
151 Response Should Be Equal Setup
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} Setup
155
Chris Austenb29d2e82016-06-07 12:25:35 -0500156Set the Boot Device as Setup using ipmitool
157 [Documentation] This testcase is to set the boot device as Setup using
158 ... ipmitool. The Boot device is read using REST API and
159 ... ipmitool.
Sivas SRRe1143ae2016-08-26 22:31:02 -0500160
Chris Austenb29d2e82016-06-07 12:25:35 -0500161 Run IPMI command 0x0 0x8 0x05 0x80 0x18 0x00 0x00 0x00
162 Read the Attribute /org/openbmc/settings/host0 boot_flags
163 Response Should Be Equal Setup
Sivas SRRe1143ae2016-08-26 22:31:02 -0500164 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
165 Should Be Empty ${stderr}
166 Should Contain ${output} Setup
Chris Austenb29d2e82016-06-07 12:25:35 -0500167
168*** Keywords ***
169
170Response Should Be Equal
171 [arguments] ${args}
172 Should Be Equal ${OUTPUT} ${args}
173
Sivas SRRe1143ae2016-08-26 22:31:02 -0500174Read the Attribute
Chris Austenb29d2e82016-06-07 12:25:35 -0500175 [arguments] ${uri} ${parm}
176 ${output} = Read Attribute ${uri} ${parm}
177 set test variable ${OUTPUT} ${output}
178
Sivas SRRe1143ae2016-08-26 22:31:02 -0500179