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 | | Restart Vpp Service | ${node}
98 | | Verify Vpp | ${node}
99 | | VPP Enable Traces On DUT | ${node}
100 | | Configure Honeycomb service on DUTs | ${node}
102 | Restart Honeycomb and VPP
103 | | [Documentation] | Stops the Honeycomb service and verifies it is stopped.
104 | | ... | Then restarts VPP, starts Honeycomb again and verifies it is running.
106 | | ... | *Arguments:*
107 | | ... | - node - information about a DUT node. Type: dictionary
111 | | ... | \| Restart Honeycomb and VPP \| ${nodes['DUT1']} \|
113 | | [Arguments] | ${node}
114 | | Stop Honeycomb service on DUTs | ${node}
115 | | Restart Vpp Service | ${node}
116 | | Verify Vpp | ${node}
117 | | VPP Enable Traces On DUT | ${node}
118 | | Configure Honeycomb service on DUTs | ${node}
120 | Restart Honeycomb and VPP in performance test
121 | | [Documentation] | Stops Honeycomb and VPP and verifies HC is stopped.
122 | | ... | Then restarts VPP, starts Honeycomb again and verifies it is running.
124 | | ... | *Arguments:*
125 | | ... | - node - information about a DUT node. Type: dictionary
129 | | ... | \| Restart Honeycomb and VPP \| ${nodes['DUT1']} \|
131 | | [Arguments] | ${node}
132 | | Stop Honeycomb service on DUTs | ${node}
133 | | Restart Vpp Service | ${node}
134 | | Verify Vpp | ${node}
135 | | VPP Enable Traces On DUT | ${node}
136 | | Configure Honeycomb service on DUTs | ${node}
137 | | Check honeycomb startup state | ${node} | timeout=120
139 | Archive Honeycomb logs
140 | | [Documentation] | Copies log files from Honeycomb node\
141 | | ... | to test executor.
143 | | ... | *Arguments:*
144 | | ... | - node - information about a DUT node. Type: dictionary
145 | | ... | - perf - Running on performance testbed? Yes/no Type: boolean
149 | | ... | \| Archive Honeycomb logs \| ${nudes['DUT1']} \|
151 | | [Arguments] | ${node} | ${perf}=${False}
152 | | Archive Honeycomb log | ${node} | ${perf}
153 | | Archive ODL log | ${node}
155 | Configure ODL Client Service On DUT
156 | | [Documentation] | Configure and start ODL client, then repeatedly check if
157 | | ... | it is running.
159 | | ... | *Arguments:*
160 | | ... | - node - information about a DUT node. Type: dictionary
161 | | ... | - odl_name - Name of ODL client version. Type: string
165 | | ... | \| Configure ODL Client Service on DUT \| ${nodes['DUT1']} \
166 | | ... | \| carbon-SR1 \|
168 | | [Arguments] | ${node} | ${odl_name}
169 | | Copy ODL Client | ${node} | ${odl_name} | /mnt/common | /tmp
170 | | Setup ODL Client | ${node} | /tmp
171 | | Wait until keyword succeeds | 3min | 30sec
172 | | ... | Install ODL Features | ${node} | /tmp
173 | | Wait until keyword succeeds | 4min | 15sec
174 | | ... | Mount Honeycomb on ODL | ${node}
175 | | Wait until keyword succeeds | 2min | 15sec
176 | | ... | Check ODL startup state | ${node}
177 | | Check honeycomb startup state | ${node} | timeout=120
179 | Configure Honeycomb for functional testing
180 | | [Documentation] | Configure Honeycomb with parameters for functional
181 | | ... | testing, then start Honeycomb and repeatedly check startup status.
183 | | ... | *Arguments:*
184 | | ... | - node - information about a DUT node. Type: dictionary
188 | | ... | \| Configure Honeycomb for functional testing \| ${nodes['DUT1']} \|
190 | | [Arguments] | ${node}
191 | | Configure Restconf binding address | ${node}
192 | | Configure Log Level | ${node} | TRACE
193 | | Configure Persistence | ${node} | disable
194 | | Configure jVPP timeout | ${node} | ${10}
195 | | Generate Honeycomb startup configuration for ODL test | ${node}
196 | | Clear Persisted Honeycomb Configuration | ${node}
197 | | Configure Honeycomb service on DUTs | ${node}
199 | Configure ODL Client for functional testing
200 | | [Documentation] | Read external variable HC_ODL. Depending on its
201 | | ... | value either: do nothing, or setup ODL client for testing and
202 | | ... | create a global variable that modifies Restconf requests to use ODL.
204 | | ... | *Arguments:*
205 | | ... | - node - information about a DUT node. Type: dictionary
209 | | ... | \| Configure ODL Client for functional testing \| ${nodes['DUT1']} \|
211 | | [Arguments] | ${node}
212 | | ${use_odl_client}= | Get Variable Value | ${HC_ODL}
213 | | Run Keyword If | '${use_odl_client}' != '${NONE}'
214 | | ... | Run Keywords
215 | | ... | Set Global Variable | ${use_odl_client} | AND
216 | | ... | Configure ODL Client Service On DUT | ${node} | ${use_odl_client}
217 | | ... | ELSE | Log | Variable HC_ODL is not present. Not using ODL.
220 | Set Up Honeycomb Functional Test Suite
221 | | [Documentation] | Generic test suite setup for Honeycomb functional tests.
222 | | ... | Restarts VPP, then enables Honeycomb and optionally ODL, based
223 | | ... | on external variable.
225 | | ... | *Arguments:*
226 | | ... | - node - information about a DUT node. Type: dictionary
230 | | ... | \| Set Up Honeycomb Functional Test Suite \| ${nodes['DUT1']} \|
232 | | [Arguments] | ${node}
233 | | Restart Vpp Service | ${node}
234 | | Verify Vpp | ${node}
235 | | VPP Enable Traces On DUT | ${node}
236 | | Configure all TGs for traffic script
237 | | Configure Honeycomb for functional testing | ${node}
238 | | Configure ODL Client for functional testing | ${node}
240 | Tear Down Honeycomb Functional Test Suite
241 | | [Documentation] | Generic test suite teardown for Honeycomb functional
242 | | ... | tests. Stops ODL client (if used), then stops Honeycomb and verifies
243 | | ... | that they are both stopped.
245 | | ... | *Arguments:*
246 | | ... | - node - information about a DUT node. Type: dictionary
250 | | ... | \| Tear Down Honeycomb Functional Test Suite \| ${nodes['DUT1']} \|
252 | | [Arguments] | ${node}
253 | | Append suite to Honeycomb log file | ${node}
254 | | ${use_odl_client}= | Get Variable Value | ${HC_ODL}
255 | | Run Keyword If | '${use_odl_client}' != '${NONE}'
256 | | ... | Run Keywords
257 | | ... | Append suite to ODL log file | ${node} | ${use_odl_client} | AND
258 | | ... | Stop ODL Client | ${node} | /tmp | AND
259 | | ... | Wait until keyword succeeds | 3min | 15sec
260 | | ... | Check ODL shutdown state | ${node} | AND
261 | | ... | Set Global Variable | ${use_odl_client} | ${NONE}
262 | | Stop Honeycomb service on DUTs | ${node}
263 | | Clear Honeycomb Log | ${node}
264 | | Stop VPP Service on DUT | ${node}
266 | Enable Honeycomb Feature
267 | | [Documentation] | Enable the specified feature in Honeycomb configuration.
268 | | ... | Requires a restart of Honeycomb to take effect.
270 | | ... | *Arguments:*
271 | | ... | - node - information about a DUT node. Type: dictionary
275 | | ... | \| Enable Honeycomb Feature \| ${nodes['DUT1']} \| NSH \|
277 | | [arguments] | ${node} | ${feature}
278 | | Manage Honeycomb Features | ${node} | ${feature}
280 | Disable Honeycomb Feature
281 | | [Documentation] | Disable the specified feature in Honeycomb configuration.
282 | | ... | Requires a restart of Honeycomb to take effect.
284 | | ... | *Arguments:*
285 | | ... | - node - information about a DUT node. Type: dictionary
289 | | ... | \| Disable Honeycomb Feature \| ${nodes['DUT1']} \| NSH \|
291 | | [arguments] | ${node} | ${feature}
292 | | Manage Honeycomb Features | ${node} | ${feature} | disable=${True}
294 | Honeycomb Performance Suite Setup Generic
295 | | [Documentation] | Generic test suite setup for Honeycomb performance tests.
296 | | ... | Performs multiple attempts to start Honeycomb+VPP stack.
298 | | ... | *Arguments:*
299 | | ... | - node - information about a DUT node. Type: dictionary
303 | | ... | \| Honeycomb Performance Suite Setup Generic \| ${nodes['DUT1']} \|
305 | | [Arguments] | ${node}
306 | | Wait until keyword succeeds | 8min | 2min
307 | | ... | Restart Honeycomb and VPP in Performance test | ${node}
309 | Honeycomb Performance Suite Teardown Generic
310 | | [Documentation] | Generic test suite teardown for Honeycomb performance
311 | | ... | tests. Logs CPU usage before stopping Honeycomb.
313 | | ... | *Arguments:*
314 | | ... | - node - information about a DUT node. Type: dictionary
318 | | ... | \| Honeycomb Performance Suite Teardown Generic \| ${nodes['DUT1']} \|
320 | | [Arguments] | ${node}
321 | | Log Honeycomb and VPP process distribution on cores | ${node}
322 | | Append suite to Honeycomb log file | ${node}
323 | | Stop Honeycomb service on DUTs | ${node}
324 | | Clear Honeycomb Log | ${node}
325 | | Stop VPP Service on DUT | ${node}
327 | Append suite to Honeycomb log file
328 | | [Documentation] | Add the contents of honeycomb.log for the current suite\
329 | | ... | to the full log which will be archived.
331 | | ... | *Arguments:*
332 | | ... | - node - information about a DUT node. Type: dictionary
336 | | ... | \| Append suite to Honeycomb log file \| ${nodes['DUT1']} \|
338 | | [Arguments] | ${node}
339 | | Append Honeycomb log | ${node} | ${SUITE_NAME}
341 | Append suite to ODL log file
342 | | [Documentation] | Add the contents of ODL karaf.log for the current suite\
343 | | ... | to the full log which will be archived.
345 | | ... | *Arguments:*
346 | | ... | - node - information about a DUT node. Type: dictionary
347 | | ... | - odl_name - name of ODL client version. Type: string
351 | | ... | \| Append suite to ODL karaf log file \| ${nodes['DUT1']} \
352 | | ... | \| Oxygen \|
354 | | [Arguments] | ${node} | ${odl_name}
355 | | Append ODL log | ${node} | ${odl_name} | ${SUITE_NAME}
357 | Generate Honeycomb startup configuration for ODL test
358 | | [Documentation] | Create HC startup configuration and apply to config
359 | | ... | file on DUT. Requires Honeycomb restart to take effect.
361 | | ... | *Arguments:*
362 | | ... | - node - Honeycomb node. Type: dictionary
366 | | ... | \| Generate Honeycomb startup configuration for ODL test \
367 | | ... | \| ${nodes[DUT1]} \|
369 | | [Arguments] | ${node}
370 | | Import Library | resources.libraries.python.honeycomb.HoneycombSetup.HoneycombStartupConfig
371 | | ... | WITH NAME | HC_config
372 | | Run Keyword | HC_config.Set SSH Security provider
373 | | Run Keyword | HC_config.Set Memory Size | ${32}
374 | | Run Keyword | HC_config.Set Metaspace Size | ${32}
375 | | Run Keyword | HC_config.Apply config | ${node}