[pcac] clean-up of broken links and outdated text
[opnfvdocs.git] / docs / testing / ecosystem / overview.rst
1 .. _testing_overview:
2
3 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
4 .. SPDX-License-Identifier: CC-BY-4.0
5
6 ======================
7 Anuket Testing Overview
8 ======================
9
10 Introduction
11 ============
12
13 Testing is one of the key activities in Anuket and includes unit, feature,
14 component, system level testing for development, automated deployment,
15 performance characterization and stress testing.
16
17 Test projects are dedicated to provide frameworks, tooling and test-cases categorized as
18 functional, performance or compliance testing. Test projects fulfill different roles such as
19 verifying VIM functionality, benchmarking components and platforms or analysis of measured
20 KPIs for Anuket release scenarios.
21
22 Feature projects also provide their own test suites that either run independently or within a
23 test project.
24
25 This document details the Anuket testing ecosystem, describes common test components used
26 by individual Anuket projects and provides links to project specific documentation.
27
28
29 The Anuket Testing Ecosystem
30 ===========================
31
32 The Anuket testing projects are represented in the following diagram:
33
34 .. figure:: ../../images/OPNFV_testing_working_group.png
35    :align: center
36    :alt: Overview of Anuket Testing projects
37
38 The major testing projects are described in the table below:
39
40 +----------------+---------------------------------------------------------+
41 |  Project       |   Description                                           |
42 +================+=========================================================+
43 | Functest       | This project deals with the functional testing of the   |
44 |                | VIM and NFVI. It leverages several upstream test suites |
45 |                | (OpenStack, ODL, ONOS, etc.) and can be used by feature |
46 |                | project to launch feature test suites in CI/CD.         |
47 |                | The project is used for scenario validation.            |
48 +----------------+---------------------------------------------------------+
49 |  ViNePerf      | ViNePerf provides an automated test-framework and       |
50 |                | comprehensive test suite based on industry standards for|
51 |                | measuring the data-plane performance in different cloud |
52 |                | environments. Dataplane in a cloud includes different   |
53 |                | switching technologies with physical and virtual network|
54 |                | interfaces, and carries traffic to and from workloads   |
55 |                | running as virtual-machines and containers. The         |
56 |                | architecture of ViNePerf is agnostic of cloud-type,     |
57 |                | switching-technology, and traffic-generator. ViNePerf   |
58 |                | allows user to customize the test-cases,                |
59 |                | network-topology, workload-deployment, hardware-        |
60 |                | configuration, and the versions of the software         |
61 |                | components such vswitch, vnf, cnf, cni, etc. ViNePerf   |
62 |                | can be used both pre-deployment and post-deployment of  |
63 |                | the cloud. Though ViNePerf architecture is designed for |
64 |                | evaluation of dataplane of clouds in Lab environments,  |
65 |                | it can also be in production clouds.  ViNePerf methods  |
66 |                | follows standards developed by the IETF and ETSI NFV,   |
67 |                | and contribute to the development of new standards.     |
68 +----------------+---------------------------------------------------------+
69
70
71 ===============================
72 Testing Working Group Resources
73 ===============================
74
75 Test Results Collection Framework
76 =================================
77
78 Any test project running in the global Anuket lab infrastructure and is
79 integrated with Anuket CI can push test results to the community Test Database
80 using a common Test API. This database can be used to track the evolution of
81 testing and analyse test runs to compare results across installers, scenarios
82 and between technically and geographically diverse hardware environments.
83
84 Results from the databse are used to generate a dashboard with the current test
85 status for each testing project. Please note that you can also deploy the Test
86 Database and Test API locally in your own environment.
87
88 Overall Test Architecture
89 -------------------------
90
91 The management of test results can be summarized as follows::
92
93   +-------------+    +-------------+    +-------------+
94   |             |    |             |    |             |
95   |   Test      |    |   Test      |    |   Test      |
96   | Project #1  |    | Project #2  |    | Project #N  |
97   |             |    |             |    |             |
98   +-------------+    +-------------+    +-------------+
99            |               |               |
100            V               V               V
101        +---------------------------------------------+
102        |                                             |
103        |           Test Rest API front end           |
104        |    http://testresults.opnfv.org/test        |
105        |                                             |
106        +---------------------------------------------+
107            ^                |                     ^
108            |                V                     |
109            |     +-------------------------+      |
110            |     |                         |      |
111            |     |    Test Results DB      |      |
112            |     |         Mongo DB        |      |
113            |     |                         |      |
114            |     +-------------------------+      |
115            |                                      |
116            |                                      |
117      +----------------------+        +----------------------+
118      |                      |        |                      |
119      | Testing Dashboards   |        |  Test Landing page   |
120      |                      |        |                      |
121      +----------------------+        +----------------------+
122
123
124 The Test Database
125 -----------------
126 A Mongo DB Database was introduced for the Brahmaputra release.
127 The following collections are declared in this database:
128
129 * pods: the list of pods used for production CI
130 * projects: the list of projects providing test cases
131 * test cases: the test cases related to a given project
132 * results: the results of the test cases
133 * scenarios: the Anuket scenarios tested in CI
134
135 This database can be used by any project through the Test API.
136 Please note that projects may also use additional databases. The Test
137 Database is mainly use to collect CI test results and generate scenario
138 trust indicators. The Test Database is also cloned for Anuket Plugfests in
139 order to provide a private datastore only accessible to Plugfest participants.
140
141
142 Test API description
143 --------------------
144 The Test API is used to declare pods, projects, test cases and test results.
145 Pods correspond to a cluster of machines (3 controller and 2 compute nodes in
146 HA mode) used to run the tests and are defined in the Pharos project.
147 The results pushed in the database are related to pods, projects and test cases.
148 Trying to push results generated from a non-referenced pod will return an error
149 message by the Test API.
150
151 The data model is very basic, 5 objects are available:
152   * Pods
153   * Projects
154   * Test cases
155   * Results
156   * Scenarios
157
158 For detailed information, please go to http://artifacts.opnfv.org/releng/docs/testapi.html
159
160 The code of the Test API is hosted in the releng-testresults repository `[TST2]`_.
161 The static documentation of the Test API can be found at `[TST3]`_.
162 The Test API has been dockerized and may be installed locally in your lab.
163
164 The deployment of the Test API has been automated.
165 A jenkins job manages:
166
167   * the unit tests of the Test API
168   * the creation of a new docker file
169   * the deployment of the new Test API
170   * the archive of the old Test API
171   * the backup of the Mongo DB
172
173 Test API Authorization
174 ----------------------
175
176 PUT/DELETE/POST operations of the TestAPI now require token based authorization. The token needs
177 to be added in the request using a header 'X-Auth-Token' for access to the database.
178
179 e.g::
180
181     headers['X-Auth-Token']
182
183 The value of the header i.e the token can be accessed in the jenkins environment variable
184 *TestApiToken*. The token value is added as a masked password.
185
186 .. code-block:: python
187
188     headers['X-Auth-Token'] = os.environ.get('TestApiToken')
189
190 The above example is in Python. Token based authentication has been added so
191 that only CI pods running Jenkins jobs can access the database. Please note
192 that currently token authorization is implemented but is not yet enabled.
193
194
195 Test Project Reporting
196 ======================
197 The reporting page for the test projects is http://testresults.opnfv.org/reporting/
198
199 .. figure:: ../../images/reporting_page.png
200    :align: center
201    :alt: Testing group reporting page
202
203 This page provides reporting per Anuket release and per testing project.
204
205 .. figure:: ../../images/reportingMaster.png
206    :align: center
207    :alt: Testing group Euphrates reporting page
208
209 An evolution of the reporting page is planned to unify test reporting by creating
210 a landing page that shows the scenario status in one glance (this information was
211 previously consolidated manually on a wiki page). The landing page will be displayed
212 per scenario and show:
213
214  * the status of the deployment
215  * the score from each test suite. There is no overall score, it is determined
216    by each test project.
217  * a trust indicator
218
219
220 Test Case Catalog
221 =================
222 Until the Colorado release, each testing project managed the list of its
223 test cases. This made it very hard to have a global view of the available test
224 cases from the different test projects. A common view was possible through the API
225 but it was not very user friendly.
226 Test cases per project may be listed by calling:
227
228  http://testresults.opnfv.org/test/api/v1/projects/<project_name>/cases
229
230 with project_name: bottlenecks, functest, qtip, storperf, vsperf, yardstick
231
232 A test case catalog has now been realized `[TST4]`_. Roll over the project then
233 click to get the list of test cases, and then click on the case to get more details.
234
235 .. figure:: ../../images/TestcaseCatalog.png
236    :align: center
237    :alt: Testing group testcase catalog
238
239 Test Dashboards
240 ===============
241
242 The Test Dashboard is used to provide a consistent view of the results collected in CI.
243 The results shown on the dashboard are post processed from the Database, which only
244 contains raw results.
245 The dashboard can be used in addition to the reporting page (high level view) to allow
246 the creation of specific graphs according to what the test owner wants to show.
247
248
249 =======================
250 Reference Documentation
251 =======================
252
253
254 `[TST1]`_: Anuket web site
255
256 `[TST2]`_: TestAPI code repository link in releng-testresults
257
258 `[TST3]`_: TestAPI autogenerated documentation
259
260 `[TST4]`_: Testcase catalog
261
262 .. _`[TST1]`: http://www.anuket.org
263 .. _`[TST2]`: https://git.opnfv.org/releng-testresults
264 .. _`[TST3]`: http://artifacts.opnfv.org/releng/docs/testapi.html
265 .. _`[TST4]`: http://testresults.opnfv.org/testing/index.html#!/select/visual