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
22 | Configure Honeycomb service on DUTs
23 | | [Documentation] | *Setup environment for honeycomb testing.*
25 | | ... | _Setup steps:_
26 | | ... | - 1. Login to each honeycomb node using ssh
27 | | ... | - 2. Startup honeycomb service
28 | | ... | - 3. Monitor service startup using HTTP GET request loop
29 | | ... | Expected sequence of HTTP replies:
30 | | ... | connection refused -> 404 -> 401 -> 503 or 500 -> 200 (pass)
31 | | ... | - 4. Configure honeycomb nodes using HTTP PUT request
33 | | ... | _Arguments:_
34 | | ... | - duts - list of nodes to setup Honeycomb on
36 | | ... | _Used global constants and variables:_
37 | | ... | - RESOURCES_TPL_HC - path to honeycomb templates directory
38 | | ... | - HTTPCodes - HTTP protocol status codes
40 | | [Arguments] | @{duts}
41 | | Start honeycomb on DUTs | @{duts}
42 | | Wait until keyword succeeds | 4min | 16sec
43 | | ... | Check honeycomb startup state | @{duts}
45 | Stop Honeycomb service on DUTs
46 | | [Documentation] | *Cleanup environment after honeycomb testing.*
48 | | ... | _Teardown steps:_
49 | | ... | - 1. Login to each honeycomb node using ssh
50 | | ... | - 2. Stop honeycomb service
51 | | ... | - 3. Monitor service shutdown using HTTP GET request loop
52 | | ... | Expected sequence of HTTP replies:
53 | | ... | 200 -> 404 -> connection refused (pass)
55 | | ... | _Arguments:_
56 | | ... | - duts - list of nodes to stop Honeycomb on
58 | | ... | _Used global constants and variables:_
59 | | ... | - RESOURCES_TPL_HC - path to honeycomb templates directory
60 | | ... | - HTTPCodes - HTTP protocol status codes
62 | | [Arguments] | @{duts}
63 | | Stop honeycomb on DUTs | @{duts}
64 | | Wait until keyword succeeds | 60sec | 16sec
65 | | ... | Check honeycomb shutdown state | @{duts}
67 | Clear persisted Honeycomb configuration
68 | | [Documentation] | *Delete saved configuration.*
70 | | ... | *Arguments:*
71 | | ... | - duts - one or more nodes to clear persistence on. Type: dictionary
75 | | ... | \| Clear persisted Honeycomb configuration \| ${nodes['DUT1']} \|
76 | | [Arguments] | @{duts}
77 | | Clear persisted Honeycomb config | @{duts}
79 | Restart Honeycomb and VPP and clear persisted configuration
80 | | [Documentation] | Restarts Honeycomb and VPP with default configuration.
82 | | ... | *Arguments:*
83 | | ... | - node - information about a DUT node. Type: dictionary
87 | | ... | \| Restart Honeycomb and VPP and clear persisted configuration \
88 | | ... | \| ${nodes['DUT1']} \|
89 | | [Arguments] | ${node}
90 | | Stop Honeycomb service on DUTs | ${node}
91 | | Clear persisted Honeycomb configuration | ${node}
92 | | Setup DUT | ${node}
93 | | Configure Honeycomb service on DUTs | ${node}
95 | Restart Honeycomb and VPP
96 | | [Documentation] | Restarts Honeycomb service and wait until it starts up.
98 | | ... | *Arguments:*
99 | | ... | - node - information about a DUT node. Type: dictionary
103 | | ... | \| Restart Honeycomb and VPP \| ${nodes['DUT1']} \|
104 | | [Arguments] | ${node}
105 | | Stop Honeycomb service on DUTs | ${node}
106 | | Setup DUT | ${node}
107 | | Configure Honeycomb service on DUTs | ${node}
109 | Archive Honeycomb log file
110 | | [Documentation] | Copy honeycomb.log file from Honeycomb node\
111 | | ... | to test executor.
113 | | ... | *Arguments:*
114 | | ... | - node - information about a DUT node. Type: dictionary
118 | | ... | \| Archive Honeycomb log file \| ${nudes['DUT1']} \|
119 | | [Arguments] | ${node}
120 | | Archive Honeycomb log | ${node}
122 | Configure ODL Client Service On DUT
123 | | [Documentation] | Configure and start ODL client, then repeatedly check if
124 | | ... | it is running.
126 | | ... | *Arguments:*
127 | | ... | - node - information about a DUT node. Type: dictionary
128 | | ... | - odl_name - Name of ODL client version. Type: string
132 | | ... | \| Configure ODL Client Service on DUT \| ${nodes['DUT1']} \
133 | | ... | \| carbon-SR1 \|
134 | | [Arguments] | ${node} | ${odl_name}
135 | | Copy ODL Client | ${node} | ${odl_name} | /mnt/common | /tmp
136 | | Setup ODL Client | ${node} | /tmp
137 | | Wait until keyword succeeds | 2min | 30sec
138 | | ... | Install ODL Features | ${node} | /tmp
139 | | Wait until keyword succeeds | 4min | 16sec
140 | | ... | Mount Honeycomb on ODL | ${node}
141 | | Wait until keyword succeeds | 2min | 16sec
142 | | ... | Check ODL startup state | ${node}
143 | | Wait until keyword succeeds | 2min | 16sec
144 | | ... | Check honeycomb startup state | ${node}
146 | Configure Honeycomb for functional testing
147 | | [Documentation] | Configure Honeycomb with parameters for functional
148 | | ... | testing, then start Honeycomb and repeatedly check startup status.
150 | | ... | *Arguments:*
151 | | ... | - node - information about a DUT node. Type: dictionary
155 | | ... | \| Configure Honeycomb for functional testing \| ${nodes['DUT1']} \|
156 | | [Arguments] | ${node}
157 | | Configure Restconf binding address | ${node}
158 | | Configure Log Level | ${node} | TRACE
159 | | Configure Persistence | ${node} | disable
160 | | Configure jVPP timeout | ${node} | ${14}
161 | | Clear Persisted Honeycomb Configuration | ${node}
162 | | Configure Honeycomb service on DUTs | ${node}
164 | Configure ODL Client for functional testing
165 | | [Documentation] | Read external variable HC_ODL. Depending on its
166 | | ... | value either: do nothing, or setup ODL client for testing and
167 | | ... | create a global variable that modifies Restconf requests to use ODL.
169 | | ... | *Arguments:*
170 | | ... | - node - information about a DUT node. Type: dictionary
174 | | ... | \| Configure ODL Client for functional testing \| ${nodes['DUT1']} \|
175 | | [Arguments] | ${node}
176 | | ${use_odl_client}= | Get Variable Value | ${HC_ODL}
177 | | Run Keyword If | '${use_odl_client}' != '${NONE}'
178 | | ... | Run Keywords
179 | | ... | Set Global Variable | ${use_odl_client} | AND
180 | | ... | Configure ODL Client Service On DUT | ${node} | ${use_odl_client}
181 | | ... | ELSE | Log | Variable HC_ODL is not present. Not using ODL.
184 | Set Up Honeycomb Functional Test Suite
185 | | [Documentation] | Generic test suite setup for Honeycomb functional tests.
186 | | ... | Restarts VPP, then enables Honeycomb and optionally ODL, based
187 | | ... | on external variable.
189 | | ... | *Arguments:*
190 | | ... | - node - information about a DUT node. Type: dictionary
194 | | ... | \| Set Up Honeycomb Functional Test Suite \| ${nodes['DUT1']} \|
195 | | [Arguments] | ${node}
196 | | Setup DUT | ${node}
197 | | Configure all TGs for traffic script
198 | | Configure Honeycomb for functional testing | ${node}
199 | | Configure ODL Client for functional testing | ${node}
201 | Tear Down Honeycomb Functional Test Suite
202 | | [Documentation] | Generic test suite teardown for Honeycomb functional
203 | | ... | tests. Stops ODL client (if used), then stops Honeycomb and verifies
204 | | ... | that they are both stopped.
206 | | ... | *Arguments:*
207 | | ... | - node - information about a DUT node. Type: dictionary
211 | | ... | \| Tear Down Honeycomb Functional Test Suite \| ${nodes['DUT1']} \|
212 | | [Arguments] | ${node}
213 | | ${use_odl_client}= | Get Variable Value | ${HC_ODL}
214 | | Run Keyword If | '${use_odl_client}' != '${NONE}'
215 | | ... | Run Keywords
216 | | ... | Stop ODL Client | ${node} | /tmp | AND
217 | | ... | Set Global Variable | ${use_odl_client} | ${NONE}
218 | | Stop Honeycomb service on DUTs | ${node}
220 | Enable Honeycomb Feature
221 | | [Documentation] | Enable the specified feature in Honeycomb configuration.
222 | | ... | Requires a restart of Honeycomb to take effect.
224 | | ... | *Arguments:*
225 | | ... | - node - information about a DUT node. Type: dictionary
229 | | ... | \| Enable Honeycomb Feature \| ${nodes['DUT1']} \| NSH \|
230 | | [arguments] | ${node} | ${feature}
231 | | Manage Honeycomb Features | ${node} | ${feature}
233 | Disable Honeycomb Feature
234 | | [Documentation] | Disable the specified feature in Honeycomb configuration.
235 | | ... | Requires a restart of Honeycomb to take effect.
237 | | ... | *Arguments:*
238 | | ... | - node - information about a DUT node. Type: dictionary
242 | | ... | \| Disable Honeycomb Feature \| ${nodes['DUT1']} \| NSH \|
243 | | [arguments] | ${node} | ${feature}
244 | | Manage Honeycomb Features | ${node} | ${feature} | disable=${True}