1 .. SPDX-License-Identifier: CC-BY-4.0
3 ************************
4 Functest Developer Guide
5 ************************
15 Functest is a project dealing with functional testing.
16 The project produces its own internal test cases but can also be considered
17 as a framework to support feature and VNF onboarding project testing.
19 Therefore there are many ways to contribute to Functest. You can:
21 * Develop new internal test cases
22 * Integrate the tests from your feature project
23 * Develop the framework to ease the integration of external test cases
25 Additional tasks involving Functest but addressing all the test projects
26 may also be mentioned:
28 * The API / Test collection framework
30 * The automatic reporting portals
31 * The testcase catalog
33 This document describes how, as a developer, you may interact with the
34 Functest project. The first section details the main working areas of
35 the project. The Second part is a list of "How to" to help you to join
36 the Functest family whatever your field of interest is.
39 ========================
40 Functest developer areas
41 ========================
44 Functest High level architecture
45 ================================
47 Functest is a project delivering test containers dedicated to OPNFV.
48 It includes the tools, the scripts and the test scenarios.
49 In Euphrates Alpine containers have been introduced in order to lighten the
50 container and manage testing slicing. The new containers are created according
51 to the different tiers:
53 * functest-core: https://hub.docker.com/r/opnfv/functest-core/
54 * functest-healthcheck: https://hub.docker.com/r/opnfv/functest-healthcheck/
55 * functest-smoke: https://hub.docker.com/r/opnfv/functest-smoke/
56 * functest-features: https://hub.docker.com/r/opnfv/functest-features/
57 * functest-components: https://hub.docker.com/r/opnfv/functest-components/
58 * functest-vnf: https://hub.docker.com/r/opnfv/functest-vnf/
59 * functest-parser: https://hub.docker.com/r/opnfv/functest-parser/
60 * functest-restapi: https://hub.docker.com/r/opnfv/functest-restapi/
62 Standalone functest dockers are maintained for Euphrates but Alpine containers
65 Functest can be described as follow::
67 +----------------------+
69 | +--------------+ | +-------------------+
71 | | Tools | +------------------+ OPNFV |
72 | | Scripts | | | System Under Test |
75 | +--------------+ | +-------------------+
79 +----------------------+
81 Functest internal test cases
82 ============================
83 The internal test cases in Euphrates are:
94 * tempest_smoke_serial
95 * tempest_full_parallel
98 By internal, we mean that this particular test cases have been developed and/or
99 integrated by functest contributors and the associated code is hosted in the
101 An internal case can be fully developed or a simple integration of
102 upstream suites (e.g. Tempest/Rally developed in OpenStack, or odl suites are
103 just integrated in Functest).
105 The structure of this repository is detailed in `[1]`_.
106 The main internal test cases are in the opnfv_tests subfolder of the
107 repository, the internal test cases can be grouped by domain:
110 * openstack: api_check, connection_check, snaps_health_check, vping_ssh,
111 vping_userdata, tempest_*, rally_*
114 If you want to create a new test case you will have to create a new folder
115 under the testcases directory (See next section for details).
117 Functest external test cases
118 ============================
119 The external test cases are inherited from other OPNFV projects, especially the
122 The external test cases are:
134 * orchestra_clearwaterims
139 External test cases integrated in previous versions but not released in
148 The code to run these test cases is hosted in the repository of the project.
149 Please note that orchestra test cases are hosted in Functest repository and not
150 in orchestra repository. Vyos_vrouter and juju_vepc code is also hosted in
151 functest as there are no dedicated projects.
157 Functest is a framework.
159 Historically Functest is released as a docker file, including tools, scripts
160 and a CLI to prepare the environment and run tests.
161 It simplifies the integration of external test suites in CI pipeline and
162 provide commodity tools to collect and display results.
164 Since Colorado, test categories also known as **tiers** have been created to
165 group similar tests, provide consistent sub-lists and at the end optimize
166 test duration for CI (see How To section).
168 The definition of the tiers has been agreed by the testing working group.
177 Functest abstraction classes
178 ============================
180 In order to harmonize test integration, abstraction classes have been
183 * testcase: base for any test case
184 * unit: run unit tests as test case
185 * feature: abstraction for feature project
186 * vnf: abstraction for vnf onboarding
188 The goal is to unify the way to run tests in Functest.
190 Feature, unit and vnf_base inherit from testcase::
192 +----------------------------------------------------------------+
199 | - is_successful() |
201 +----------------------------------------------------------------+
204 +--------------------+ +---------+ +------------------------+ +-----------------+
206 | feature | | unit | | vnf | | robotframework |
208 | | | | |- prepare() | | |
209 | - execute() | | | |- deploy_orchestrator() | | |
210 | BashFeature class | | | |- deploy_vnf() | | |
211 | | | | |- test_vnf() | | |
212 | | | | |- clean() | | |
213 +--------------------+ +---------+ +------------------------+ +-----------------+
219 :url: http://artifacts.opnfv.org/functest/docs/apidoc/functest.core.testcase.html
224 :url: http://artifacts.opnfv.org/functest/docs/apidoc/functest.core.feature.html
229 :url: http://artifacts.opnfv.org/functest/docs/apidoc/functest.core.unit.html
234 :url: http://artifacts.opnfv.org/functest/docs/apidoc/functest.core.vnf.html
239 :url: http://artifacts.opnfv.org/functest/docs/apidoc/functest.core.robotframework.html
242 see `[5]`_ to get code samples
245 Functest util classes
246 =====================
248 In order to simplify the creation of test cases, Functest develops also some
249 functions that are used by internal test cases.
250 Several features are supported such as logger, configuration management and
251 Openstack capabilities (tacker,..).
252 These functions can be found under <repo>/functest/utils and can be described
260 |-- functest_utils.py
261 |-- openstack_tacker.py
262 `-- openstack_utils.py
264 It is recommended to use the SNAPS-OO library for deploying OpenStack
265 instances. SNAPS `[4]`_ is an OPNFV project providing OpenStack utils.
270 Functest is using the Test collection framework and the TestAPI developed by
271 the OPNFV community. See `[6]`_ for details.
276 A web page is automatically generated every day to display the status based on
277 jinja2 templates `[3]`_.
283 Additional dashboarding is managed at the testing group level, see `[7]`_ for
291 See How to section on Functest wiki `[8]`_
298 _`[1]`: http://artifacts.opnfv.org/functest/docs/configguide/index.html Functest configuration guide
300 _`[2]`: http://artifacts.opnfv.org/functest/docs/userguide/index.html functest user guide
302 _`[3]`: https://git.opnfv.org/cgit/releng/tree/utils/test/reporting
304 _`[4]`: https://git.opnfv.org/snaps/
306 _`[5]` : http://testresults.opnfv.org/functest/framework/index.html
308 _`[6]`: http://docs.opnfv.org/en/latest/testing/testing-dev.html
310 _`[7]`: https://opnfv.biterg.io/goto/283dba93ca18e95964f852c63af1d1ba
312 _`[8]`: https://wiki.opnfv.org/pages/viewpage.action?pageId=7768932
314 IRC support chan: #opnfv-functest