blob: 9097104379327efd7ebe1eba9d231e958fe8b625 [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
Gunnar Mills1cd544d2016-12-06 11:19:22 -060021 ${resp}= OpenBMC Get Request /org/openbmc/control/led/heartbeat
George Keishingf7226162016-07-08 06:25:07 -050022 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
Gunnar Mills1cd544d2016-12-06 11:19:22 -060027 ${resp}= OpenBMC Get Request /org/openbmc/control/led/identify
George Keishingf7226162016-07-08 06:25:07 -050028 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
Gunnar Mills1cd544d2016-12-06 11:19:22 -060033 ${resp}= OpenBMC Get Request /org/openbmc/control/led/beep
George Keishingf7226162016-07-08 06:25:07 -050034 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
Gunnar Mills1cd544d2016-12-06 11:19:22 -060064 ${ledstate}= Get LED State heartbeat
Chris Austenb29d2e82016-06-07 12:25:35 -050065 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
Gunnar Mills1cd544d2016-12-06 11:19:22 -060072 ${ledstate}= Get LED State heartbeat
Chris Austenb29d2e82016-06-07 12:25:35 -050073 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}
Gunnar Mills1cd544d2016-12-06 11:19:22 -060085 \ ${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}
Chris Austenb29d2e82016-06-07 12:25:35 -050088 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}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600100 \ ${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}
Chris Austenb29d2e82016-06-07 12:25:35 -0500103 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
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600110 ${ledstate}= Get LED State identify
Chris Austenb29d2e82016-06-07 12:25:35 -0500111 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
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600118 ${ledstate}= Get LED State identify
Chris Austenb29d2e82016-06-07 12:25:35 -0500119 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}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600131 \ ${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}
Chris Austenb29d2e82016-06-07 12:25:35 -0500134 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}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600146 \ ${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}
Chris Austenb29d2e82016-06-07 12:25:35 -0500149 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
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600156 ${ledstate}= Get LED State beep
Chris Austenb29d2e82016-06-07 12:25:35 -0500157 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
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600164 ${ledstate}= Get LED State beep
Chris Austenb29d2e82016-06-07 12:25:35 -0500165 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}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600175 ${data}= create dictionary data=@{EMPTY}
Chris Austenb29d2e82016-06-07 12:25:35 -0500176 Set Blink Fast beep
177 : FOR ${INDEX} IN RANGE 1 ${SAMPLING_FREQUENCY}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600178 \ ${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}
Chris Austenb29d2e82016-06-07 12:25:35 -0500181 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}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600193 \ ${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}
Chris Austenb29d2e82016-06-07 12:25:35 -0500196 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}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600200 ${data}= create dictionary data=@{EMPTY}
201 ${resp}= OpenBMC Post Request /org/openbmc/control/led/${args}/action/GetLedState data=${data}
Chris Austenb29d2e82016-06-07 12:25:35 -0500202 should be equal as strings ${resp.status_code} ${HTTP_OK}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600203 ${json}= to json ${resp.content}
Chris Austenb29d2e82016-06-07 12:25:35 -0500204 [return] ${json['data'][1]}
George Keishing18e178d2016-09-27 00:04:17 -0500205
Chris Austenb29d2e82016-06-07 12:25:35 -0500206Set On
207 [arguments] ${args}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600208 ${data}= create dictionary data=@{EMPTY}
209 ${resp}= OpenBMC Post Request /org/openbmc/control/led/${args}/action/setOn data=${data}
Chris Austenb29d2e82016-06-07 12:25:35 -0500210 should be equal as strings ${resp.status_code} ${HTTP_OK}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600211 ${json}= to json ${resp.content}
Chris Austenb29d2e82016-06-07 12:25:35 -0500212 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}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600216 ${data}= create dictionary data=@{EMPTY}
217 ${resp}= OpenBMC Post Request /org/openbmc/control/led/${args}/action/setOff data=${data}
Chris Austenb29d2e82016-06-07 12:25:35 -0500218 should be equal as strings ${resp.status_code} ${HTTP_OK}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600219 ${json}= to json ${resp.content}
Chris Austenb29d2e82016-06-07 12:25:35 -0500220 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}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600224 ${data}= create dictionary data=@{EMPTY}
225 ${resp}= OpenBMC Post Request /org/openbmc/control/led/${args}/action/setBlinkFast data=${data}
Chris Austenb29d2e82016-06-07 12:25:35 -0500226 should be equal as strings ${resp.status_code} ${HTTP_OK}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600227 ${json}= to json ${resp.content}
Chris Austenb29d2e82016-06-07 12:25:35 -0500228 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}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600232 ${data}= create dictionary data=@{EMPTY}
233 ${resp}= OpenBMC Post Request /org/openbmc/control/led/${args}/action/setBlinkSlow data=${data}
Chris Austenb29d2e82016-06-07 12:25:35 -0500234 should be equal as strings ${resp.status_code} ${HTTP_OK}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600235 ${json}= to json ${resp.content}
Chris Austenb29d2e82016-06-07 12:25:35 -0500236 should be equal as integers ${json['data']} 0