blob: e084f09ff74cb97461afddc2d332293d392db568 [file] [log] [blame]
Chris Austenb29d2e82016-06-07 12:25:35 -05001*** Settings ***
2
George Keishing18e178d2016-09-27 00:04:17 -05003Documentation This testsuite is for testing the functions of Heartbeat,
Chris Austenb29d2e82016-06-07 12:25:35 -05004... Identify and Power LED's
5
6Resource ../lib/rest_client.robot
7Resource ../lib/resource.txt
George Keishingd55a4be2016-08-26 03:28:17 -05008Resource ../lib/openbmc_ffdc.robot
Gunnar Millseac1af22016-11-14 15:30:09 -06009Test Teardown FFDC On Test Case Fail
Chris Austenb29d2e82016-06-07 12:25:35 -050010
11*** Variables ***
12
13${MIN_TOGGLE_VALUE} 0
14${SAMPLING_FREQUENCY} 6
15
16*** Test Cases ***
17
George Keishingf7226162016-07-08 06:25:07 -050018Validate Heartbeat LEDs Test Cases
19 [Documentation] If heartbeat LED exist then execute the test set.
George Keishing18e178d2016-09-27 00:04:17 -050020 [Tags] Validate_Heartbeat_LEDs_Test_Cases
George Keishingf7226162016-07-08 06:25:07 -050021 ${resp} = OpenBMC Get Request /org/openbmc/control/led/heartbeat
22 Run keyword If ${resp.status_code} == ${HTTP_OK} Execute Heartbeat LEDs Test Cases
23
24Validate Identify LEDs Test Cases
25 [Documentation] If identify LED exist then execute the test set.
George Keishing18e178d2016-09-27 00:04:17 -050026 [Tags] Validate_Identify_LEDs_Test_Cases
George Keishingf7226162016-07-08 06:25:07 -050027 ${resp} = OpenBMC Get Request /org/openbmc/control/led/identify
28 Run keyword If ${resp.status_code} == ${HTTP_OK} Execute Identify LEDs Test Cases
29
30Validate Beep LEDs Test Cases
31 [Documentation] If beep LED exist then execute the test set.
George Keishing18e178d2016-09-27 00:04:17 -050032 [Tags] Validate_Beep_LEDs_Test_Cases
George Keishingf7226162016-07-08 06:25:07 -050033 ${resp} = OpenBMC Get Request /org/openbmc/control/led/beep
34 Run keyword If ${resp.status_code} == ${HTTP_OK} Execute Beep LEDs Test Cases
35
36*** Keywords ***
37
38Execute Heartbeat LEDs Test Cases
39 [Documentation] Executing ON/OFF/Fast/Slow Heartbeat LED test cases.
40 Turn ON the Heartbeat LED
41 Turn OFF the Heartbeat LED
42 Blink Fast the Heartbeat LED
43 Blink Slow the Heartbeat LED
44
45Execute Identify LEDs Test Cases
46 [Documentation] Executing ON/OFF/Fast/Slow Identify LED test cases.
47 Turn ON the Identify LED
48 Turn OFF the Identify LED
49 Blink Fast the Identify LED
50 Blink Slow the Identify LED
51
52Execute Beep LEDs Test Cases
53 [Documentation] Executing ON/OFF/Fast/Slow Beep LED test cases.
54 Turn ON the Beep LED
55 Turn OFF the Beep LED
56 Blink Fast the Beep LED
57 Blink Slow the Beep LED
58
Chris Austenb29d2e82016-06-07 12:25:35 -050059Turn ON the Heartbeat LED
60 [Documentation] This testcase is to test the setOn functionality of the
61 ... Heartbeat LED. The LED state is read again to check if
62 ... the LED is in ON state.
63 Set On heartbeat
64 ${ledstate} = Get LED State heartbeat
65 should be equal as strings ${ledstate} On
66
67Turn OFF the Heartbeat LED
68 [Documentation] This testcase is to test the setOff functionality of the
69 ... Heartbeat LED. The LED state is read again to check if
70 ... the LED is in OFF state.
71 Set Off heartbeat
72 ${ledstate} = Get LED State heartbeat
73 should be equal as strings ${ledstate} Off
74
75Blink Fast the Heartbeat LED
76 [Documentation] This testcase is to test the setBlinkFast functionality of the
77 ... Heartbeat LED. The LED state is sampled to figure out
78 ... whether the LED is blinking. There is no distinguishing
79 ... between whether the LED is blinking fast or slow for
80 ... this testcase to pass.
81 ${OFF_VALUE}= Set Variable ${0}
82 ${ON_VALUE}= Set Variable ${0}
83 Set Blink Fast heartbeat
84 : FOR ${INDEX} IN RANGE 1 ${SAMPLING_FREQUENCY}
85 \ ${ledstate} = Get LED State heartbeat
86 \ ${ON_VALUE} = Set Variable If '${ledstate}'=='On' ${ON_VALUE + 1} ${ON_VALUE}
87 \ ${OFF_VALUE} = Set Variable If '${ledstate}'=='Off' ${OFF_VALUE + 1} ${OFF_VALUE}
88 should be true ${ON_VALUE} > ${MIN_TOGGLE_VALUE} and ${OFF_VALUE} > ${MIN_TOGGLE_VALUE}
89
90Blink Slow the Heartbeat LED
91 [Documentation] This testcase is to test the setBlinkSlow functionality of the
92 ... Heartbeat LED. The LED state is sampled to figure out
93 ... whether the LED is blinking. There is no distinguishing
94 ... between whether the LED is blinking fast or slow for
95 ... this testcase to pass.
96 ${OFF_VALUE}= Set Variable ${0}
97 ${ON_VALUE}= Set Variable ${0}
98 Set Blink Slow heartbeat
99 : FOR ${INDEX} IN RANGE 1 ${SAMPLING_FREQUENCY}
100 \ ${ledstate} = Get LED State heartbeat
101 \ ${ON_VALUE} = Set Variable If '${ledstate}'=='On' ${ON_VALUE + 1} ${ON_VALUE}
102 \ ${OFF_VALUE} = Set Variable If '${ledstate}'=='Off' ${OFF_VALUE + 1} ${OFF_VALUE}
103 should be true ${ON_VALUE} > ${MIN_TOGGLE_VALUE} and ${OFF_VALUE} > ${MIN_TOGGLE_VALUE}
104
105Turn ON the Identify LED
106 [Documentation] This testcase is to test the setOn functionality of the
107 ... Identify LED. The LED state is read again to check if
108 ... the LED is in ON state.
109 Set On identify
110 ${ledstate} = Get LED State identify
111 should be equal as strings ${ledstate} On
112
113Turn OFF the Identify LED
114 [Documentation] This testcase is to test the setOff functionality of the
115 ... Identify LED. The LED state is read again to check if
116 ... the LED is in OFF state.
117 Set Off identify
118 ${ledstate} = Get LED State identify
119 should be equal as strings ${ledstate} Off
120
121Blink Fast the Identify LED
122 [Documentation] This testcase is to test the setBlinkFast functionality of the
123 ... Identify LED. The LED state is sampled to figure out
124 ... whether the LED is blinking. There is no distinguishing
125 ... between whether the LED is blinking fast or slow for
126 ... this testcase to pass.
127 ${OFF_VALUE}= Set Variable ${0}
128 ${ON_VALUE}= Set Variable ${0}
129 Set Blink Fast identify
130 : FOR ${INDEX} IN RANGE 1 ${SAMPLING_FREQUENCY}
131 \ ${ledstate} = Get LED State identify
132 \ ${ON_VALUE} = Set Variable If '${ledstate}'=='On' ${ON_VALUE + 1} ${ON_VALUE}
133 \ ${OFF_VALUE} = Set Variable If '${ledstate}'=='Off' ${OFF_VALUE + 1} ${OFF_VALUE}
134 should be true ${ON_VALUE} > ${MIN_TOGGLE_VALUE} and ${OFF_VALUE} > ${MIN_TOGGLE_VALUE}
135
136Blink Slow the Identify LED
137 [Documentation] This testcase is to test the setBlinkSlow functionality of the
138 ... Identify LED. The LED state is sampled to figure out
139 ... whether the LED is blinking. There is no distinguishing
140 ... between whether the LED is blinking fast or slow for
141 ... this testcase to pass.
142 ${OFF_VALUE}= Set Variable ${0}
143 ${ON_VALUE}= Set Variable ${0}
144 Set Blink Slow identify
145 : FOR ${INDEX} IN RANGE 1 ${SAMPLING_FREQUENCY}
146 \ ${ledstate} = Get LED State identify
147 \ ${ON_VALUE} = Set Variable If '${ledstate}'=='On' ${ON_VALUE + 1} ${ON_VALUE}
148 \ ${OFF_VALUE} = Set Variable If '${ledstate}'=='Off' ${OFF_VALUE + 1} ${OFF_VALUE}
149 should be true ${ON_VALUE} > ${MIN_TOGGLE_VALUE} and ${OFF_VALUE} > ${MIN_TOGGLE_VALUE}
150
151Turn ON the Beep LED
152 [Documentation] This testcase is to test the setOn functionality of the
153 ... Beep LED. The LED state is read again to check if
154 ... the LED is in ON state.
155 Set On beep
156 ${ledstate} = Get LED State beep
157 should be equal as strings ${ledstate} On
158
159Turn OFF the Beep LED
160 [Documentation] This testcase is to test the setOff functionality of the
161 ... Beep LED. The LED state is read again to check if
162 ... the LED is in OFF state.
163 Set Off beep
164 ${ledstate} = Get LED State beep
165 should be equal as strings ${ledstate} Off
166
167Blink Fast the Beep LED
168 [Documentation] This testcase is to test the setBlinkFast functionality of the
169 ... Beep LED. The LED state is sampled to figure out
170 ... whether the LED is blinking. There is no distinguishing
171 ... between whether the LED is blinking fast or slow for
172 ... this testcase to pass.
173 ${OFF_VALUE}= Set Variable ${0}
174 ${ON_VALUE}= Set Variable ${0}
175 ${data} = create dictionary data=@{EMPTY}
176 Set Blink Fast beep
177 : FOR ${INDEX} IN RANGE 1 ${SAMPLING_FREQUENCY}
178 \ ${ledstate} = Get LED State beep
179 \ ${ON_VALUE} = Set Variable If '${ledstate}'=='On' ${ON_VALUE + 1} ${ON_VALUE}
180 \ ${OFF_VALUE} = Set Variable If '${ledstate}'=='Off' ${OFF_VALUE + 1} ${OFF_VALUE}
181 should be true ${ON_VALUE} > ${MIN_TOGGLE_VALUE} and ${OFF_VALUE} > ${MIN_TOGGLE_VALUE}
182
183Blink Slow the Beep LED
184 [Documentation] This testcase is to test the setBlinkSlow functionality of the
185 ... Beep LED. The LED state is sampled to figure out
186 ... whether the LED is blinking. There is no distinguishing
187 ... between whether the LED is blinking fast or slow for
188 ... this testcase to pass.
189 ${OFF_VALUE}= Set Variable ${0}
190 ${ON_VALUE}= Set Variable ${0}
191 Set Blink Slow beep
192 : FOR ${INDEX} IN RANGE 1 ${SAMPLING_FREQUENCY}
193 \ ${ledstate} = Get LED State beep
194 \ ${ON_VALUE} = Set Variable If '${ledstate}'=='On' ${ON_VALUE + 1} ${ON_VALUE}
195 \ ${OFF_VALUE} = Set Variable If '${ledstate}'=='Off' ${OFF_VALUE + 1} ${OFF_VALUE}
196 should be true ${ON_VALUE} > ${MIN_TOGGLE_VALUE} and ${OFF_VALUE} > ${MIN_TOGGLE_VALUE}
George Keishing18e178d2016-09-27 00:04:17 -0500197
Chris Austenb29d2e82016-06-07 12:25:35 -0500198Get LED State
199 [arguments] ${args}
200 ${data} = create dictionary data=@{EMPTY}
201 ${resp} = OpenBMC Post Request /org/openbmc/control/led/${args}/action/GetLedState data=${data}
202 should be equal as strings ${resp.status_code} ${HTTP_OK}
203 ${json} = to json ${resp.content}
204 [return] ${json['data'][1]}
George Keishing18e178d2016-09-27 00:04:17 -0500205
Chris Austenb29d2e82016-06-07 12:25:35 -0500206Set On
207 [arguments] ${args}
208 ${data} = create dictionary data=@{EMPTY}
209 ${resp} = OpenBMC Post Request /org/openbmc/control/led/${args}/action/setOn data=${data}
210 should be equal as strings ${resp.status_code} ${HTTP_OK}
211 ${json} = to json ${resp.content}
212 should be equal as integers ${json['data']} 0
George Keishing18e178d2016-09-27 00:04:17 -0500213
Chris Austenb29d2e82016-06-07 12:25:35 -0500214Set Off
215 [arguments] ${args}
216 ${data} = create dictionary data=@{EMPTY}
217 ${resp} = OpenBMC Post Request /org/openbmc/control/led/${args}/action/setOff data=${data}
218 should be equal as strings ${resp.status_code} ${HTTP_OK}
219 ${json} = to json ${resp.content}
220 should be equal as integers ${json['data']} 0
George Keishing18e178d2016-09-27 00:04:17 -0500221
Chris Austenb29d2e82016-06-07 12:25:35 -0500222Set Blink Fast
223 [arguments] ${args}
224 ${data} = create dictionary data=@{EMPTY}
225 ${resp} = OpenBMC Post Request /org/openbmc/control/led/${args}/action/setBlinkFast data=${data}
226 should be equal as strings ${resp.status_code} ${HTTP_OK}
227 ${json} = to json ${resp.content}
228 should be equal as integers ${json['data']} 0
George Keishing18e178d2016-09-27 00:04:17 -0500229
Chris Austenb29d2e82016-06-07 12:25:35 -0500230Set Blink Slow
231 [arguments] ${args}
232 ${data} = create dictionary data=@{EMPTY}
233 ${resp} = OpenBMC Post Request /org/openbmc/control/led/${args}/action/setBlinkSlow data=${data}
234 should be equal as strings ${resp.status_code} ${HTTP_OK}
235 ${json} = to json ${resp.content}
236 should be equal as integers ${json['data']} 0