1 # Copyright (c) 2017 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
6 # http://www.apache.org/licenses/LICENSE-2.0
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
15 | Library | resources.libraries.python.honeycomb.HoneycombSetup
16 | Library | resources.libraries.python.honeycomb.HoneycombUtil
17 | Library | resources.libraries.python.honeycomb.HcPersistence
18 | Library | resources.libraries.python.DUTSetup
19 | Library | resources.libraries.python.InterfaceUtil
20 | Resource | resources/libraries/robot/shared/default.robot
23 | Configure Honeycomb service on DUTs
24 | | [Documentation] | *Setup environment for honeycomb testing.*
26 | | ... | _Setup steps:_
27 | | ... | - 1. Login to each honeycomb node using ssh
28 | | ... | - 2. Startup honeycomb service
29 | | ... | - 3. Monitor service startup using HTTP GET request loop
30 | | ... | Expected sequence of HTTP replies:
31 | | ... | connection refused -> 404 -> 401 -> 503 or 500 -> 200 (pass)
32 | | ... | - 4. Configure honeycomb nodes using HTTP PUT request
34 | | ... | _Arguments:_
35 | | ... | - duts - list of nodes to setup Honeycomb on
37 | | ... | _Used global constants and variables:_
38 | | ... | - RESOURCES_TPL_HC - path to honeycomb templates directory
39 | | ... | - HTTPCodes - HTTP protocol status codes
41 | | [Arguments] | @{duts}
42 | | Start honeycomb on DUTs | @{duts}
43 | | :FOR | ${dut} | IN | @{duts}
44 | | | Check honeycomb startup state | @{duts}
45 | | | Sleep | 5s | Make sure all modules are loaded and ready.
47 | Stop Honeycomb service on DUTs
48 | | [Documentation] | *Cleanup environment after honeycomb testing.*
50 | | ... | _Teardown steps:_
51 | | ... | - 1. Login to each honeycomb node using ssh
52 | | ... | - 2. Stop honeycomb service
53 | | ... | - 3. Monitor service shutdown using HTTP GET request loop
54 | | ... | Expected sequence of HTTP replies:
55 | | ... | 200 -> 404 -> connection refused (pass)
57 | | ... | _Arguments:_
58 | | ... | - duts - list of nodes to stop Honeycomb on
60 | | ... | _Used global constants and variables:_
61 | | ... | - RESOURCES_TPL_HC - path to honeycomb templates directory
62 | | ... | - HTTPCodes - HTTP protocol status codes
64 | | [Arguments] | @{duts}
65 | | Stop honeycomb on DUTs | @{duts}
66 | | :FOR | ${dut} | IN | @{duts}
67 | | | Wait until keyword succeeds | 60sec | 15sec
68 | | | ... | Check honeycomb shutdown state | @{duts}
70 | Clear persisted Honeycomb configuration
71 | | [Documentation] | *Delete saved configuration.*
73 | | ... | *Arguments:*
74 | | ... | - duts - one or more nodes to clear persistence on. Type: dictionary
78 | | ... | \| Clear persisted Honeycomb configuration \| ${nodes['DUT1']} \|
80 | | [Arguments] | @{duts}
81 | | Clear persisted Honeycomb config | @{duts}
83 | Restart Honeycomb and VPP and clear persisted configuration
84 | | [Documentation] | Restarts Honeycomb and VPP with default configuration.
86 | | ... | *Arguments:*
87 | | ... | - node - information about a DUT node. Type: dictionary
91 | | ... | \| Restart Honeycomb and VPP and clear persisted configuration \
92 | | ... | \| ${nodes['DUT1']} \|
94 | | [Arguments] | ${node}
95 | | Stop Honeycomb service on DUTs | ${node}
96 | | Clear persisted Honeycomb configuration | ${node}
97 | | Setup DUT | ${node}
98 | | Sleep | 10s | Wait 10sec so VPP is up for sure.
99 | | Configure Honeycomb service on DUTs | ${node}
101 | Restart Honeycomb and VPP
102 | | [Documentation] | Stops the Honeycomb service and verifies it is stopped.
103 | | ... | Then restarts VPP, starts Honeycomb again and verifies it is running.
105 | | ... | *Arguments:*
106 | | ... | - node - information about a DUT node. Type: dictionary
110 | | ... | \| Restart Honeycomb and VPP \| ${nodes['DUT1']} \|
112 | | [Arguments] | ${node}
113 | | Stop Honeycomb service on DUTs | ${node}
114 | | Setup DUT | ${node}
115 | | Sleep | 10s | Wait 10sec so VPP is up for sure.
116 | | Configure Honeycomb service on DUTs | ${node}
118 | Restart Honeycomb and VPP in performance test
119 | | [Documentation] | Stops Honeycomb and VPP and verifies HC is stopped.
120 | | ... | Then restarts VPP, starts Honeycomb again and verifies it is running.
122 | | ... | *Arguments:*
123 | | ... | - node - information about a DUT node. Type: dictionary
127 | | ... | \| Restart Honeycomb and VPP \| ${nodes['DUT1']} \|
129 | | [Arguments] | ${node}
130 | | Stop Honeycomb service on DUTs | ${node}
131 | | Stop VPP service on DUT | ${node}
132 | | Setup DUT | ${node}
133 | | Sleep | 10s | Wait 10sec so VPP is up for sure.
134 | | Configure Honeycomb service on DUTs | ${node}
135 | | Check honeycomb startup state | ${node} | timeout=120
137 | Archive Honeycomb log file
138 | | [Documentation] | Copy honeycomb.log file from Honeycomb node\
139 | | ... | to test executor.
141 | | ... | *Arguments:*
142 | | ... | - node - information about a DUT node. Type: dictionary
143 | | ... | - perf - Running on performance testbed? Yes/no Type: boolean
147 | | ... | \| Archive Honeycomb log file \| ${nudes['DUT1']} \|
149 | | [Arguments] | ${node} | ${perf}=${False}
150 | | Archive Honeycomb log | ${node} | ${perf}
152 | Configure ODL Client Service On DUT
153 | | [Documentation] | Configure and start ODL client, then repeatedly check if
154 | | ... | it is running.
156 | | ... | *Arguments:*
157 | | ... | - node - information about a DUT node. Type: dictionary
158 | | ... | - odl_name - Name of ODL client version. Type: string
162 | | ... | \| Configure ODL Client Service on DUT \| ${nodes['DUT1']} \
163 | | ... | \| carbon-SR1 \|
165 | | [Arguments] | ${node} | ${odl_name}
166 | | Copy ODL Client | ${node} | ${odl_name} | /mnt/common | /tmp
167 | | Setup ODL Client | ${node} | /tmp
168 | | Wait until keyword succeeds | 2min | 30sec
169 | | ... | Install ODL Features | ${node} | ${odl_name} | /tmp
170 | | Wait until keyword succeeds | 4min | 15sec
171 | | ... | Mount Honeycomb on ODL | ${node}
172 | | Wait until keyword succeeds | 2min | 15sec
173 | | ... | Check ODL startup state | ${node}
174 | | Check honeycomb startup state | ${node} | timeout=120
176 | Configure Honeycomb for functional testing
177 | | [Documentation] | Configure Honeycomb with parameters for functional
178 | | ... | testing, then start Honeycomb and repeatedly check startup status.
180 | | ... | *Arguments:*
181 | | ... | - node - information about a DUT node. Type: dictionary
185 | | ... | \| Configure Honeycomb for functional testing \| ${nodes['DUT1']} \|
187 | | [Arguments] | ${node}
188 | | Configure Restconf binding address | ${node}
189 | | Configure Log Level | ${node} | TRACE
190 | | Configure Persistence | ${node} | disable
191 | | Configure jVPP timeout | ${node} | ${10}
192 | | Generate Honeycomb startup configuration for ODL test | ${node}
193 | | Clear Persisted Honeycomb Configuration | ${node}
194 | | Configure Honeycomb service on DUTs | ${node}
196 | Configure ODL Client for functional testing
197 | | [Documentation] | Read external variable HC_ODL. Depending on its
198 | | ... | value either: do nothing, or setup ODL client for testing and
199 | | ... | create a global variable that modifies Restconf requests to use ODL.
201 | | ... | *Arguments:*
202 | | ... | - node - information about a DUT node. Type: dictionary
206 | | ... | \| Configure ODL Client for functional testing \| ${nodes['DUT1']} \|
208 | | [Arguments] | ${node}
209 | | ${use_odl_client}= | Get Variable Value | ${HC_ODL}
210 | | Run Keyword If | '${use_odl_client}' != '${NONE}'
211 | | ... | Run Keywords
212 | | ... | Set Global Variable | ${use_odl_client} | AND
213 | | ... | Configure ODL Client Service On DUT | ${node} | ${use_odl_client}
214 | | ... | ELSE | Log | Variable HC_ODL is not present. Not using ODL.
217 | Set Up Honeycomb Functional Test Suite
218 | | [Documentation] | Generic test suite setup for Honeycomb functional tests.
219 | | ... | Restarts VPP, then enables Honeycomb and optionally ODL, based
220 | | ... | on external variable.
222 | | ... | *Arguments:*
223 | | ... | - node - information about a DUT node. Type: dictionary
227 | | ... | \| Set Up Honeycomb Functional Test Suite \| ${nodes['DUT1']} \|
229 | | [Arguments] | ${node}
230 | | Setup DUT | ${node}
231 | | Configure all TGs for traffic script
232 | | Configure Honeycomb for functional testing | ${node}
233 | | Configure ODL Client for functional testing | ${node}
235 | Tear Down Honeycomb Functional Test Suite
236 | | [Documentation] | Generic test suite teardown for Honeycomb functional
237 | | ... | tests. Stops ODL client (if used), then stops Honeycomb and verifies
238 | | ... | that they are both stopped.
240 | | ... | *Arguments:*
241 | | ... | - node - information about a DUT node. Type: dictionary
245 | | ... | \| Tear Down Honeycomb Functional Test Suite \| ${nodes['DUT1']} \|
247 | | [Arguments] | ${node}
248 | | Append suite to Honeycomb log file | ${node}
249 | | ${use_odl_client}= | Get Variable Value | ${HC_ODL}
250 | | Run Keyword If | '${use_odl_client}' != '${NONE}'
251 | | ... | Run Keywords
252 | | ... | Stop ODL Client | ${node} | /tmp | AND
253 | | ... | Wait until keyword succeeds | 3min | 15sec
254 | | ... | Check ODL shutdown state | ${node} | AND
255 | | ... | Set Global Variable | ${use_odl_client} | ${NONE}
256 | | Stop Honeycomb service on DUTs | ${node}
257 | | Clear Honeycomb Log | ${node}
258 | | Stop VPP Service on DUT | ${node}
260 | Enable Honeycomb Feature
261 | | [Documentation] | Enable the specified feature in Honeycomb configuration.
262 | | ... | Requires a restart of Honeycomb to take effect.
264 | | ... | *Arguments:*
265 | | ... | - node - information about a DUT node. Type: dictionary
269 | | ... | \| Enable Honeycomb Feature \| ${nodes['DUT1']} \| NSH \|
271 | | [arguments] | ${node} | ${feature}
272 | | Manage Honeycomb Features | ${node} | ${feature}
274 | Disable Honeycomb Feature
275 | | [Documentation] | Disable the specified feature in Honeycomb configuration.
276 | | ... | Requires a restart of Honeycomb to take effect.
278 | | ... | *Arguments:*
279 | | ... | - node - information about a DUT node. Type: dictionary
283 | | ... | \| Disable Honeycomb Feature \| ${nodes['DUT1']} \| NSH \|
285 | | [arguments] | ${node} | ${feature}
286 | | Manage Honeycomb Features | ${node} | ${feature} | disable=${True}
288 | Honeycomb Performance Suite Setup Generic
289 | | [Documentation] | Generic test suite setup for Honeycomb performance tests.
290 | | ... | Performs multiple attempts to start Honeycomb+VPP stack.
292 | | ... | *Arguments:*
293 | | ... | - node - information about a DUT node. Type: dictionary
297 | | ... | \| Honeycomb Performance Suite Setup Generic \| ${nodes['DUT1']} \|
299 | | [Arguments] | ${node}
300 | | Wait until keyword succeeds | 8min | 2min
301 | | ... | Restart Honeycomb and VPP in Performance test | ${node}
303 | Honeycomb Performance Suite Teardown Generic
304 | | [Documentation] | Generic test suite teardown for Honeycomb performance
305 | | ... | tests. Logs CPU usage before stopping Honeycomb.
307 | | ... | *Arguments:*
308 | | ... | - node - information about a DUT node. Type: dictionary
312 | | ... | \| Honeycomb Performance Suite Teardown Generic \| ${nodes['DUT1']} \|
314 | | [Arguments] | ${node}
315 | | Log Honeycomb and VPP process distribution on cores | ${node}
316 | | Append suite to Honeycomb log file | ${node}
317 | | Stop Honeycomb service on DUTs | ${node}
318 | | Clear Honeycomb Log | ${node}
319 | | Stop VPP Service on DUT | ${node}
321 | Append suite to Honeycomb log file
322 | | [Documentation] | Add the contents of honeycomb.log for the current suite\
323 | | ... | to the full log which will be archived.
325 | | ... | *Arguments:*
326 | | ... | - node - information about a DUT node. Type: dictionary
330 | | ... | \| Append suite to Honeycomb log file \| ${nodes['DUT1']} \|
332 | | [Arguments] | ${node}
333 | | Append Honeycomb log | ${node} | ${SUITE_NAME}
335 | Generate Honeycomb startup configuration for ODL test
336 | | [Documentation] | Create HC startup configuration and apply to config
337 | | ... | file on DUT. Requires Honeycomb restart to take effect.
339 | | ... | *Arguments:*
340 | | ... | - node - Honeycomb node. Type: dictionary
344 | | ... | \| Generate Honeycomb startup configuration for ODL test \
345 | | ... | \| ${nodes[DUT1]} \|
347 | | [Arguments] | ${node}
348 | | Import Library | resources.libraries.python.honeycomb.HoneycombSetup.HoneycombStartupConfig
349 | | ... | WITH NAME | HC_config
350 | | Run Keyword | HC_config.Set SSH Security provider
351 | | Run Keyword | HC_config.Set Memory Size | ${32}
352 | | Run Keyword | HC_config.Set Metaspace Size | ${32}
353 | | Run Keyword | HC_config.Apply config | ${node}