Refactor tempest common
[functest.git] / docs / testing / user / userguide / runfunctest.rst
1 .. SPDX-License-Identifier: CC-BY-4.0
2
3 Executing Functest suites
4 =========================
5
6 As mentioned in the configuration guide `[1]`_, Alpine docker containers have
7 been introduced in Euphrates.
8 Tier containers have been created.
9 Assuming that you pulled the container and your environement is ready, you can
10 simply run the tiers by typing (e.g. with functest-healthcheck)::
11
12   sudo docker run --env-file env \
13       -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/env_file  \
14       -v $(pwd)/images:/home/opnfv/functest/images  \
15       opnfv/functest-healthcheck
16
17 You should get::
18
19   +----------------------------+------------------+---------------------+------------------+----------------+
20   |         TEST CASE          |     PROJECT      |         TIER        |     DURATION     |     RESULT     |
21   +----------------------------+------------------+---------------------+------------------+----------------+
22   |      connection_check      |     functest     |     healthcheck     |      00:02       |      PASS      |
23   |         api_check          |     functest     |     healthcheck     |      03:19       |      PASS      |
24   |     snaps_health_check     |     functest     |     healthcheck     |      00:46       |      PASS      |
25   +----------------------------+------------------+---------------------+------------------+----------------+
26
27 You can run functest-healcheck, functest-smoke, functest-features,
28 functest-components and functest-vnf.
29
30 The result tables show the results by test case, it can be::
31
32   * PASS
33   * FAIL
34   * SKIP: if the scenario/installer does not support the test case
35
36
37 Manual run
38 ==========
39 If you want to run the test step by step, you may add docker option then run
40 the different commands within the docker.
41
42 Considering the healthcheck example, running functest manaully means::
43
44   sudo docker run -ti --env-file env \
45     -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/env_file  \
46     -v $(pwd)/images:/home/opnfv/functest/images  \
47     opnfv/functest-healthcheck /bin/bash
48
49 The docker prompt shall be returned. Then within the docker run the following
50 commands::
51
52   $ source /home/opnfv/functest/conf/env_file
53
54 Tier
55 ----
56 Each Alpine container provided on the docker hub matches with a tier.
57 The following commands are available::
58
59   # functest tier list
60     - 0. healthcheck:
61     ['connection_check', 'api_check', 'snaps_health_check']
62   # functest tier show healthcheck
63   +---------------------+---------------+--------------------------+-------------------------------------------------+------------------------------------+
64   |        TIERS        |     ORDER     |         CI LOOP          |                   DESCRIPTION                   |             TESTCASES              |
65   +---------------------+---------------+--------------------------+-------------------------------------------------+------------------------------------+
66   |     healthcheck     |       0       |     (daily)|(weekly)     |     First tier to be executed to verify the     |     connection_check api_check     |
67   |                     |               |                          |           basic operations in the VIM.          |         snaps_health_check         |
68   +---------------------+---------------+--------------------------+-------------------------------------------------+------------------------------------+
69
70 To run all the cases of the tier, type::
71
72   # functest tier run healthcheck
73
74 Testcase
75 --------
76 Testcases can be listed, shown and run though the CLI::
77
78   # functest testcase list
79    connection_check
80    api_check
81    snaps_health_check
82   # functest testcase show api_check
83   +-------------------+--------------------------------------------------+------------------+---------------------------+
84   |     TEST CASE     |                   DESCRIPTION                    |     CRITERIA     |         DEPENDENCY        |
85   +-------------------+--------------------------------------------------+------------------+---------------------------+
86   |     api_check     |     This test case verifies the retrieval of     |       100        |       ^((?!lxd).)*$       |
87   |                   |       OpenStack clients: Keystone, Glance,       |                  |                           |
88   |                   |      Neutron and Nova and may perform some       |                  |                           |
89   |                   |     simple queries. When the config value of     |                  |                           |
90   |                   |       snaps.use_keystone is True, functest       |                  |                           |
91   |                   |     must have access to the cloud's private      |                  |                           |
92   |                   |                     network.                     |                  |                           |
93   +-------------------+--------------------------------------------------+------------------+---------------------------+
94   # functest testcase run connection_check
95   ...
96   # functest run all
97
98 You can also type run_tests -t all to run all the tests.
99
100 Note the list of test cases depend on the installer and the scenario.
101
102 Note that the flavors for the SNAPS test cases are able to be configured giving
103 new metadata values as well as new values for the basic elements of flavor
104 (i.e. ram, vcpu, disk, ephemeral, swap etc).
105 The snaps.flavor_extra_specs dict in the config_functest.yaml file could be
106 used for this purpose.
107
108 Reporting results to the test Database
109 ======================================
110 In OPNFV CI we collect all the results from CI. A test API shall be available
111 as well as a test database `[16]`_.
112
113
114 .. _`[1]`: http://docs.opnfv.org/en/latest/submodules/functest/docs/testing/user/configguide/index.html
115 .. _`[16]`: http://docs.opnfv.org/en/latest/testing/testing-dev.html