blob: d48d540f2978d76708cf07bb4e66ab253c22f38f [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
Chris Austenb29d2e82016-06-07 12:25:35 -05008
Sivas SRRe1143ae2016-08-26 22:31:02 -05009Suite Setup Open Connection And Log In
10Suite Teardown Close All Connections
11Test Setup Initialize DBUS cmd "boot_flags"
12Test Teardown Log FFDC
13*** Variables ***
Chris Austenb29d2e82016-06-07 12:25:35 -050014
15*** Test Cases ***
16
17Set the Boot Device as Default using REST API
18 [Documentation] This testcase is to set the boot device as Default using REST
19 ... URI. The Boot device is read using REST API and ipmitool.
Sivas SRRe1143ae2016-08-26 22:31:02 -050020
Chris Austenb29d2e82016-06-07 12:25:35 -050021 ${bootDevice} = Set Variable Default
22 ${valueDict} = create dictionary data=${bootDevice}
23 Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict}
24 Read the Attribute /org/openbmc/settings/host0 boot_flags
25 Response Should Be Equal Default
Sivas SRRe1143ae2016-08-26 22:31:02 -050026 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
27 Should Be Empty ${stderr}
28 Should Contain ${output} Default
29
Chris Austenb29d2e82016-06-07 12:25:35 -050030Set the Boot Device as Default using ipmitool
31 [Documentation] This testcase is to set the boot device as Default using
32 ... ipmitool. The Boot device is read using REST API and
33 ... ipmitool.
Sivas SRRe1143ae2016-08-26 22:31:02 -050034
Chris Austenb29d2e82016-06-07 12:25:35 -050035 Run IPMI command 0x0 0x8 0x05 0x80 0x00 0x00 0x00 0x00
36 Read the Attribute /org/openbmc/settings/host0 boot_flags
37 Response Should Be Equal Default
Sivas SRRe1143ae2016-08-26 22:31:02 -050038 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
39 Should Be Empty ${stderr}
40 Should Contain ${output} Default
41
Chris Austenb29d2e82016-06-07 12:25:35 -050042Set the Boot Device as Network using REST API
43 [Documentation] This testcase is to set the boot device as Network using REST
44 ... URI. The Boot device is read using REST API and ipmitool.
Sivas SRRe1143ae2016-08-26 22:31:02 -050045
Chris Austenb29d2e82016-06-07 12:25:35 -050046 ${bootDevice} = Set Variable Network
47 ${valueDict} = create dictionary data=${bootDevice}
48 Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict}
49 Read the Attribute /org/openbmc/settings/host0 boot_flags
50 Response Should Be Equal Network
Sivas SRRe1143ae2016-08-26 22:31:02 -050051 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
52 Should Be Empty ${stderr}
53 Should Contain ${output} Network
54
Chris Austenb29d2e82016-06-07 12:25:35 -050055Set the Boot Device as Network using ipmitool
56 [Documentation] This testcase is to set the boot device as Network using
57 ... ipmitool. The Boot device is read using REST API and
58 ... ipmitool.
Sivas SRRe1143ae2016-08-26 22:31:02 -050059
Chris Austenb29d2e82016-06-07 12:25:35 -050060 Run IPMI command 0x0 0x8 0x05 0x80 0x04 0x00 0x00 0x00
61 Read the Attribute /org/openbmc/settings/host0 boot_flags
62 Response Should Be Equal Network
Sivas SRRe1143ae2016-08-26 22:31:02 -050063 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
64 Should Be Empty ${stderr}
65 Should Contain ${output} Network
66
Chris Austenb29d2e82016-06-07 12:25:35 -050067Set the Boot Device as Disk using REST API
68 [Documentation] This testcase is to set the boot device as Disk using REST
69 ... URI. The Boot device is read using REST API and ipmitool.
Sivas SRRe1143ae2016-08-26 22:31:02 -050070
Chris Austenb29d2e82016-06-07 12:25:35 -050071 ${bootDevice} = Set Variable Disk
72 ${valueDict} = create dictionary data=${bootDevice}
73 Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict}
74 Read the Attribute /org/openbmc/settings/host0 boot_flags
75 Response Should Be Equal Disk
Sivas SRRe1143ae2016-08-26 22:31:02 -050076 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
77 Should Be Empty ${stderr}
78 Should Contain ${output} Disk
79
Chris Austenb29d2e82016-06-07 12:25:35 -050080Set the Boot Device as Disk using ipmitool
81 [Documentation] This testcase is to set the boot device as Disk using
82 ... ipmitool. The Boot device is read using REST API and
83 ... ipmitool.
Sivas SRRe1143ae2016-08-26 22:31:02 -050084
Chris Austenb29d2e82016-06-07 12:25:35 -050085 Run IPMI command 0x0 0x8 0x05 0x80 0x08 0x00 0x00 0x00
86 Read the Attribute /org/openbmc/settings/host0 boot_flags
87 Response Should Be Equal Disk
Sivas SRRe1143ae2016-08-26 22:31:02 -050088 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
89 Should Be Empty ${stderr}
90 Should Contain ${output} Disk
91
Chris Austenb29d2e82016-06-07 12:25:35 -050092Set the Boot Device as Safe using REST API
93 [Documentation] This testcase is to set the boot device as Safe using REST
94 ... URI. The Boot device is read using REST API and ipmitool.
Sivas SRRe1143ae2016-08-26 22:31:02 -050095
Chris Austenb29d2e82016-06-07 12:25:35 -050096 ${bootDevice} = Set Variable Safe
97 ${valueDict} = create dictionary data=${bootDevice}
98 Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict}
99 Read the Attribute /org/openbmc/settings/host0 boot_flags
100 Response Should Be Equal Safe
Sivas SRRe1143ae2016-08-26 22:31:02 -0500101 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
102 Should Be Empty ${stderr}
103 Should Contain ${output} Safe
104
Chris Austenb29d2e82016-06-07 12:25:35 -0500105Set the Boot Device as Safe using ipmitool
106 [Documentation] This testcase is to set the boot device as Safe using
107 ... ipmitool. The Boot device is read using REST API and
108 ... ipmitool.
Sivas SRRe1143ae2016-08-26 22:31:02 -0500109
Chris Austenb29d2e82016-06-07 12:25:35 -0500110 Run IPMI command 0x0 0x8 0x05 0x80 0x0C 0x00 0x00 0x00
111 Read the Attribute /org/openbmc/settings/host0 boot_flags
112 Response Should Be Equal Safe
Sivas SRRe1143ae2016-08-26 22:31:02 -0500113 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
114 Should Be Empty ${stderr}
115 Should Contain ${output} Safe
Chris Austenb29d2e82016-06-07 12:25:35 -0500116
117Set the Boot Device as CDROM using REST API
118 [Documentation] This testcase is to set the boot device as CDROM using REST
119 ... URI. The Boot device is read using REST API and ipmitool.
Sivas SRRe1143ae2016-08-26 22:31:02 -0500120
Chris Austenb29d2e82016-06-07 12:25:35 -0500121 ${bootDevice} = Set Variable CDROM
122 ${valueDict} = create dictionary data=${bootDevice}
123 Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict}
124 Read the Attribute /org/openbmc/settings/host0 boot_flags
125 Response Should Be Equal CDROM
Sivas SRRe1143ae2016-08-26 22:31:02 -0500126 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
127 Should Be Empty ${stderr}
128 Should Contain ${output} CDROM
129
Chris Austenb29d2e82016-06-07 12:25:35 -0500130Set the Boot Device as CDROM using ipmitool
131 [Documentation] This testcase is to set the boot device as CDROM using
132 ... ipmitool. The Boot device is read using REST API and
133 ... ipmitool.
Sivas SRRe1143ae2016-08-26 22:31:02 -0500134
Chris Austenb29d2e82016-06-07 12:25:35 -0500135 Run IPMI command 0x0 0x8 0x05 0x80 0x14 0x00 0x00 0x00
136 Read the Attribute /org/openbmc/settings/host0 boot_flags
137 Response Should Be Equal CDROM
Sivas SRRe1143ae2016-08-26 22:31:02 -0500138 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
139 Should Be Empty ${stderr}
140 Should Contain ${output} CDROM
141
Chris Austenb29d2e82016-06-07 12:25:35 -0500142Set the Boot Device as Setup using REST API
143 [Documentation] This testcase is to set the boot device as Setup using REST
144 ... URI. The Boot device is read using REST API and ipmitool.
Sivas SRRe1143ae2016-08-26 22:31:02 -0500145
Chris Austenb29d2e82016-06-07 12:25:35 -0500146 ${bootDevice} = Set Variable Setup
147 ${valueDict} = create dictionary data=${bootDevice}
148 Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict}
149 Read the Attribute /org/openbmc/settings/host0 boot_flags
150 Response Should Be Equal Setup
Sivas SRRe1143ae2016-08-26 22:31:02 -0500151 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
152 Should Be Empty ${stderr}
153 Should Contain ${output} Setup
154
Chris Austenb29d2e82016-06-07 12:25:35 -0500155Set the Boot Device as Setup using ipmitool
156 [Documentation] This testcase is to set the boot device as Setup using
157 ... ipmitool. The Boot device is read using REST API and
158 ... ipmitool.
Sivas SRRe1143ae2016-08-26 22:31:02 -0500159
Chris Austenb29d2e82016-06-07 12:25:35 -0500160 Run IPMI command 0x0 0x8 0x05 0x80 0x18 0x00 0x00 0x00
161 Read the Attribute /org/openbmc/settings/host0 boot_flags
162 Response Should Be Equal Setup
Sivas SRRe1143ae2016-08-26 22:31:02 -0500163 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
164 Should Be Empty ${stderr}
165 Should Contain ${output} Setup
Chris Austenb29d2e82016-06-07 12:25:35 -0500166
167*** Keywords ***
168
169Response Should Be Equal
170 [arguments] ${args}
171 Should Be Equal ${OUTPUT} ${args}
172
Sivas SRRe1143ae2016-08-26 22:31:02 -0500173Read the Attribute
Chris Austenb29d2e82016-06-07 12:25:35 -0500174 [arguments] ${uri} ${parm}
175 ${output} = Read Attribute ${uri} ${parm}
176 set test variable ${OUTPUT} ${output}
177
Sivas SRRe1143ae2016-08-26 22:31:02 -0500178