blob: 0f3c686caade42923d7ad5671e6ee2ce43df99f1 [file] [log] [blame]
mrichomme9643b0c2020-11-14 22:36:57 +01001.. This work is licensed under a
2 Creative Commons Attribution 4.0 International License.
mrichomme0fcaa852020-11-26 15:24:27 +01003.. _integration-tests:
mrichomme9643b0c2020-11-14 22:36:57 +01004
5Tests
6=====
7
8.. important::
Lasse Kaihlavirta2d2888a2020-11-18 16:54:36 +02009 Integration is in charge of several types of tests:
mrichomme9643b0c2020-11-14 22:36:57 +010010
Lasse Kaihlavirta2d2888a2020-11-18 16:54:36 +020011 - Use Cases: developed by use case teams, usually complex, demonstrating high value capabilities of ONAP. They may be partially automated and even
mrichomme9643b0c2020-11-14 22:36:57 +010012 integrated in CD.
13 - CSIT Tests: functional tests created by the projects, partially hosted in CSIT repository
Lasse Kaihlavirta2d2888a2020-11-18 16:54:36 +020014 - Automatic Test Cases: these use cases are usually more simple and aim to validate that ONAP is working properly.
mrichomme9643b0c2020-11-14 22:36:57 +010015 These tests have been developed to validate ONAP as a software solution.
Lasse Kaihlavirta2d2888a2020-11-18 16:54:36 +020016 In theory all the main functions shall be covered by such tests in order to have more robust CI/CD and then avoid regressions.
mrichomme9643b0c2020-11-14 22:36:57 +010017 These tests are usually developed and maintained by the integration team.
18
Lasse Kaihlavirta2d2888a2020-11-18 16:54:36 +020019We may also indicate that when the development of the test framework python-onapsdk
20follows standard development quality rules and imposes the creation of
mrichomme9643b0c2020-11-14 22:36:57 +010021unit/functional/integration tests.
22As an example python-onapsdk requires a unit test coverage of 98% before merging
Lasse Kaihlavirta2d2888a2020-11-18 16:54:36 +020023a new feature, which is far above the project criteria in SonarCloud today.
mrichomme9643b0c2020-11-14 22:36:57 +010024
25Use Cases
26---------
27
mrichomme62b24752020-11-24 11:43:00 +010028The use cases of the last release are described in
29:ref:`Verified Use cases <docs_usecases_release>`.
30
mrichomme9643b0c2020-11-14 22:36:57 +010031CSIT Tests
32----------
33
34The CSIT tests are functional tests executed by the projects on mocked
Lasse Kaihlavirta2d2888a2020-11-18 16:54:36 +020035environment to validate their components.
mrichomme9643b0c2020-11-14 22:36:57 +010036Historically it was hosted in a CSIT repository.
37
Lasse Kaihlavirta2d2888a2020-11-18 16:54:36 +020038Integration team invited the projects to bring back such tests back to home
mrichomme9643b0c2020-11-14 22:36:57 +010039repository for 2 main reasons:
40
41- integration cannot be a bottleneck: +2/merge from integration needed for each
42 project
Lasse Kaihlavirta2d2888a2020-11-18 16:54:36 +020043- most of the tests are abandoned and not maintained when hosted in a third party
44 repository leading to CI/CD resource waste and misleading test reporting
mrichomme9643b0c2020-11-14 22:36:57 +010045
morganrol81dc70f2021-04-06 19:57:44 +020046Automated Tests
mrichomme9643b0c2020-11-14 22:36:57 +010047---------------
48
morganrol81dc70f2021-04-06 19:57:44 +020049These tests are run daily/weekly on each new gate (new patchset in OOM, CLAMP
mrichomme9643b0c2020-11-14 22:36:57 +010050or SO). They can be in any language (bash, go, python,...), leveraging any test
51framework (robotframework, MTS, python-onapsdk).
mrichomme0fcaa852020-11-26 15:24:27 +010052They are all embedded in `xtesting <https://pypi.org/project/xtesting/>`_ dockers.
mrichomme9643b0c2020-11-14 22:36:57 +010053
54.. hint::
55 Automatic tests are currently divided in 4 different categories:
56
Lasse Kaihlavirta2d2888a2020-11-18 16:54:36 +020057 - infrastructure-healthcheck: tests from OOM checking the ONAP namespace, certificates...
mrichomme9643b0c2020-11-14 22:36:57 +010058 - healthcheck: basic tests on components
59 - smoke tests: end to end tests
60 - security tests
61
62A dashboard summarizing the status and providing the links to the test result
63page or the logs is automatically created at the end of the execution of the
64tests.
65
66.. figure:: files/tests/test-dashboard.png
67
morganrol81dc70f2021-04-06 19:57:44 +020068 Test dashboard (Guilin version)
69
mrichomme9643b0c2020-11-14 22:36:57 +010070All the pages and artifacts are pushed to LF backend:
71
morganrol81dc70f2021-04-06 19:57:44 +020072- Daily chains: https://logs.onap.org/onap-integration/daily
mrichomme9643b0c2020-11-14 22:36:57 +010073- Weekly chains: https://logs.onap.org/onap-integration/weekly
74- Gating chains: https://logs.onap.org/onap-integration/gating
75
morganrol40061862021-02-12 12:08:34 +010076A video has been recorded to help launching some of the automated tests on ONAP Guilin.
77See `Running ONAP tests in Guilin Video <https://www.youtube.com/watch?v=ABvuJfyGDmw>`_
mrichomme9643b0c2020-11-14 22:36:57 +010078
79Infrastructure Healthcheck Tests
80................................
81
82.. csv-table:: Infrastructure Healthcheck Tests
83 :file: ./files/csv/tests-infrastructure-healthcheck.csv
84 :widths: 20,40,20,20
85 :delim: ;
86 :header-rows: 1
87
mrichomme0fcaa852020-11-26 15:24:27 +010088See `Infrastructure Healthcheck README <https://git.onap.org/integration/xtesting/tree/infra-healthcheck/README.md>`_
mrichomme9643b0c2020-11-14 22:36:57 +010089to adapt then run infrastructure healthcheck tests on your own system.
90
91Please note that the onap-k8s is run 2 times in CD chains. It is run just after
92the installation (onap-k8s) and at the end of the test execution (onap-k8s-teardown)
93in order to collect the logs of the different components during the test execution.
94
95.. figure:: files/tests/test-onap-k8s.png
96
Lasse Kaihlavirta2d2888a2020-11-18 16:54:36 +020097Healthcheck Tests
mrichomme0fcaa852020-11-26 15:24:27 +010098.................
mrichomme9643b0c2020-11-14 22:36:57 +010099
100.. csv-table:: Healthcheck Tests
101 :file: ./files/csv/tests-healthcheck.csv
102 :widths: 20,40,20,20
103 :delim: ;
104 :header-rows: 1
105
mrichomme0fcaa852020-11-26 15:24:27 +0100106See `Healthcheck README <https://git.onap.org/integration/xtesting/tree/healthcheck/README.md>`_
mrichomme9643b0c2020-11-14 22:36:57 +0100107to adapt then run healthcheck tests on your own system.
108
109Smoke Tests
110...........
111
112.. csv-table:: Smoke Tests
113 :file: ./files/csv/tests-smoke.csv
114 :widths: 20,40,20,20
115 :delim: ;
116 :header-rows: 1
117
morganrol40061862021-02-12 12:08:34 +0100118There are 2 main families of smoke tests:
119
120* RobotFramework based tests, usually run from inside the cluster as a k8s job
121* Pythonsdk based tests. These tests (also known as onaptests) are consuming
122 several SDKs: the Openstack and Kubernetes SDK for the management of the cloud
123 resources and the python ONAP SDK for the interactions with ONAP
124
125To launch the the robot based tests, please see
126`Robot smoke test README <https://git.onap.org/integration/xtesting/tree/smoke-usecases-robot/README.md>`_
127Standard Robot html pages are generated. See :ref:`Robot page <docs_robot>`.
128
129To launch the pythonsdk based tests, please see
130`Python smoke test README <https://git.onap.org/integration/xtesting/tree/smoke-usecases-pythonsdk/README.md>`_
131
132.. note:
133 Please note that the OpenStack minimal version is pike.
134
mrichomme9643b0c2020-11-14 22:36:57 +0100135An html page is generated by the pythonsdk-test tests.
136
137.. figure:: files/tests/test-basic-cnf.png
138
mrichomme9643b0c2020-11-14 22:36:57 +0100139Security Tests
140...............
141
142.. csv-table:: Security Tests
143 :file: ./files/csv/tests-security.csv
144 :widths: 20,40,20,20
145 :delim: ;
146 :header-rows: 1
147
mrichomme0fcaa852020-11-26 15:24:27 +0100148See `Security test README <https://git.onap.org/integration/xtesting/tree/security/README.md>`_
mrichomme9643b0c2020-11-14 22:36:57 +0100149to adapt then run the security tests on your own system.
150
151Note for security tests, integration team follows `SECCOM recommendations and
mrichomme0fcaa852020-11-26 15:24:27 +0100152apply waivers granted by SECCOM if needed through xfail lists <https://git.onap.org/integration/seccom/tree/>`_.
mrichomme9643b0c2020-11-14 22:36:57 +0100153
morganrol81dc70f2021-04-06 19:57:44 +0200154Stability/Resiliency tests
155--------------------------
mrichomme9643b0c2020-11-14 22:36:57 +0100156
157Ensuring the stability of ONAP is one of the missions of the Integration team.
158CI chains and stability tests are performed to help stabilising the release.
159See :ref:`Integration stability tests <integration-s3p>` for details.