blob: ed3be942dc7d3a5ac785b8e35e639730d5335156 [file] [log] [blame]
ajayf66b38e2021-12-09 23:44:54 -08001..
2 SPDX-FileCopyrightText: © 2021 Open Networking Foundation <support@opennetworking.org>
3 SPDX-License-Identifier: Apache-2.0
4
5SD-Core Testing
6===============
7
8Test Framework
9--------------
10
11NG40
12""""
13
14NG40 tool is used as RAN emulator in SD-Core testing. NG40 runs inside a VM
15which is connected to both Aether control plane and data plane. In testing
16scenarios that involve data plane verification, NG40 also emulates a few
17application servers which serve as the destinations of data packets.
18
19A typical NG40 test case involves UE attaching, data plane verification and
20UE detaching. During the test NG40 acts as UEs and eNBs and talks to the
21mobile core to complete attach procedures for each UE it emulates. Then NG40
22verifies that data plane works for each attached UE by sending traffic between
23UEs and application servers. Before finishing each test NG40 performs detach
24procedures for each attached UE.
25
26Test cases
27''''''''''
28
29Currently the following NG40 test cases are implemented:
30
314G Tests:
32
331. ``4G_M2AS_PING_FIX`` (attach, dl ping, detach)
342. ``4G_M2AS_UDP`` (attach, dl+ul udp traffic, detach)
353. ``4G_M2AS_TCP`` (attach, release, service request, dl+ul tcp traffic, detach)
364. ``4G_AS2M_PAGING`` (attach, release, dl udp traffic, detach)
375. ``4G_M2AS_SRQ_UDP`` (attach, release, service request, dl+ul udp traffic)
386. ``4G_M2CN_PS`` (combined IMSI/PTMSI attach, detach)
397. ``4G_HO`` (attach, relocate and dl ping, detach)
408. ``4G_SCALE`` (attach, dl ping, detach with multiple UEs)
41
425G Tests:
43
441. ``5G_SA_Register_Deregister`` (registration, deregistration)
452. ``5G_SA_Register`` (registration, session establishment, deregistration)
463. ``5G_SA_Release`` (registration, session establishment, dl ping, release, deregistration)
474. ``5G_SA_Activate_Release`` (registration, session establishment, dl ping, release, service request,
48 dl ping, deregistration)
495. ``5G_SA_Scale`` (registration, session establishment, dl ping, deregistration for multiple UEs)
506. ``5G_SA_M2AS_ICMP`` (registration, session establishment, dl ping, deregistration)
517. ``5G_SA_M2AS_TCP`` (registration, session establishment, dl+ul tcp traffic, deregistration)
528. ``5G_SA_M2AS_UDP`` (registration, session establishment, dl+ul udp traffic, deregistration)
53
54All the test cases are parameterized and can take arguments to specify number
55of UEs, attach/detach rate, traffic type/rate etc. For example, ``4G_SCALE``
56test case can be configured as a mini scalability test which performs only 5
57UE attaches in a patchset pre-merge test, while in the nightly tests it can
58take different arguments to run 10K UE attaches with a high attach rate.
59
60Test suites
61'''''''''''
62
63The test cases are atomic testing units and can be combined to build test
64suites. The following test suites have been built so far:
65
661. ``functionality test suite`` verifies basic functionality of the
67 mobile core. 4G functionality suite runs 4G test case #1 to #8 including
68 ``4G_SCALE`` which attaches 5 UEs with 1/s attach rate. 5G functionality
69 suite runs 5G test case #1 to #8 including ``5G_SA_Scale`` which attaches
70 100 UEs with 1/s attach rate.
712. ``scalability test suite`` tests the system by scale and verifies
72 system stability. It runs ``4G_SCALE`` (or ``5G_SA_Scale``) which attaches
73 a large number of UEs with high attach rate (16k UEs with 100/s rate on 4G
74 CI pod, 1k UEs with 10/s rate on 4G staging pod, and 1k UEs with 1/s rate
75 on 5G CI pod).
763. ``performance test suite`` measures performance of the control and
77 data plane. It runs ``4G_SCALE`` multiple times with different attach rates
78 to understand how the system performs under different loads.
79
80Robot Framework
81"""""""""""""""
82
83Robot Framework was chosen to build test cases that involve interacting with
84not only NG40 but also other parts of the system. In these scenarios Robot
85Framework acts as a high level orchestrator which drives various components
86of the system using component specific libraries including NG40.
87
88Currently the ``Integration test suite`` is implemented using Robot
89Framework. In the integration tests Robot Framework calls the ng40 library to
90perform normal attach/detach procedures. Meanwhile it injects failures into
91the system (container restarts, link down etc.) by calling functions
92implemented in the k8s library.
93
94The following integration tests are implemented at the moment:
95
961. Subscriber Attach with HSS Restart
972. Subscriber Attach with MME Restart
983. Subscriber Attach with SPGWC Restart
994. Subscriber Attach with PFCP Agent Restart
100
101.. Note::
102 More integration tests are being developed as part of Robot Framework
103
104Test Schedules
105--------------
106
107Nightly Tests
108"""""""""""""
109
110SD-Core nightly tests are a set of jobs managed by Aether Jenkins.
111All four test suites we mentioned above are scheduled to run nightly.
112
1131. ``functionality job (func)`` runs NG40 test cases included in the
114 functionality suite and verifies all tests pass.
1152. ``scalability job (scale)`` runs the scalability test suite and reports
116 the number of successful/failed attaches, detaches and pings.
1173. ``performance job (perf)`` runs the performance test suite and reports
118 SCTP heartbeat RTT, GTP ICMP RTT and call setup latency numbers.
119
120And all these jobs can be scheduled on any of the Aether PODs including
121``ci-4g`` pod, ``ci-5g`` pod, ``staging`` pod and ``qa`` pod. By combining
122the test type and test pod the following Jenkins jobs are generated:
123
1241. ``ci-4g`` pod: `sdcore_func_ci-4g`, `sdcore_scale_ci-4g`, `sdcore_perf_ci-4g`, `sdcore_integ_ci-4g`
1251. ``ci-5g`` pod: `sdcore_func_ci-5g`, `sdcore_scale_ci-5g`
1262. ``staging`` pod: `func_staging`, `scale_staging`, `perf_staging`, `integ_staging`
1273. ``qa`` pod: `func_qa`, `scale_qa`, `perf_qa`, `integ_qa`
128
129Nightly Job structure
130"""""""""""""""""""""
131
132Take `sdcore_scale_ci-4g` job as an example. It runs the following downstream jobs:
133
1341. `omec_deploy_ci-4g`: this job re-deploys the ``ci-4g`` pod with latest OMEC images.
135
136.. Note::
137 only the ``ci-4g`` and ``ci-5g`` pod jobs trigger deployment downstream job. No
138 re-deployment is performed on the staging and qa pod before the tests
139
1402. `ng40-test_ci-4g`: this job executes the scalability test suite.
1413. `archive-artifacts_ci-4g`: this job collects and uploads k8s and container logs.
1424. `post-results_ci-4g`: this job collects the NG40 test logs/pcaps and pushes the
143 test data to database. It also generates plots using Rscript for func and
144 scale tests
145
146The integration tests are written using Robot Framework so have a slightly
147different Jenkins Job structure. Take `sdcore_integ_ci-4g` as an example. It runs the
148following downstream jobs:
149
1501. `omec_deploy_ci-4g`: this job executes the scalability test suite.
1512. `robotframework-test_ci-4g`: this job is similar to `ng40-test_ci-4g` with the
152 exception that instead of directly executing NG40 commands it calls robot
153 framework to execute the test cases and publishes the test results using
154 `RobotPublisher` Jenkins plugin. The robot results will also be copied to
155 the upstream job and published there.
1563. `archive-artifacts_ci-4g`: this job collects and uploads k8s and container logs.
1574. `post-results_ci-4g`: this job collects the NG40 test logs/pcaps and pushes the
158 test data to database. It also generates plots using Rscript for func and
159 scale tests
160
161Patchset Tests
162--------------
163
164SD-Core pre-merge verification covers the following public Github repos: ``c3po``,
165``Nucleus``, ``upf-epc`` and the following private Github repos: ``spgw``. ``amf``,
166``smf``, ``ausf``, ``nssf``, ``nrf``, ``pcf``, ``udm``, ``udr``, ``webconsole``.
167SD-Core CI verifies the following:
168
1691. ONF CLA verification
1702. License verification (FOSSA/Reuse)
1713. NG40 tests
172
173These jobs are automatically triggered by submitted or updated PR to the repos
174above. They can also be triggered manually by commenting ``retest this please``
175to the PR. At this moment only CLI and NG40 verification are mandatory.
176
177The NG40 verification are a set of jobs running on both opencord Jenkins and
178Aether Jenkins (private). The jobs run on opencord Jenkins include
179
1801. `omec_c3po_container_remote <https://jenkins.opencord.org/job/omec_c3po_container_remote/>`_ (public)
1812. `omec_Nucleus_container_remote <https://jenkins.opencord.org/job/omec_Nucleus_container_remote/>`_ (public)
1823. `omec_upf-epc_container_remote <https://jenkins.opencord.org/job/omec_upf-epc_container_remote/>`_ (public)
1834. `omec_spgw_container_remote` (private, under member-only folder)
184
185And the jobs run on Aether Jenkins include
186
1871. `c3po_premerge_ci-4g`
1882. `Nucleus_premerge_ci-4g`
1893. `upf-epc_premerge_ci-4g`
1904. `spgw_premerge_ci-4g`
1915. `amf_premerge_ci-5g`
1926. `smf_premerge_ci-5g`
1937. `ausf_premerge_ci-5g`
1948. `nssf_premerge_ci-5g`
1959. `nrf_premerge_ci-5g`
19610. `pcf_premerge_ci-5g`
19711. `udm_premerge_ci-5g`
19812. `udr_premerge_ci-5g`
19913. `webconsole_premerge_ci-5g`
200
201Patchset Job structure
202""""""""""""""""""""""
203
204Take ``c3po`` jobs as an example. ``c3po`` PR triggers a public job
205`omec_c3po_container_remote
206<https://jenkins.opencord.org/job/omec_c3po_container_remote/>`_ job running
207on opencord Jenkins through Github webhooks, which then triggers a private job
208`c3po_premerge_ci-4g` running on Aether Jenkins using a Jenkins plugin called
209`Parameterized Remote Trigger Plugin
210<https://www.jenkins.io/doc/pipeline/steps/Parameterized-Remote-Trigger/>`_.
211
212The private ``c3po`` job runs the following downstream jobs sequentially:
213
2141. `docker-publish-github_c3po`: this job downloads the ``c3po`` PR, runs docker
215 build and publishes the ``c3po`` docker images to `Aether registry`.
2162. `omec_deploy_ci-4g`: this job deploys the images built from previous job onto
217 the omec ``ci-4g`` pod.
2183. `ng40-test_ci-4g`: this job executes the functionality test suite.
2194. `archive-artifacts_ci-4g`: this job collects and uploads k8s and container logs.
220
221After all the downstream jobs are finished, the upstream job (`c3po_premerge_ci-4g`)
222copies artifacts including k8s/container/ng40 logs and pcap files from
223downstream jobs and saves them as Jenkins job artifacts.
224
225These artifacts are also copied to and published by the public job
226(`omec_c3po_container_remote <https://jenkins.opencord.org/job/omec_c3po_container_remote/>`_)
227on opencord Jenkins so that they can be accessed by the OMEC community.
228
229Pre-merge jobs for other SD-Core repos share the same structure.
230
231Post-merge
232""""""""""
233
234The following jobs are triggered as post-merge jobs when PRs are merged to
235SD-Core repos:
236
2371. `docker-publish-github-merge_c3po`
2382. `docker-publish-github-merge_Nucleus`
2393. `docker-publish-github-merge_upf-epc`
2404. `docker-publish-github-merge_spgw`
2415. `docker-publish-github-merge_amf`
2426. `docker-publish-github-merge_smf`
2437. `docker-publish-github-merge_ausf`
2448. `docker-publish-github-merge_nssf`
2459. `docker-publish-github-merge_nrf`
24610. `docker-publish-github-merge_pcf`
24711. `docker-publish-github-merge_udm`
24812. `docker-publish-github-merge_udr`
24913. `docker-publish-github-merge_webconsole`
250
251Again take the ``c3po`` job as an example. The post-merge job (`docker-publish-github-merge_c3po`)
252runs the following downstream jobs sequentially:
253
2541. `docker-publish-github_c3po`: this is the same job as the one in pre-merge
255 section. It checks out the latest ``c3po`` code, runs docker build and
256 publishes the ``c3po`` docker images to `docker hub <https://hub.docker.com/u/omecproject>`__.
257
258.. Note::
259 the images for private repos are published to Aether registry instead of docker hub
260
2612. `c3po_postrelease`: this job submits a patchset to aether-pod-configs repo
262 for updating the CD pipeline with images published in the job above.
263
264Post-merge jobs for other SD-Core repos share the same structure.