Merge "support fuel&daisy for doctor in functest"
[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        |     ^((?!netvirt).)*$     |
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
103 Reporting results to the test Database
104 ======================================
105 In OPNFV CI we collect all the results from CI. A test API shall be available
106 as well as a test database `[17]`_.
107
108 Functest internal API
109 =====================
110
111 An internal API has been introduced in Euphrates. The goal is to trigger
112 Functest operations through an API in addition of the CLI.
113 This could be considered as a first step towards a pseudo micro services
114 approach where the different test projects could expose and consume APIs to the
115 other test projects.
116
117 In Euphrates the main method of the APIs are:
118
119   * Show credentials
120   * Update openrc file
121   * Show environment
122   * Update hosts info for domain name
123   * Prepare environment
124   * List all testcases
125   * Show a testcase
126   * Run a testcase
127   * List all tiers
128   * Show a tier
129   * List all testcases within given tier
130   * Get the result of the specified task
131   * Get the log of the specified task
132
133 See `[16]`_ to get examples on how to use the API.
134
135
136 .. _`[1]`: http://docs.opnfv.org/en/latest/submodules/functest/docs/testing/user/configguide/index.html
137 .. _`[16]`: https://wiki.opnfv.org/display/functest/Running+test+cases+via+new+Functest+REST+API
138 .. _`[17]`: http://docs.opnfv.org/en/latest/testing/testing-dev.html