blob: b31c3840a40bbbf2a271d9b84fb488bb90f7accb [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
George Keishingab1bd922016-12-05 05:29:59 -060016${LED_CONTROL} ${CONTROL_URI}led/
17
Chris Austenb29d2e82016-06-07 12:25:35 -050018*** Test Cases ***
19
George Keishingf7226162016-07-08 06:25:07 -050020Validate Heartbeat LEDs Test Cases
21 [Documentation] If heartbeat LED exist then execute the test set.
George Keishing18e178d2016-09-27 00:04:17 -050022 [Tags] Validate_Heartbeat_LEDs_Test_Cases
George Keishingab1bd922016-12-05 05:29:59 -060023 ${resp}= OpenBMC Get Request ${LED_CONTROL}heartbeat
George Keishingf7226162016-07-08 06:25:07 -050024 Run keyword If ${resp.status_code} == ${HTTP_OK} Execute Heartbeat LEDs Test Cases
25
26Validate Identify LEDs Test Cases
27 [Documentation] If identify LED exist then execute the test set.
George Keishing18e178d2016-09-27 00:04:17 -050028 [Tags] Validate_Identify_LEDs_Test_Cases
George Keishingab1bd922016-12-05 05:29:59 -060029 ${resp}= OpenBMC Get Request ${LED_CONTROL}identify
George Keishingf7226162016-07-08 06:25:07 -050030 Run keyword If ${resp.status_code} == ${HTTP_OK} Execute Identify LEDs Test Cases
31
32Validate Beep LEDs Test Cases
33 [Documentation] If beep LED exist then execute the test set.
George Keishing18e178d2016-09-27 00:04:17 -050034 [Tags] Validate_Beep_LEDs_Test_Cases
George Keishingab1bd922016-12-05 05:29:59 -060035 ${resp}= OpenBMC Get Request ${LED_CONTROL}beep
George Keishingf7226162016-07-08 06:25:07 -050036 Run keyword If ${resp.status_code} == ${HTTP_OK} Execute Beep LEDs Test Cases
37
38*** Keywords ***
39
40Execute Heartbeat LEDs Test Cases
41 [Documentation] Executing ON/OFF/Fast/Slow Heartbeat LED test cases.
42 Turn ON the Heartbeat LED
43 Turn OFF the Heartbeat LED
44 Blink Fast the Heartbeat LED
45 Blink Slow the Heartbeat LED
46
47Execute Identify LEDs Test Cases
48 [Documentation] Executing ON/OFF/Fast/Slow Identify LED test cases.
49 Turn ON the Identify LED
50 Turn OFF the Identify LED
51 Blink Fast the Identify LED
52 Blink Slow the Identify LED
53
54Execute Beep LEDs Test Cases
55 [Documentation] Executing ON/OFF/Fast/Slow Beep LED test cases.
56 Turn ON the Beep LED
57 Turn OFF the Beep LED
58 Blink Fast the Beep LED
59 Blink Slow the Beep LED
60
Chris Austenb29d2e82016-06-07 12:25:35 -050061Turn ON the Heartbeat LED
62 [Documentation] This testcase is to test the setOn functionality of the
63 ... Heartbeat LED. The LED state is read again to check if
64 ... the LED is in ON state.
65 Set On heartbeat
Gunnar Mills1cd544d2016-12-06 11:19:22 -060066 ${ledstate}= Get LED State heartbeat
Chris Austenb29d2e82016-06-07 12:25:35 -050067 should be equal as strings ${ledstate} On
68
69Turn OFF the Heartbeat LED
70 [Documentation] This testcase is to test the setOff functionality of the
71 ... Heartbeat LED. The LED state is read again to check if
72 ... the LED is in OFF state.
73 Set Off heartbeat
Gunnar Mills1cd544d2016-12-06 11:19:22 -060074 ${ledstate}= Get LED State heartbeat
Chris Austenb29d2e82016-06-07 12:25:35 -050075 should be equal as strings ${ledstate} Off
76
77Blink Fast the Heartbeat LED
78 [Documentation] This testcase is to test the setBlinkFast functionality of the
79 ... Heartbeat LED. The LED state is sampled to figure out
80 ... whether the LED is blinking. There is no distinguishing
81 ... between whether the LED is blinking fast or slow for
82 ... this testcase to pass.
83 ${OFF_VALUE}= Set Variable ${0}
84 ${ON_VALUE}= Set Variable ${0}
85 Set Blink Fast heartbeat
86 : FOR ${INDEX} IN RANGE 1 ${SAMPLING_FREQUENCY}
Gunnar Mills1cd544d2016-12-06 11:19:22 -060087 \ ${ledstate}= Get LED State heartbeat
88 \ ${ON_VALUE}= Set Variable If '${ledstate}'=='On' ${ON_VALUE + 1} ${ON_VALUE}
89 \ ${OFF_VALUE}= Set Variable If '${ledstate}'=='Off' ${OFF_VALUE + 1} ${OFF_VALUE}
Chris Austenb29d2e82016-06-07 12:25:35 -050090 should be true ${ON_VALUE} > ${MIN_TOGGLE_VALUE} and ${OFF_VALUE} > ${MIN_TOGGLE_VALUE}
91
92Blink Slow the Heartbeat LED
93 [Documentation] This testcase is to test the setBlinkSlow functionality of the
94 ... Heartbeat LED. The LED state is sampled to figure out
95 ... whether the LED is blinking. There is no distinguishing
96 ... between whether the LED is blinking fast or slow for
97 ... this testcase to pass.
98 ${OFF_VALUE}= Set Variable ${0}
99 ${ON_VALUE}= Set Variable ${0}
100 Set Blink Slow heartbeat
101 : FOR ${INDEX} IN RANGE 1 ${SAMPLING_FREQUENCY}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600102 \ ${ledstate}= Get LED State heartbeat
103 \ ${ON_VALUE}= Set Variable If '${ledstate}'=='On' ${ON_VALUE + 1} ${ON_VALUE}
104 \ ${OFF_VALUE}= Set Variable If '${ledstate}'=='Off' ${OFF_VALUE + 1} ${OFF_VALUE}
Chris Austenb29d2e82016-06-07 12:25:35 -0500105 should be true ${ON_VALUE} > ${MIN_TOGGLE_VALUE} and ${OFF_VALUE} > ${MIN_TOGGLE_VALUE}
106
107Turn ON the Identify LED
108 [Documentation] This testcase is to test the setOn functionality of the
109 ... Identify LED. The LED state is read again to check if
110 ... the LED is in ON state.
111 Set On identify
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600112 ${ledstate}= Get LED State identify
Chris Austenb29d2e82016-06-07 12:25:35 -0500113 should be equal as strings ${ledstate} On
114
115Turn OFF the Identify LED
116 [Documentation] This testcase is to test the setOff functionality of the
117 ... Identify LED. The LED state is read again to check if
118 ... the LED is in OFF state.
119 Set Off identify
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600120 ${ledstate}= Get LED State identify
Chris Austenb29d2e82016-06-07 12:25:35 -0500121 should be equal as strings ${ledstate} Off
122
123Blink Fast the Identify LED
124 [Documentation] This testcase is to test the setBlinkFast functionality of the
125 ... Identify LED. The LED state is sampled to figure out
126 ... whether the LED is blinking. There is no distinguishing
127 ... between whether the LED is blinking fast or slow for
128 ... this testcase to pass.
129 ${OFF_VALUE}= Set Variable ${0}
130 ${ON_VALUE}= Set Variable ${0}
131 Set Blink Fast identify
132 : FOR ${INDEX} IN RANGE 1 ${SAMPLING_FREQUENCY}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600133 \ ${ledstate}= Get LED State identify
134 \ ${ON_VALUE}= Set Variable If '${ledstate}'=='On' ${ON_VALUE + 1} ${ON_VALUE}
135 \ ${OFF_VALUE}= Set Variable If '${ledstate}'=='Off' ${OFF_VALUE + 1} ${OFF_VALUE}
Chris Austenb29d2e82016-06-07 12:25:35 -0500136 should be true ${ON_VALUE} > ${MIN_TOGGLE_VALUE} and ${OFF_VALUE} > ${MIN_TOGGLE_VALUE}
137
138Blink Slow the Identify LED
139 [Documentation] This testcase is to test the setBlinkSlow functionality of the
140 ... Identify LED. The LED state is sampled to figure out
141 ... whether the LED is blinking. There is no distinguishing
142 ... between whether the LED is blinking fast or slow for
143 ... this testcase to pass.
144 ${OFF_VALUE}= Set Variable ${0}
145 ${ON_VALUE}= Set Variable ${0}
146 Set Blink Slow identify
147 : FOR ${INDEX} IN RANGE 1 ${SAMPLING_FREQUENCY}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600148 \ ${ledstate}= Get LED State identify
149 \ ${ON_VALUE}= Set Variable If '${ledstate}'=='On' ${ON_VALUE + 1} ${ON_VALUE}
150 \ ${OFF_VALUE}= Set Variable If '${ledstate}'=='Off' ${OFF_VALUE + 1} ${OFF_VALUE}
Chris Austenb29d2e82016-06-07 12:25:35 -0500151 should be true ${ON_VALUE} > ${MIN_TOGGLE_VALUE} and ${OFF_VALUE} > ${MIN_TOGGLE_VALUE}
152
153Turn ON the Beep LED
154 [Documentation] This testcase is to test the setOn functionality of the
155 ... Beep LED. The LED state is read again to check if
156 ... the LED is in ON state.
157 Set On beep
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600158 ${ledstate}= Get LED State beep
Chris Austenb29d2e82016-06-07 12:25:35 -0500159 should be equal as strings ${ledstate} On
160
161Turn OFF the Beep LED
162 [Documentation] This testcase is to test the setOff functionality of the
163 ... Beep LED. The LED state is read again to check if
164 ... the LED is in OFF state.
165 Set Off beep
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600166 ${ledstate}= Get LED State beep
Chris Austenb29d2e82016-06-07 12:25:35 -0500167 should be equal as strings ${ledstate} Off
168
169Blink Fast the Beep LED
170 [Documentation] This testcase is to test the setBlinkFast functionality of the
171 ... Beep LED. The LED state is sampled to figure out
172 ... whether the LED is blinking. There is no distinguishing
173 ... between whether the LED is blinking fast or slow for
174 ... this testcase to pass.
175 ${OFF_VALUE}= Set Variable ${0}
176 ${ON_VALUE}= Set Variable ${0}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600177 ${data}= create dictionary data=@{EMPTY}
Chris Austenb29d2e82016-06-07 12:25:35 -0500178 Set Blink Fast beep
179 : FOR ${INDEX} IN RANGE 1 ${SAMPLING_FREQUENCY}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600180 \ ${ledstate}= Get LED State beep
181 \ ${ON_VALUE}= Set Variable If '${ledstate}'=='On' ${ON_VALUE + 1} ${ON_VALUE}
182 \ ${OFF_VALUE}= Set Variable If '${ledstate}'=='Off' ${OFF_VALUE + 1} ${OFF_VALUE}
Chris Austenb29d2e82016-06-07 12:25:35 -0500183 should be true ${ON_VALUE} > ${MIN_TOGGLE_VALUE} and ${OFF_VALUE} > ${MIN_TOGGLE_VALUE}
184
185Blink Slow the Beep LED
186 [Documentation] This testcase is to test the setBlinkSlow functionality of the
187 ... Beep LED. The LED state is sampled to figure out
188 ... whether the LED is blinking. There is no distinguishing
189 ... between whether the LED is blinking fast or slow for
190 ... this testcase to pass.
191 ${OFF_VALUE}= Set Variable ${0}
192 ${ON_VALUE}= Set Variable ${0}
193 Set Blink Slow beep
194 : FOR ${INDEX} IN RANGE 1 ${SAMPLING_FREQUENCY}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600195 \ ${ledstate}= Get LED State beep
196 \ ${ON_VALUE}= Set Variable If '${ledstate}'=='On' ${ON_VALUE + 1} ${ON_VALUE}
197 \ ${OFF_VALUE}= Set Variable If '${ledstate}'=='Off' ${OFF_VALUE + 1} ${OFF_VALUE}
Chris Austenb29d2e82016-06-07 12:25:35 -0500198 should be true ${ON_VALUE} > ${MIN_TOGGLE_VALUE} and ${OFF_VALUE} > ${MIN_TOGGLE_VALUE}
George Keishing18e178d2016-09-27 00:04:17 -0500199
Chris Austenb29d2e82016-06-07 12:25:35 -0500200Get LED State
Gunnar Mills38032802016-12-12 13:43:40 -0600201 [Arguments] ${args}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600202 ${data}= create dictionary data=@{EMPTY}
George Keishingab1bd922016-12-05 05:29:59 -0600203 ${resp}= OpenBMC Post Request ${LED_CONTROL}${args}/action/GetLedState data=${data}
Chris Austenb29d2e82016-06-07 12:25:35 -0500204 should be equal as strings ${resp.status_code} ${HTTP_OK}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600205 ${json}= to json ${resp.content}
Gunnar Millsc9ea9362016-12-13 16:21:13 -0600206 [Return] ${json['data'][1]}
George Keishing18e178d2016-09-27 00:04:17 -0500207
Chris Austenb29d2e82016-06-07 12:25:35 -0500208Set On
Gunnar Mills38032802016-12-12 13:43:40 -0600209 [Arguments] ${args}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600210 ${data}= create dictionary data=@{EMPTY}
George Keishingab1bd922016-12-05 05:29:59 -0600211 ${resp}= OpenBMC Post Request ${LED_CONTROL}${args}/action/setOn data=${data}
Chris Austenb29d2e82016-06-07 12:25:35 -0500212 should be equal as strings ${resp.status_code} ${HTTP_OK}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600213 ${json}= to json ${resp.content}
Chris Austenb29d2e82016-06-07 12:25:35 -0500214 should be equal as integers ${json['data']} 0
George Keishing18e178d2016-09-27 00:04:17 -0500215
Chris Austenb29d2e82016-06-07 12:25:35 -0500216Set Off
Gunnar Mills38032802016-12-12 13:43:40 -0600217 [Arguments] ${args}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600218 ${data}= create dictionary data=@{EMPTY}
George Keishingab1bd922016-12-05 05:29:59 -0600219 ${resp}= OpenBMC Post Request ${LED_CONTROL}${args}/action/setOff data=${data}
Chris Austenb29d2e82016-06-07 12:25:35 -0500220 should be equal as strings ${resp.status_code} ${HTTP_OK}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600221 ${json}= to json ${resp.content}
Chris Austenb29d2e82016-06-07 12:25:35 -0500222 should be equal as integers ${json['data']} 0
George Keishing18e178d2016-09-27 00:04:17 -0500223
Chris Austenb29d2e82016-06-07 12:25:35 -0500224Set Blink Fast
Gunnar Mills38032802016-12-12 13:43:40 -0600225 [Arguments] ${args}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600226 ${data}= create dictionary data=@{EMPTY}
George Keishingab1bd922016-12-05 05:29:59 -0600227 ${resp}= OpenBMC Post Request ${LED_CONTROL}${args}/action/setBlinkFast data=${data}
Chris Austenb29d2e82016-06-07 12:25:35 -0500228 should be equal as strings ${resp.status_code} ${HTTP_OK}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600229 ${json}= to json ${resp.content}
Chris Austenb29d2e82016-06-07 12:25:35 -0500230 should be equal as integers ${json['data']} 0
George Keishing18e178d2016-09-27 00:04:17 -0500231
Chris Austenb29d2e82016-06-07 12:25:35 -0500232Set Blink Slow
Gunnar Mills38032802016-12-12 13:43:40 -0600233 [Arguments] ${args}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600234 ${data}= create dictionary data=@{EMPTY}
George Keishingab1bd922016-12-05 05:29:59 -0600235 ${resp}= OpenBMC Post Request ${LED_CONTROL}${args}/action/setBlinkSlow data=${data}
Chris Austenb29d2e82016-06-07 12:25:35 -0500236 should be equal as strings ${resp.status_code} ${HTTP_OK}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600237 ${json}= to json ${resp.content}
Chris Austenb29d2e82016-06-07 12:25:35 -0500238 should be equal as integers ${json['data']} 0