1 .. SPDX-License-Identifier: CC-BY-4.0
3 ************************
4 Functest Developer Guide
5 ************************
14 Functest is a project dealing with functional testing.
15 The project produces its own internal test cases but can also be considered
16 as a framework to support feature and VNF onboarding project testing.
18 Therefore there are many ways to contribute to Functest. You can:
20 * Develop new internal test cases
21 * Integrate the tests from your feature project
22 * Develop the framework to ease the integration of external test cases
24 Additional tasks involving Functest but addressing all the test projects
25 may also be mentioned:
27 * The API / Test collection framework
29 * The automatic reporting portals
30 * The testcase catalog
32 This document describes how, as a developer, you may interact with the
33 Functest project. The first section details the main working areas of
34 the project. The Second part is a list of "How to" to help you to join
35 the Functest family whatever your field of interest is.
38 ========================
39 Functest developer areas
40 ========================
43 Functest High level architecture
44 ================================
46 Functest is a project delivering test containers dedicated to OPNFV.
47 It includes the tools, the scripts and the test scenarios.
48 In Euphrates Alpine containers have been introduced in order to lighten the
49 container and manage testing slicing. The new containers are created according
50 to the different tiers:
52 * functest-core: https://hub.docker.com/r/opnfv/functest-core/
53 * functest-healthcheck: https://hub.docker.com/r/opnfv/functest-healthcheck/
54 * functest-smoke: https://hub.docker.com/r/opnfv/functest-smoke/
55 * functest-vnf: https://hub.docker.com/r/opnfv/functest-vnf/
56 * functest-restapi: https://hub.docker.com/r/opnfv/functest-restapi/
58 Standalone functest dockers are maintained for Euphrates but Alpine containers
61 Functest can be described as follow::
63 +----------------------+
65 | +--------------+ | +-------------------+
67 | | Tools | +------------------+ OPNFV |
68 | | Scripts | | | System Under Test |
71 | +--------------+ | +-------------------+
75 +----------------------+
77 Functest internal test cases
78 ============================
79 The internal test cases in Euphrates are:
92 By internal, we mean that this particular test cases have been developed and/or
93 integrated by functest contributors and the associated code is hosted in the
95 An internal case can be fully developed or a simple integration of
96 upstream suites (e.g. Tempest/Rally developed in OpenStack, or odl suites are
97 just integrated in Functest).
99 The structure of this repository is detailed in `[1]`_.
100 The main internal test cases are in the opnfv_tests subfolder of the
101 repository, the internal test cases can be grouped by domain:
104 * openstack: connection_check, vping_ssh, vping_userdata, tempest_*, rally_*
107 If you want to create a new test case you will have to create a new folder
108 under the testcases directory (See next section for details).
113 Functest is a framework.
115 Historically Functest is released as a docker file, including tools, scripts
116 and a CLI to prepare the environment and run tests.
117 It simplifies the integration of external test suites in CI pipeline and
118 provide commodity tools to collect and display results.
120 Since Colorado, test categories also known as **tiers** have been created to
121 group similar tests, provide consistent sub-lists and at the end optimize
122 test duration for CI (see How To section).
124 The definition of the tiers has been agreed by the testing working group.
133 Functest abstraction classes
134 ============================
136 In order to harmonize test integration, abstraction classes have been
139 * testcase: base for any test case
140 * unit: run unit tests as test case
141 * feature: abstraction for feature project
142 * vnf: abstraction for vnf onboarding
144 The goal is to unify the way to run tests in Functest.
146 Feature, unit and vnf_base inherit from testcase::
148 +----------------------------------------------------------------+
155 | - is_successful() |
157 +----------------------------------------------------------------+
160 +--------------------+ +---------+ +------------------------+ +-----------------+
162 | feature | | unit | | vnf | | robotframework |
164 | | | | |- prepare() | | |
165 | - execute() | | | |- deploy_orchestrator() | | |
166 | BashFeature class | | | |- deploy_vnf() | | |
167 | | | | |- test_vnf() | | |
168 | | | | |- clean() | | |
169 +--------------------+ +---------+ +------------------------+ +-----------------+
172 Functest util classes
173 =====================
175 In order to simplify the creation of test cases, Functest develops also some
176 functions that are used by internal test cases.
177 Several features are supported such as logger, configuration management and
178 Openstack capabilities (tacker,..).
179 These functions can be found under <repo>/functest/utils and can be described
187 |-- functest_utils.py
188 |-- openstack_tacker.py
189 `-- openstack_utils.py
194 Functest is using the Test collection framework and the TestAPI developed by
195 the OPNFV community. See `[4]`_ for details.
200 A web page is automatically generated every day to display the status based on
201 jinja2 templates `[3]`_.
207 Additional dashboarding is managed at the testing group level, see `[5]`_ for
215 See How to section on Functest wiki `[6]`_
222 _`[1]`: http://artifacts.opnfv.org/functest/docs/configguide/index.html Functest configuration guide
224 _`[2]`: http://artifacts.opnfv.org/functest/docs/userguide/index.html functest user guide
226 _`[3]`: https://github.com/opnfv/releng-testresults/tree/master/reporting
228 _`[4]`: https://wiki.opnfv.org/display/functest/2017+Beijing?preview=%2F11699623%2F11700523%2FTestAPI+-+test+results+collection+service.pptx
230 _`[5]`: https://opnfv.biterg.io/login?nextUrl=%2Fgoto%2F283dba93ca18e95964f852c63af1d1ba
232 _`[6]`: https://wiki.opnfv.org/pages/viewpage.action?pageId=7768932
234 IRC support chan: #opnfv-functest