| 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 |  | 
|  | 16 | *** Test Cases *** | 
|  | 17 |  | 
| George Keishing | f722616 | 2016-07-08 06:25:07 -0500 | [diff] [blame] | 18 | Validate Heartbeat LEDs Test Cases | 
|  | 19 | [Documentation]   If heartbeat LED exist then execute the test set. | 
| George Keishing | 18e178d | 2016-09-27 00:04:17 -0500 | [diff] [blame] | 20 | [Tags]  Validate_Heartbeat_LEDs_Test_Cases | 
| Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 21 | ${resp}=   OpenBMC Get Request   /org/openbmc/control/led/heartbeat | 
| George Keishing | f722616 | 2016-07-08 06:25:07 -0500 | [diff] [blame] | 22 | Run keyword If  ${resp.status_code} == ${HTTP_OK}   Execute Heartbeat LEDs Test Cases | 
|  | 23 |  | 
|  | 24 | Validate Identify LEDs Test Cases | 
|  | 25 | [Documentation]   If identify LED exist then execute the test set. | 
| George Keishing | 18e178d | 2016-09-27 00:04:17 -0500 | [diff] [blame] | 26 | [Tags]  Validate_Identify_LEDs_Test_Cases | 
| Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 27 | ${resp}=   OpenBMC Get Request   /org/openbmc/control/led/identify | 
| George Keishing | f722616 | 2016-07-08 06:25:07 -0500 | [diff] [blame] | 28 | Run keyword If  ${resp.status_code} == ${HTTP_OK}   Execute Identify LEDs Test Cases | 
|  | 29 |  | 
|  | 30 | Validate Beep LEDs Test Cases | 
|  | 31 | [Documentation]   If beep LED exist then execute the test set. | 
| George Keishing | 18e178d | 2016-09-27 00:04:17 -0500 | [diff] [blame] | 32 | [Tags]  Validate_Beep_LEDs_Test_Cases | 
| Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 33 | ${resp}=   OpenBMC Get Request   /org/openbmc/control/led/beep | 
| George Keishing | f722616 | 2016-07-08 06:25:07 -0500 | [diff] [blame] | 34 | Run keyword If  ${resp.status_code} == ${HTTP_OK}  Execute Beep LEDs Test Cases | 
|  | 35 |  | 
|  | 36 | *** Keywords *** | 
|  | 37 |  | 
|  | 38 | Execute 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 |  | 
|  | 45 | Execute 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 |  | 
|  | 52 | Execute 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 Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 59 | Turn 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 Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 64 | ${ledstate}=   Get LED State   heartbeat | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 65 | should be equal as strings   ${ledstate}   On | 
|  | 66 |  | 
|  | 67 | Turn 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 Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 72 | ${ledstate}=   Get LED State   heartbeat | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 73 | should be equal as strings   ${ledstate}   Off | 
|  | 74 |  | 
|  | 75 | Blink 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 Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 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} | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 88 | should be true   ${ON_VALUE} > ${MIN_TOGGLE_VALUE} and ${OFF_VALUE} > ${MIN_TOGGLE_VALUE} | 
|  | 89 |  | 
|  | 90 | Blink 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 Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 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} | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 103 | should be true   ${ON_VALUE} > ${MIN_TOGGLE_VALUE} and ${OFF_VALUE} > ${MIN_TOGGLE_VALUE} | 
|  | 104 |  | 
|  | 105 | Turn 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 Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 110 | ${ledstate}=   Get LED State   identify | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 111 | should be equal as strings   ${ledstate}   On | 
|  | 112 |  | 
|  | 113 | Turn 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 Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 118 | ${ledstate}=   Get LED State   identify | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 119 | should be equal as strings   ${ledstate}   Off | 
|  | 120 |  | 
|  | 121 | Blink 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 Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 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} | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 134 | should be true   ${ON_VALUE} > ${MIN_TOGGLE_VALUE} and ${OFF_VALUE} > ${MIN_TOGGLE_VALUE} | 
|  | 135 |  | 
|  | 136 | Blink 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 Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 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} | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 149 | should be true   ${ON_VALUE} > ${MIN_TOGGLE_VALUE} and ${OFF_VALUE} > ${MIN_TOGGLE_VALUE} | 
|  | 150 |  | 
|  | 151 | Turn 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 Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 156 | ${ledstate}=   Get LED State   beep | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 157 | should be equal as strings   ${ledstate}   On | 
|  | 158 |  | 
|  | 159 | Turn 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 Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 164 | ${ledstate}=   Get LED State   beep | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 165 | should be equal as strings   ${ledstate}   Off | 
|  | 166 |  | 
|  | 167 | Blink 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 Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 175 | ${data}=   create dictionary   data=@{EMPTY} | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 176 | Set Blink Fast   beep | 
|  | 177 | : FOR   ${INDEX}   IN RANGE   1   ${SAMPLING_FREQUENCY} | 
| Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 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} | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 181 | should be true   ${ON_VALUE} > ${MIN_TOGGLE_VALUE} and ${OFF_VALUE} > ${MIN_TOGGLE_VALUE} | 
|  | 182 |  | 
|  | 183 | Blink 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 Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 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} | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 196 | 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] | 197 |  | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 198 | Get LED State | 
|  | 199 | [arguments]    ${args} | 
| Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 200 | ${data}=   create dictionary   data=@{EMPTY} | 
|  | 201 | ${resp}=   OpenBMC Post Request   /org/openbmc/control/led/${args}/action/GetLedState   data=${data} | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 202 | should be equal as strings   ${resp.status_code}   ${HTTP_OK} | 
| Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 203 | ${json}=   to json   ${resp.content} | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 204 | [return]    ${json['data'][1]} | 
| George Keishing | 18e178d | 2016-09-27 00:04:17 -0500 | [diff] [blame] | 205 |  | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 206 | Set On | 
|  | 207 | [arguments]    ${args} | 
| Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 208 | ${data}=   create dictionary   data=@{EMPTY} | 
|  | 209 | ${resp}=   OpenBMC Post Request   /org/openbmc/control/led/${args}/action/setOn   data=${data} | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 210 | should be equal as strings   ${resp.status_code}   ${HTTP_OK} | 
| Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 211 | ${json}=   to json   ${resp.content} | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 212 | should be equal as integers   ${json['data']}   0 | 
| George Keishing | 18e178d | 2016-09-27 00:04:17 -0500 | [diff] [blame] | 213 |  | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 214 | Set Off | 
|  | 215 | [arguments]    ${args} | 
| Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 216 | ${data}=   create dictionary   data=@{EMPTY} | 
|  | 217 | ${resp}=   OpenBMC Post Request   /org/openbmc/control/led/${args}/action/setOff   data=${data} | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 218 | should be equal as strings   ${resp.status_code}   ${HTTP_OK} | 
| Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 219 | ${json}=   to json   ${resp.content} | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 220 | should be equal as integers   ${json['data']}   0 | 
| George Keishing | 18e178d | 2016-09-27 00:04:17 -0500 | [diff] [blame] | 221 |  | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 222 | Set Blink Fast | 
|  | 223 | [arguments]    ${args} | 
| Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 224 | ${data}=   create dictionary   data=@{EMPTY} | 
|  | 225 | ${resp}=   OpenBMC Post Request   /org/openbmc/control/led/${args}/action/setBlinkFast   data=${data} | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 226 | should be equal as strings   ${resp.status_code}   ${HTTP_OK} | 
| Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 227 | ${json}=   to json   ${resp.content} | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 228 | should be equal as integers   ${json['data']}   0 | 
| George Keishing | 18e178d | 2016-09-27 00:04:17 -0500 | [diff] [blame] | 229 |  | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 230 | Set Blink Slow | 
|  | 231 | [arguments]    ${args} | 
| Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 232 | ${data}=   create dictionary   data=@{EMPTY} | 
|  | 233 | ${resp}=   OpenBMC Post Request   /org/openbmc/control/led/${args}/action/setBlinkSlow   data=${data} | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 234 | should be equal as strings   ${resp.status_code}   ${HTTP_OK} | 
| Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 235 | ${json}=   to json   ${resp.content} | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 236 | should be equal as integers   ${json['data']}   0 |