1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
5 Executing Functest suites
6 =========================
8 As mentioned in the configuration guide `[1]`_, Alpine docker containers have
9 been introduced in Euphrates.
10 Tier containers have been created.
11 Assuming that you pulled the container and your environement is ready, you can
12 simply run the tiers by typing (e.g. with functest-healthcheck)::
14 sudo docker run --env-file env \
15 -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/openstack.creds \
16 -v $(pwd)/images:/home/opnfv/functest/images \
17 opnfv/functest-healthcheck
21 +----------------------------+------------------+---------------------+------------------+----------------+
22 | TEST CASE | PROJECT | TIER | DURATION | RESULT |
23 +----------------------------+------------------+---------------------+------------------+----------------+
24 | connection_check | functest | healthcheck | 00:02 | PASS |
25 | api_check | functest | healthcheck | 03:19 | PASS |
26 | snaps_health_check | functest | healthcheck | 00:46 | PASS |
27 +----------------------------+------------------+---------------------+------------------+----------------+
29 You can run functest-healcheck, functest-smoke, functest-features,
30 functest-components and functest-vnf.
32 The result tables show the results by test case, it can be::
36 * SKIP: if the scenario/installer does not support the test case
41 If you want to run the test step by step, you may add docker option then run the
42 different commands within the docker.
44 Considering the healthcheck example, running functest manaully means::
46 sudo docker run -ti --env-file env \
47 -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/openstack.creds \
48 -v $(pwd)/images:/home/opnfv/functest/images \
49 opnfv/functest-healthcheck /bin/bash
51 The docker prompt shall be returned. Then within the docker run the following
54 $ source /home/opnfv/functest/conf/openstack.creds
58 Prior to commencing the Functest environment preparation, we can check
59 the initial status of the environment. Issue the **functest env status**
60 command at the prompt::
63 # Functest environment is not installed.
65 To prepare the Functest docker container for test case execution, type::
67 # functest env prepare
69 # Functest environment ready to run tests.
71 you may also type prepare_env instead of functest env prepare.
73 To list some basic information about an already prepared Functest
74 docker container environment, issue the **functest env show** at the
76 bash-4.3# functest env show
77 +------------------------------+---------------------------------+
78 | FUNCTEST ENVIRONMENT | VALUE |
79 +------------------------------+---------------------------------+
81 | SCENARIO | os-nosdn-nofeature-noha |
82 | DEBUG FLAG | false |
84 | INSTALLER | compass |
86 +------------------------------+---------------------------------+
88 See configuration guide for details on Functest environnement variables.
92 Each Alpine container provided on the docker hub matches with a tier.
93 The following commands are available::
97 ['connection_check', 'api_check', 'snaps_health_check']
98 # functest tier show healthcheck
99 +---------------------+---------------+--------------------------+-------------------------------------------------+------------------------------------+
100 | TIERS | ORDER | CI LOOP | DESCRIPTION | TESTCASES |
101 +---------------------+---------------+--------------------------+-------------------------------------------------+------------------------------------+
102 | healthcheck | 0 | (daily)|(weekly) | First tier to be executed to verify the | connection_check api_check |
103 | | | | basic operations in the VIM. | snaps_health_check |
104 +---------------------+---------------+--------------------------+-------------------------------------------------+------------------------------------+
106 To run all the cases of the tier, type::
108 # functest tier run healthcheck
112 Testcases can be listed, shown and run though the CLI::
114 # functest testcase list
118 # functest testcase show api_check
119 +-------------------+--------------------------------------------------+------------------+---------------------------+
120 | TEST CASE | DESCRIPTION | CRITERIA | DEPENDENCY |
121 +-------------------+--------------------------------------------------+------------------+---------------------------+
122 | api_check | This test case verifies the retrieval of | 100 | ^((?!netvirt).)*$ |
123 | | OpenStack clients: Keystone, Glance, | | |
124 | | Neutron and Nova and may perform some | | |
125 | | simple queries. When the config value of | | |
126 | | snaps.use_keystone is True, functest | | |
127 | | must have access to the cloud's private | | |
129 +-------------------+--------------------------------------------------+------------------+---------------------------+
130 # functest testcase run connection_check
134 You can also type run_tests -t all to run all the tests.
136 Note the list of test cases depend on the installer and the scenario.
139 Reporting results to the test Database
140 ======================================
141 In OPNFV CI we collect all the results from CI. A test APi shall be available
142 as well as a test database `[17]`_.
144 Functest internal API
145 =====================
147 An internal API has been introduced in Euphrates. The goal is to trigger
148 Functest operations through an API in addition of the CLI.
149 This could be considered as a first step towards a pseudo micro services
150 approach where the different test projects could expose and consume APIs to the
153 In Euphrates the main method of the APIs are:
158 * Update hosts info for domain name
159 * Prepare environment
165 * List all testcases within given tier
166 * Get the result of the specified task
167 * Get the log of the specified task
169 See `[16]`_ to get examples on how to use the API.
172 .. _`[1]`: http://docs.opnfv.org/en/latest/submodules/functest/docs/testing/user/configguide/index.html
173 .. _`[16]`: https://wiki.opnfv.org/display/functest/Running+test+cases+via+new+Functest+REST+API
174 .. _`[17]`: http://docs.opnfv.org/en/latest/testing/testing-dev.html