Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
George Keishing | 18e178d | 2016-09-27 00:04:17 -0500 | [diff] [blame] | 3 | Documentation This testsuite is for testing the functions of Heartbeat, |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 4 | ... Identify and Power LED's |
| 5 | |
| 6 | Resource ../lib/rest_client.robot |
| 7 | Resource ../lib/resource.txt |
George Keishing | d55a4be | 2016-08-26 03:28:17 -0500 | [diff] [blame] | 8 | Resource ../lib/openbmc_ffdc.robot |
Gunnar Mills | eac1af2 | 2016-11-14 15:30:09 -0600 | [diff] [blame] | 9 | Test Teardown FFDC On Test Case Fail |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 10 | |
| 11 | *** Variables *** |
| 12 | |
| 13 | ${MIN_TOGGLE_VALUE} 0 |
| 14 | ${SAMPLING_FREQUENCY} 6 |
| 15 | |
George Keishing | ab1bd92 | 2016-12-05 05:29:59 -0600 | [diff] [blame] | 16 | ${LED_CONTROL} ${CONTROL_URI}led/ |
| 17 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 18 | *** Test Cases *** |
| 19 | |
George Keishing | f722616 | 2016-07-08 06:25:07 -0500 | [diff] [blame] | 20 | Validate Heartbeat LEDs Test Cases |
| 21 | [Documentation] If heartbeat LED exist then execute the test set. |
George Keishing | 18e178d | 2016-09-27 00:04:17 -0500 | [diff] [blame] | 22 | [Tags] Validate_Heartbeat_LEDs_Test_Cases |
George Keishing | ab1bd92 | 2016-12-05 05:29:59 -0600 | [diff] [blame] | 23 | ${resp}= OpenBMC Get Request ${LED_CONTROL}heartbeat |
George Keishing | f722616 | 2016-07-08 06:25:07 -0500 | [diff] [blame] | 24 | Run keyword If ${resp.status_code} == ${HTTP_OK} Execute Heartbeat LEDs Test Cases |
| 25 | |
| 26 | Validate Identify LEDs Test Cases |
| 27 | [Documentation] If identify LED exist then execute the test set. |
George Keishing | 18e178d | 2016-09-27 00:04:17 -0500 | [diff] [blame] | 28 | [Tags] Validate_Identify_LEDs_Test_Cases |
George Keishing | ab1bd92 | 2016-12-05 05:29:59 -0600 | [diff] [blame] | 29 | ${resp}= OpenBMC Get Request ${LED_CONTROL}identify |
George Keishing | f722616 | 2016-07-08 06:25:07 -0500 | [diff] [blame] | 30 | Run keyword If ${resp.status_code} == ${HTTP_OK} Execute Identify LEDs Test Cases |
| 31 | |
| 32 | Validate Beep LEDs Test Cases |
| 33 | [Documentation] If beep LED exist then execute the test set. |
George Keishing | 18e178d | 2016-09-27 00:04:17 -0500 | [diff] [blame] | 34 | [Tags] Validate_Beep_LEDs_Test_Cases |
George Keishing | ab1bd92 | 2016-12-05 05:29:59 -0600 | [diff] [blame] | 35 | ${resp}= OpenBMC Get Request ${LED_CONTROL}beep |
George Keishing | f722616 | 2016-07-08 06:25:07 -0500 | [diff] [blame] | 36 | Run keyword If ${resp.status_code} == ${HTTP_OK} Execute Beep LEDs Test Cases |
| 37 | |
| 38 | *** Keywords *** |
| 39 | |
| 40 | Execute 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 | |
| 47 | Execute 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 | |
| 54 | Execute 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 Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 61 | Turn 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 Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 66 | ${ledstate}= Get LED State heartbeat |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 67 | should be equal as strings ${ledstate} On |
| 68 | |
| 69 | Turn 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 Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 74 | ${ledstate}= Get LED State heartbeat |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 75 | should be equal as strings ${ledstate} Off |
| 76 | |
| 77 | Blink 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 Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 87 | \ ${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 Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 90 | should be true ${ON_VALUE} > ${MIN_TOGGLE_VALUE} and ${OFF_VALUE} > ${MIN_TOGGLE_VALUE} |
| 91 | |
| 92 | Blink 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 Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 102 | \ ${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 Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 105 | should be true ${ON_VALUE} > ${MIN_TOGGLE_VALUE} and ${OFF_VALUE} > ${MIN_TOGGLE_VALUE} |
| 106 | |
| 107 | Turn 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 Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 112 | ${ledstate}= Get LED State identify |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 113 | should be equal as strings ${ledstate} On |
| 114 | |
| 115 | Turn 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 Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 120 | ${ledstate}= Get LED State identify |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 121 | should be equal as strings ${ledstate} Off |
| 122 | |
| 123 | Blink 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 Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 133 | \ ${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 Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 136 | should be true ${ON_VALUE} > ${MIN_TOGGLE_VALUE} and ${OFF_VALUE} > ${MIN_TOGGLE_VALUE} |
| 137 | |
| 138 | Blink 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 Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 148 | \ ${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 Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 151 | should be true ${ON_VALUE} > ${MIN_TOGGLE_VALUE} and ${OFF_VALUE} > ${MIN_TOGGLE_VALUE} |
| 152 | |
| 153 | Turn 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 Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 158 | ${ledstate}= Get LED State beep |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 159 | should be equal as strings ${ledstate} On |
| 160 | |
| 161 | Turn 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 Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 166 | ${ledstate}= Get LED State beep |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 167 | should be equal as strings ${ledstate} Off |
| 168 | |
| 169 | Blink 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 Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 177 | ${data}= create dictionary data=@{EMPTY} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 178 | Set Blink Fast beep |
| 179 | : FOR ${INDEX} IN RANGE 1 ${SAMPLING_FREQUENCY} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 180 | \ ${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 Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 183 | should be true ${ON_VALUE} > ${MIN_TOGGLE_VALUE} and ${OFF_VALUE} > ${MIN_TOGGLE_VALUE} |
| 184 | |
| 185 | Blink 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 Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 195 | \ ${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 Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 198 | should be true ${ON_VALUE} > ${MIN_TOGGLE_VALUE} and ${OFF_VALUE} > ${MIN_TOGGLE_VALUE} |
George Keishing | 18e178d | 2016-09-27 00:04:17 -0500 | [diff] [blame] | 199 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 200 | Get LED State |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 201 | [Arguments] ${args} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 202 | ${data}= create dictionary data=@{EMPTY} |
George Keishing | ab1bd92 | 2016-12-05 05:29:59 -0600 | [diff] [blame] | 203 | ${resp}= OpenBMC Post Request ${LED_CONTROL}${args}/action/GetLedState data=${data} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 204 | should be equal as strings ${resp.status_code} ${HTTP_OK} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 205 | ${json}= to json ${resp.content} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 206 | [return] ${json['data'][1]} |
George Keishing | 18e178d | 2016-09-27 00:04:17 -0500 | [diff] [blame] | 207 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 208 | Set On |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 209 | [Arguments] ${args} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 210 | ${data}= create dictionary data=@{EMPTY} |
George Keishing | ab1bd92 | 2016-12-05 05:29:59 -0600 | [diff] [blame] | 211 | ${resp}= OpenBMC Post Request ${LED_CONTROL}${args}/action/setOn data=${data} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 212 | should be equal as strings ${resp.status_code} ${HTTP_OK} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 213 | ${json}= to json ${resp.content} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 214 | should be equal as integers ${json['data']} 0 |
George Keishing | 18e178d | 2016-09-27 00:04:17 -0500 | [diff] [blame] | 215 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 216 | Set Off |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 217 | [Arguments] ${args} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 218 | ${data}= create dictionary data=@{EMPTY} |
George Keishing | ab1bd92 | 2016-12-05 05:29:59 -0600 | [diff] [blame] | 219 | ${resp}= OpenBMC Post Request ${LED_CONTROL}${args}/action/setOff data=${data} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 220 | should be equal as strings ${resp.status_code} ${HTTP_OK} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 221 | ${json}= to json ${resp.content} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 222 | should be equal as integers ${json['data']} 0 |
George Keishing | 18e178d | 2016-09-27 00:04:17 -0500 | [diff] [blame] | 223 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 224 | Set Blink Fast |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 225 | [Arguments] ${args} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 226 | ${data}= create dictionary data=@{EMPTY} |
George Keishing | ab1bd92 | 2016-12-05 05:29:59 -0600 | [diff] [blame] | 227 | ${resp}= OpenBMC Post Request ${LED_CONTROL}${args}/action/setBlinkFast data=${data} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 228 | should be equal as strings ${resp.status_code} ${HTTP_OK} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 229 | ${json}= to json ${resp.content} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 230 | should be equal as integers ${json['data']} 0 |
George Keishing | 18e178d | 2016-09-27 00:04:17 -0500 | [diff] [blame] | 231 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 232 | Set Blink Slow |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 233 | [Arguments] ${args} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 234 | ${data}= create dictionary data=@{EMPTY} |
George Keishing | ab1bd92 | 2016-12-05 05:29:59 -0600 | [diff] [blame] | 235 | ${resp}= OpenBMC Post Request ${LED_CONTROL}${args}/action/setBlinkSlow data=${data} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 236 | should be equal as strings ${resp.status_code} ${HTTP_OK} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 237 | ${json}= to json ${resp.content} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 238 | should be equal as integers ${json['data']} 0 |