1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. SPDX-License-Identifier: CC-BY-4.0
4 ***********************
5 Testing developer guide
6 ***********************
17 The goal of this guide consists in providing some guidelines for new developers
18 involved in test areas.
25 There are several ways to join test projects as a developer. In fact you may:
27 * Develop new test cases
29 * Develop tooling (reporting, dashboards, graphs, middleware,...)
30 * Troubleshoot results
31 * Post-process results
33 These different tasks may be done within a specific project or as a shared
34 resource accross the different projects.
36 If you develop new test cases, the best practice is to contribute upstream as
37 much as possible. You may contact the testing group to know which project - in
38 Anuket or upstream - would be the best place to host the test cases. Such
39 contributions are usually directly connected to a specific project, more details
40 can be found in the user guides of the testing projects.
42 Each Anuket testing project provides test cases and the framework to manage them.
43 As a developer, you can obviously contribute to them. The developer guide of
44 the testing projects shall indicate the procedure to follow.
46 Tooling may be specific to a project or generic to all the projects. For
47 specific tooling, please report to the test project user guide. The tooling used
48 by several test projects will be detailed in this document.
50 The best event to meet the testing community is probably the plugfest. Such an
51 event is organized after each release. Most of the test projects are present.
53 The summit is also a good opportunity to meet most of the actors `[DEV4]`_.
59 All the test projects do not have the same maturity and/or number of
60 contributors. The nature of the test projects may be also different. The
61 following best practices may not be acurate for all the projects and are only
62 indicative. Contact the testing group for further details.
68 Most of the projects have a similar structure, which can be defined as follows::
82 | `-- Dockerfile.aarch64.patch
97 Test projects are installing tools and triggering tests. When it is possible it
98 is recommended to implement an API in order to perform the different actions.
100 Each test project should be able to expose and consume APIs from other test
101 projects. This pseudo micro service approach should allow a flexible use of
102 the different projects and reduce the risk of overlapping. In fact if project A
103 provides an API to deploy a traffic generator, it is better to reuse it rather
104 than implementing a new way to deploy it. This approach has not been implemented
105 yet but the prerequisites consiting in exposing and API has already been done by
106 several test projects.
111 Most of the test projects provide a docker as deliverable. Once connected, it is
112 possible to prepare the environement and run tests through a CLI.
117 Dockerization has been introduced in Brahmaputra and adopted by most of the test
123 It is recommended to control the quality of the code of the testing projects,
124 and more precisely to implement some verifications before any merge:
130 The code of the test project must be covered by unit tests. The coverage
131 shall be reasonable and not decrease when adding new features to the framework.
132 The use of tox is recommended.
133 It is possible to implement strict rules (no decrease of pylint score, unit
134 test coverages) on critical python classes.
140 Several test projects integrate third party tooling for code quality check
141 and/or traffic generation. Some of the tools can be listed as follows:
143 +---------------+----------------------+------------------------------------+
144 | Project | Tool | Comments |
145 +===============+======================+====================================+
146 | Functest | Tempest | OpenStack test tooling |
147 | | Rally | OpenStack test tooling |
148 | | Refstack | OpenStack test tooling |
149 | | RobotFramework | Used for ODL tests |
150 +---------------+----------------------+------------------------------------+
152 +---------------+----------------------+------------------------------------+
155 ======================================
156 Testing group configuration parameters
157 ======================================
162 The testing group defined several categories also known as tiers. These
163 categories can be used to group test suites.
165 +----------------+-------------------------------------------------------------+
166 | Category | Description |
167 +================+=============================================================+
168 | Healthcheck | Simple and quick healthcheck tests case |
169 +----------------+-------------------------------------------------------------+
170 | Smoke | Set of smoke test cases/suites to validate the release |
171 +----------------+-------------------------------------------------------------+
172 | Features | Test cases that validate a specific feature on top of Anuket|
173 | | Those come from Feature projects and need a bit of support |
174 | | for integration |
175 +----------------+-------------------------------------------------------------+
176 | Components | Tests on a specific component (e.g. OpenStack, OVS, DPDK,..)|
177 | | It may extend smoke tests |
178 +----------------+-------------------------------------------------------------+
179 | Performance | Performance qualification |
180 +----------------+-------------------------------------------------------------+
181 | VNF | Test cases related to deploy an open source VNF including |
182 | | an orchestrator |
183 +----------------+-------------------------------------------------------------+
184 | Stress | Stress and robustness tests |
185 +----------------+-------------------------------------------------------------+
186 | In Service | In service testing |
187 +----------------+-------------------------------------------------------------+
192 The domains deal with the technical scope of the tests. It shall correspond to
193 domains defined for the certification program:
207 One of the goals of the testing working group is to identify the poorly covered
208 areas and avoid testing overlap.
209 Ideally based on the declaration of the test cases, through the tags, domains
210 and tier fields, it shall be possible to create heuristic maps.
212 =============================================
213 Reliability, Stress and Long Duration Testing
214 =============================================
216 Resiliency of NFV refers to the ability of the NFV framework to limit disruption
217 and return to normal or at a minimum acceptable service delivery level in the
218 face of a fault, failure, or an event that disrupts the normal operation
221 **Reliability** testing evaluates the ability of SUT to recover in face of fault,
222 failure or disrupts in normal operation or simply the ability of SUT absorbing
225 Reliability tests use different forms of faults as stimulus, and the test must
226 measure the reaction in terms of the outage time or impairments to transmission.
228 **Stress testing** involves producing excess load as stimulus, and the test
229 must measure the reaction in terms of unexpected outages or (more likely)
230 impairments to transmission.
232 These kinds of "load" will cause "disruption" which could be easily found in
233 system logs. It is the purpose to raise such "load" to evaluate the SUT if it
234 could provide an acceptable level of service or level of confidence during such
242 How can I contribute to a test project?
243 =======================================
244 As any project, the best solution is to contact the project. The project
245 members with their email address can be found under
246 https://git.opnfv.org/<project>/tree/INFO
248 How do I integrate my tests in CI?
249 ==================================
250 It shall be discussed directly with the project you are working with. It is
251 done through jenkins jobs calling testing project files but the way to onboard
252 cases differ from one project to another.
254 How to declare my tests in the test Database?
255 =============================================
256 If you have access to the test API swagger (access granted to contributors), you
257 may use the swagger interface of the test API to declare your project.
258 The URL is http://testresults.opnfv.org/test/swagger/spec.html.
260 .. figure:: ../../../images/swaggerUI.png
262 :alt: Testing Group Test API swagger
264 Click on *Spec*, the list of available methods must be displayed.
266 .. figure:: ../../../images/API-operations.png
268 :alt: Testing Group Test API swagger
270 For the declaration of a new project use the POST /api/v1/projects method.
272 For the declaration of new test cases in an existing project, use the POST
273 /api/v1/projects/{project_name}/cases method
275 .. figure:: ../../../images/CreateCase.png
277 :alt: Testing group declare new test case
279 How to push your results into the Test Database?
280 ================================================
282 The test database is used to collect test results. By default it is
283 enabled only for CI tests from Production CI pods.
285 Please note that it is possible to create your own local database.
287 A dedicated database is for instance created for each plugfest.
289 The architecture and associated API is described in previous chapter.
290 If you want to push your results from CI, you just have to call the API
291 at the end of your script.
294 Where can I find the documentation on the test API?
295 ===================================================
297 The Test API is now documented in this document (see sections above).
298 You may also find autogenerated documentation in
299 http://artifacts.opnfv.org/releng/docs/testapi.html
301 I have tests, to which category should I declare them?
302 ======================================================
305 The main ambiguity could be between features and VNF.
306 In fact sometimes you have to spawn VMs to demonstrate the capabilities of the
307 feature you introduced.
308 We recommend to declare your test in the feature category.
310 VNF category is really dedicated to test including:
312 * creation of resources
313 * deployement of an orchestrator/VNFM
314 * deployment of the VNF
318 The goal is not to study a particular feature on the infrastructure but to have
319 a whole end to end test of a VNF automatically deployed in CI.
320 Moreover VNF are run in weekly jobs (one a week), feature tests are in daily
321 jobs and use to get a scenario score.
323 Where are the logs of CI runs?
324 ==============================
326 Logs and configuration files can be pushed to artifact server from the CI under
327 http://artifacts.opnfv.org/<project name>
334 `[DEV4]`_: Conversation with the testing community, OPNFV Beijing Summit
336 `[DEV5]`_: GS NFV 003
338 .. _`[DEV4]`: https://www.youtube.com/watch?v=f9VAUdEqHoA
339 .. _`[DEV5]`: http://www.etsi.org/deliver/etsi_gs/NFV/001_099/003/01.01.01_60/gs_NFV003v010101p.pdf