1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. SPDX-License-Identifier: CC-BY-4.0
4 ************************
5 Functest Developer Guide
6 ************************
14 +------------+----------+------------------+----------------------------------+
15 | **Date** | **Ver.** | **Author** | **Comment** |
17 +------------+----------+------------------+----------------------------------+
18 | 2017-01-23 | 1.0.0 | Morgan Richomme | Creation for Danube |
19 +------------+----------+------------------+----------------------------------+
20 | 2017-08-16 | 1.0.1 | Morgan Richomme | Adaptations for Euphrates |
21 | | | | - move generic part to Testing |
22 | | | | developer guide |
23 | | | | - move reporting part to functest|
25 | | | | - update test case list |
26 | | | | - include auto generated core |
27 | | | | documentation |
28 +------------+----------+------------------+----------------------------------+
34 Functest is a project dealing with functional testing.
35 The project produces its own internal test cases but can also be considered
36 as a framework to support feature and VNF onboarding project testing.
38 Therefore there are many ways to contribute to Functest. You can:
40 * Develop new internal test cases
41 * Integrate the tests from your feature project
42 * Develop the framework to ease the integration of external test cases
44 Additional tasks involving Functest but addressing all the test projects
45 may also be mentioned:
47 * The API / Test collection framework
49 * The automatic reporting portals
50 * The testcase catalog
52 This document describes how, as a developer, you may interact with the
53 Functest project. The first section details the main working areas of
54 the project. The Second part is a list of "How to" to help you to join
55 the Functest family whatever your field of interest is.
58 ========================
59 Functest developer areas
60 ========================
63 Functest High level architecture
64 ================================
66 Functest is a project delivering test containers dedicated to OPNFV.
67 It includes the tools, the scripts and the test scenarios.
68 Until Danube, Functest produced 2 docker files based on Ubuntu 14.04:
70 * x86 Functest: https://hub.docker.com/r/opnfv/functest/
71 * aarch64 Functest: https://hub.docker.com/r/opnfv/functest_aarch64/
73 In Euphrates Alpine containers have been introduced in order to lighten the
74 container and manage testing slicing. The new containers are created according
75 to the different tiers:
77 * functest-core: https://hub.docker.com/r/opnfv/functest-core/
78 * functest-healthcheck: https://hub.docker.com/r/opnfv/functest-healthcheck/
79 * functest-smoke: https://hub.docker.com/r/opnfv/functest-smoke/
80 * functest-features: https://hub.docker.com/r/opnfv/functest-features/
81 * functest-components: https://hub.docker.com/r/opnfv/functest-components/
82 * functest-vnf: https://hub.docker.com/r/opnfv/functest-vnf/
83 * functest-parser: https://hub.docker.com/r/opnfv/functest-parser/
84 * functest-restapi: https://hub.docker.com/r/opnfv/functest-restapi/
86 Standalone functest dockers are maintained for Euphrates but Alpine containers
89 Functest can be described as follow:
91 +----------------------+
93 | +--------------+ | +-------------------+
95 | | Tools | +------------------+ OPNFV |
96 | | Scripts | | | System Under Test |
99 | +--------------+ | +-------------------+
103 +----------------------+
105 Functest internal test cases
106 ============================
107 The internal test cases in Euphrates are:
120 * tempest_smoke_serial
121 * tempest_full_parallel
124 By internal, we mean that this particular test cases have been developed and/or
125 integrated by functest contributors and the associated code is hosted in the
127 An internal case can be fully developed or a simple integration of
128 upstream suites (e.g. Tempest/Rally developed in OpenStack, or odl suites are
129 just integrated in Functest).
131 The structure of this repository is detailed in `[1]`_.
132 The main internal test cases are in the opnfv_tests subfolder of the
133 repository, the internal test cases can be grouped by domain:
135 * sdn: odl, odl_netvirt, odl_fds
136 * openstack: api_check, connection_check, snaps_health_check, vping_ssh, vping_userdata, tempest_*, rally_*
139 If you want to create a new test case you will have to create a new folder under
140 the testcases directory (See next section for details).
142 Functest external test cases
143 ============================
144 The external test cases are inherited from other OPNFV projects, especially the
147 The external test cases are:
159 * orchestra_clearwaterims
164 External test cases integrated in previous versions but not released in
173 The code to run these test cases is hosted in the repository of the project.
174 Please note that orchestra test cases are hosted in Functest repository and not
175 in orchestra repository. Cloudify_vrouter and juju_vepc code is also hosted in
176 functest as there are no dedicated projects.
182 Functest is a framework.
184 Historically Functest is released as a docker file, including tools, scripts and
185 a CLI to prepare the environment and run tests.
186 It simplifies the integration of external test suites in CI pipeline and provide
187 commodity tools to collect and display results.
189 Since Colorado, test categories also known as **tiers** have been created to
190 group similar tests, provide consistent sub-lists and at the end optimize
191 test duration for CI (see How To section).
193 The definition of the tiers has been agreed by the testing working group.
202 Functest abstraction classes
203 ============================
205 In order to harmonize test integration, abstraction classes have been
208 * testcase: base for any test case
209 * unit: run unit tests as test case
210 * feature: abstraction for feature project
211 * vnf: abstraction for vnf onboarding
213 The goal is to unify the way to run tests in Functest.
215 Feature, unit and vnf_base inherit from testcase::
217 +-----------------------------------------+
224 | - is_successful() |
226 +-----------------------------------------+
229 +--------------------+ +--------------+ +--------------------------+
231 | feature | | unit | | vnf |
233 | | | | | - prepare() |
234 | - execute() | | | | - deploy_orchestrator() |
235 | BashFeature class | | | | - deploy_vnf() |
236 | | | | | - test_vnf() |
237 | | | | | - clean() |
238 +--------------------+ +--------------+ +--------------------------+
244 :url: http://artifacts.opnfv.org/functest/docs/apidoc/functest.core.testcase.html
249 :url: http://artifacts.opnfv.org/functest/docs/apidoc/functest.core.feature.html
254 :url: http://artifacts.opnfv.org/functest/docs/apidoc/functest.core.unit.html
259 :url: http://artifacts.opnfv.org/functest/docs/apidoc/functest.core.vnf.html
262 see `[5]`_ to get code samples
265 Functest util classes
266 =====================
268 In order to simplify the creation of test cases, Functest develops also some
269 functions that are used by internal test cases.
270 Several features are supported such as logger, configuration management and
271 Openstack capabilities (snapshot, clean, tacker,..).
272 These functions can be found under <repo>/functest/utils and can be described as
280 |-- functest_utils.py
281 |-- openstack_clean.py
282 |-- openstack_snapshot.py
283 |-- openstack_tacker.py
284 `-- openstack_utils.py
286 It is recommended to use the SNAPS-OO library for deploying OpenStack instances.
287 SNAPS `[4]`_ is an OPNFV project providing OpenStack utils.
292 Functest is using the Test collection framework and the TestAPI developed by
293 the OPNFV community. See `[6]`_ for details.
298 A web page is automatically generated every day to display the status based on
299 jinja2 templates `[3]`_.
305 Additional dashboarding is managed at the testing group level, see `[7]`_ for
313 See How to section on Functest wiki `[8]`_
320 _`[1]`: http://artifacts.opnfv.org/functest/docs/configguide/index.html Functest configuration guide
322 _`[2]`: http://artifacts.opnfv.org/functest/docs/userguide/index.html functest user guide
324 _`[3]`: https://git.opnfv.org/cgit/releng/tree/utils/test/reporting
326 _`[4]`: https://git.opnfv.org/snaps/
328 _`[5]` : http://testresults.opnfv.org/functest/framework/index.html
330 _`[6]`: http://docs.opnfv.org/en/latest/testing/testing-dev.html
332 _`[7]`: https://opnfv.biterg.io/goto/283dba93ca18e95964f852c63af1d1ba
334 _`[8]`: https://wiki.opnfv.org/pages/viewpage.action?pageId=7768932
336 IRC support chan: #opnfv-functest