blob: 73613c4c6fd73e5b48975e30987b9e3fbcb065eb [file] [log] [blame]
You Wangee3a4db2021-04-13 18:50:40 -07001..
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
14Overview
15^^^^^^^^
16
17NG40 tool is used as RAN emulator in SD-Core testing. NG40 runs inside a VM
18which is connected to both Aether control plane and data plane. In testing
19scenarios that involve data plane verifications, NG40 also emulates a few
20application servers which serve as the destinations of data packets.
21
22A typical NG40 test case involves UE attaching, data plane verifications and
23UE detaching. During the test NG40 acts as UEs and eNBs and talks to the
24mobile core to complete attach procedures for each UE it emulates. Then NG40
25verifies that data plane works for each attached UE by sending traffic between
26UEs and application servers. Before finishing each test NG40 performs detach
27procedures for each attached UE.
28
29Test cases
30^^^^^^^^^^
31
32Currently the following NG40 test cases are implemented:
33
You Wangaeb9c112021-08-03 11:45:27 -0700344G Tests:
35
You Wangee3a4db2021-04-13 18:50:40 -0700361. ``4G_M2AS_PING_FIX`` (attach, dl ping, detach)
372. ``4G_M2AS_UDP`` (attach, dl+ul udp traffic, detach)
383. ``4G_M2AS_TCP`` (attach, relaese, service request, dl+ul tcp traffic, detach)
394. ``4G_AS2M_PAGING`` (attach, release, dl udp traffic, detach)
405. ``4G_M2AS_SRQ_UDP`` (attach, release, service request, dl+ul udp traffic)
416. ``4G_M2CN_PS`` (combined IMSI/PTMSI attach, detach)
You Wangaeb9c112021-08-03 11:45:27 -0700427. ``4G_HO`` (attach, relocate and dl ping, detach)
438. ``4G_SCALE`` (attach, dl ping, detach with multiple UEs)
44
455G Tests:
46
471. ``5G_SA_Register_Deregister`` (registration, deregistration)
482. ``5G_SA_Register`` (registration, session establishment, deregistration)
493. ``5G_SA_Release`` (registration, session establishment, dl ping, release, deregistration)
504. ``5G_SA_Activate_Release`` (registration, session establishment, dl ping, release, service request,
51 dl ping, deregistration)
525. ``5G_SA_Scale`` (registration, session establishment, dl ping, deregistration for multiple UEs)
536. ``5G_SA_M2AS_ICMP`` (registration, session establishment, dl ping, deregistration)
547. ``5G_SA_M2AS_TCP`` (registration, session establishment, dl+ul tcp traffic, deregistration)
558. ``5G_SA_M2AS_UDP`` (registration, session establishment, dl+ul udp traffic, deregistration)
You Wangee3a4db2021-04-13 18:50:40 -070056
57All the test cases are parameterized and can take arguments to specify number
58of UEs, attach/detach rate, traffic type/rate etc. For example, ``4G_SCALE``
59test case can be configured as a mini scalability test which performs only 5
60UE attaches in a patchset pre-merge test, while in the nightly tests it can
61take different arguments to run 10K UE attaches with a high attach rate.
62
63Test suites
64^^^^^^^^^^^
65
66The test cases are atomic testing units and can be combined to build test
67suites. The following test suites have been built so far:
68
You Wangaa558852021-04-15 15:41:54 -0700691. ``functionality test suite`` verifies basic functionality of the
You Wangaeb9c112021-08-03 11:45:27 -070070 mobile core. 4G functionality suite runs 4G test case #1 to #8 including
71 ``4G_SCALE`` which attaches 5 UEs with 1/s attach rate. 5G functionality
72 suite runs 5G test case #1 to #8 including ``5G_SA_Scale`` which attaches
73 100 UEs with 1/s attach rate.
You Wangaa558852021-04-15 15:41:54 -0700742. ``scalability test suite`` tests the system by scale and verifies
You Wangaeb9c112021-08-03 11:45:27 -070075 system stability. It runs ``4G_SCALE`` (or ``5G_SA_Scale``) which attaches
76 a large number of UEs with high attach rate (16k UEs with 100/s rate on 4G
77 CI pod, 1k UEs with 10/s rate on 4G staging pod, and 1k UEs with 1/s rate
78 on 5G CI pod).
You Wangaa558852021-04-15 15:41:54 -0700793. ``performance test suite`` measures performance of the control and
80 data plane. It runs ``4G_SCALE`` multiple times with different attach rates
81 to understand how the system performs under different loads.
You Wangee3a4db2021-04-13 18:50:40 -070082
83Robot Framework
84~~~~~~~~~~~~~~~
85
86Robot Framework was chosen to build test cases that involve interacting with
87not only NG40 but also other parts of the system. In these scenarios Robot
88Framework acts as a high level orchestrator which drives various components
89of the system using component specific libraries including NG40.
90
91Currently the ``Integration test suite`` is implemented using Robot
92Framework. In the integration tests Robot Framework calls ng40 library to
93perform normal attach/detach procedures. Meanwhile it injects failures into
94the system (container restarts, link down etc.) by calling functions
95implemented in the k8s library.
96
97The following integration tests are implemented at the moment:
98
You Wangaa558852021-04-15 15:41:54 -0700991. Subscriber Attach with HSS Restart
1002. Subscriber Attach with MME Restart
1013. Subscriber Attach with SPGWC Restart
1024. Subscriber Attach with PFCP Agent Restart
You Wangee3a4db2021-04-13 18:50:40 -0700103
104.. Note::
You Wangaa558852021-04-15 15:41:54 -0700105 More integration tests are being developed as part of Robot Framework
You Wangee3a4db2021-04-13 18:50:40 -0700106
107Test Schedules
108--------------
109
110Nightly Tests
111~~~~~~~~~~~~~
112
113Overview
114^^^^^^^^
115
116SD-Core nightly tests are a set of jobs managed by Aether Jenkins.
117All four test suites we mentioned above are scheduled to run nightly.
118
You Wangaa558852021-04-15 15:41:54 -07001191. ``functionality job (func)`` runs NG40 test cases included in the
120 functionality suite and verifies all tests pass.
1212. ``scalability job (scale)`` runs the scalability test suite and reports
122 the number of successful/failed attaches, detaches and pings.
1233. ``performance job (perf)`` runs the performance test suite and reports
124 SCTP heartbeat RTT, GTP ICMP RTT and call setup latency numbers.
You Wangee3a4db2021-04-13 18:50:40 -0700125
126And all these jobs can be scheduled on any of the Aether PODs including
You Wangaeb9c112021-08-03 11:45:27 -0700127``ci-4g`` pod, ``ci-5g`` pod, ``staging`` pod and ``qa`` pod. By combining
128the test type and test pod the following Jenkins jobs are generated:
You Wangee3a4db2021-04-13 18:50:40 -0700129
You Wangaeb9c112021-08-03 11:45:27 -07001301. ``ci-4g`` pod: `sdcore_func_ci-4g`, `sdcore_scale_ci-4g`, `sdcore_perf_ci-4g`, `sdcore_integ_ci-4g`
1311. ``ci-5g`` pod: `sdcore_func_ci-5g`, `sdcore_scale_ci-5g`
You Wangaa558852021-04-15 15:41:54 -07001322. ``staging`` pod: `func_staging`, `scale_staging`, `perf_staging`, `integ_staging`
1333. ``qa`` pod: `func_qa`, `scale_qa`, `perf_qa`, `integ_qa`
You Wangee3a4db2021-04-13 18:50:40 -0700134
135Job structure
136^^^^^^^^^^^^^
137
You Wangaeb9c112021-08-03 11:45:27 -0700138Take `sdcore_scale_ci-4g` job as an example. It runs the following downstream jobs:
You Wangee3a4db2021-04-13 18:50:40 -0700139
You Wangaeb9c112021-08-03 11:45:27 -07001401. `omec_deploy_ci-4g`: this job re-deploys the ci-4g pod with latest OMEC images.
You Wangee3a4db2021-04-13 18:50:40 -0700141
142.. Note::
You Wangaeb9c112021-08-03 11:45:27 -0700143 only the ci-4g and ci-5g pod jobs trigger deployment downstream job. No
You Wangaa558852021-04-15 15:41:54 -0700144 re-deployment is performed on the staging and qa pod before the tests
You Wangee3a4db2021-04-13 18:50:40 -0700145
You Wangaeb9c112021-08-03 11:45:27 -07001462. `ng40-test_ci-4g`: this job executes the scalability test suite.
1473. `archive-artifacts_ci-4g`: this job collects and uploads k8s and container logs.
1484. `post-results_ci-4g`: this job collects the NG40 test logs/pcaps and pushes the
You Wangaa558852021-04-15 15:41:54 -0700149 test data to database. It also generates plots using Rscript for func and
150 scale tests
You Wangee3a4db2021-04-13 18:50:40 -0700151
152The integration tests are written using Robot Framework so have a slightly
You Wangaeb9c112021-08-03 11:45:27 -0700153different Jenkins Job structure. Take `sdcore_integ_ci-4g` as an example. It runs the
You Wangee3a4db2021-04-13 18:50:40 -0700154following downstream jobs:
155
You Wangaeb9c112021-08-03 11:45:27 -07001561. `omec_deploy_ci-4g`: this job executes the scalability test suite.
1572. `robotframework-test_ci-4g`: this job is similar to `ng40-test_ci-4g` with the
You Wangaa558852021-04-15 15:41:54 -0700158 exception that instead of directly executing NG40 commands it calls robot
Zack Williams4c1eab92021-05-28 11:37:14 -0700159 framework to execute the test cases and publishes the test results using
You Wangaa558852021-04-15 15:41:54 -0700160 `RobotPublisher` Jenkins plugin. The robot results will also be copied to
161 the upstream job and published there.
You Wangaeb9c112021-08-03 11:45:27 -07001623. `archive-artifacts_ci-4g`: this job collects and uploads k8s and container logs.
1634. `post-results_ci-4g`: this job collects the NG40 test logs/pcaps and pushes the
You Wangaa558852021-04-15 15:41:54 -0700164 test data to database. It also generates plots using Rscript for func and
165 scale tests
You Wangee3a4db2021-04-13 18:50:40 -0700166
167Patchset Tests
168~~~~~~~~~~~~~~
169
170Overview
171^^^^^^^^
172
You Wangaeb9c112021-08-03 11:45:27 -0700173SD-Core pre-merge verifications cover the following public Github repos: ``c3po``,
174``Nucleus``, ``upf-epc`` and the following private Github repos: ``spgw``. ``amf``,
175``smf``, ``ausf``, ``nssf``, ``nrf``, ``pcf``, ``udm``, ``udr``, ``webconsole``.
176SD-Core CI includes the following verifications:
You Wangee3a4db2021-04-13 18:50:40 -0700177
You Wangaa558852021-04-15 15:41:54 -07001781. ONF CLA verification
1792. License verifications (FOSSA/Reuse)
1803. NG40 tests
You Wangee3a4db2021-04-13 18:50:40 -0700181
182These verifications are automatically triggered by submitted or updated PR to
183the repos above. They can also be triggered manually by commenting ``retest
184this please`` to the PR. At this moment only CLI and NG40 verifications are
185mandatory.
186
187The NG40 verifications are a set of jobs running on both opencord Jenkins and
188Aether Jenkins (private). The jobs run on opencord Jenkins include
189
You Wangaa558852021-04-15 15:41:54 -07001901. `omec_c3po_container_remote <https://jenkins.opencord.org/job/omec_c3po_container_remote/>`_ (public)
1912. `omec_Nucleus_container_remote <https://jenkins.opencord.org/job/omec_Nucleus_container_remote/>`_ (public)
1923. `omec_upf-epc_container_remote <https://jenkins.opencord.org/job/omec_upf-epc_container_remote/>`_ (public)
1934. `omec_spgw_container_remote` (private, under member-only folder)
You Wangee3a4db2021-04-13 18:50:40 -0700194
195And the jobs run on Aether Jenkins include
196
You Wangaeb9c112021-08-03 11:45:27 -07001971. `c3po_premerge_ci-4g`
1982. `Nucleus_premerge_ci-4g`
1993. `upf-epc_premerge_ci-4g`
2004. `spgw_premerge_ci-4g`
2015. `amf_premerge_ci-5g`
2026. `smf_premerge_ci-5g`
2037. `ausf_premerge_ci-5g`
2048. `nssf_premerge_ci-5g`
2059. `nrf_premerge_ci-5g`
20610. `pcf_premerge_ci-5g`
20711. `udm_premerge_ci-5g`
20812. `udr_premerge_ci-5g`
20913. `webconsole_premerge_ci-5g`
You Wangee3a4db2021-04-13 18:50:40 -0700210
211Job structure
212^^^^^^^^^^^^^
213
214Take c3po jobs as an example. c3po PR triggers a public job `omec_c3po_container_remote <https://jenkins.opencord.org/job/omec_c3po_container_remote/>`__
215job running on opencord Jenkins through Github webhooks,
You Wangaeb9c112021-08-03 11:45:27 -0700216which then triggers a private job `c3po_premerge_ci-4g` running on Aether Jenkins
You Wangee3a4db2021-04-13 18:50:40 -0700217using a Jenkins plugin called `Parameterized Remote Trigger Plugin <https://www.jenkins.io/doc/pipeline/steps/Parameterized-Remote-Trigger/>`__.
218
219The private c3po job runs the following downstream jobs sequentially:
220
You Wangaa558852021-04-15 15:41:54 -07002211. `docker-publish-github_c3po`: this job downloads the c3po PR, runs docker
222 build and publishes the c3po docker images to `Aether registry`.
You Wangaeb9c112021-08-03 11:45:27 -07002232. `omec_deploy_ci-4g`: this job deploys the images built from previous job onto
224 the omec ci-4g pod.
2253. `ng40-test_ci-4g`: this job executes the functionality test suite.
2264. `archive-artifacts_ci-4g`: this job collects and uploads k8s and container logs.
You Wangee3a4db2021-04-13 18:50:40 -0700227
You Wangaeb9c112021-08-03 11:45:27 -0700228After all the downstream jobs are finished, the upstream job (`c3po_premerge_ci-4g`)
You Wangee3a4db2021-04-13 18:50:40 -0700229copies artifacts including k8s/container/NG40 logs and pcap files from
230downstream jobs and saves them as Jenkins job artifacts.
231
232These artifacts are also copied to and published by the public job
233(`omec_c3po_container_remote <https://jenkins.opencord.org/job/omec_c3po_container_remote/>`__)
234on opencord Jenkins so that they can be accessed by the OMEC community.
235
You Wangaeb9c112021-08-03 11:45:27 -0700236Pre-merge jobs for other SD-Core repos share the same structure.
You Wangee3a4db2021-04-13 18:50:40 -0700237
238Post-merge
239^^^^^^^^^^
240
241The following jobs are triggered as post-merge jobs when PRs are merged to
You Wangaeb9c112021-08-03 11:45:27 -0700242SD-Core repos:
You Wangee3a4db2021-04-13 18:50:40 -0700243
You Wangaa558852021-04-15 15:41:54 -07002441. `docker-publish-github-merge_c3po`
2452. `docker-publish-github-merge_Nucleus`
2463. `docker-publish-github-merge_upf-epc`
2474. `docker-publish-github-merge_spgw`
You Wangaeb9c112021-08-03 11:45:27 -07002485. `docker-publish-github-merge_amf`
2496. `docker-publish-github-merge_smf`
2507. `docker-publish-github-merge_ausf`
2518. `docker-publish-github-merge_nssf`
2529. `docker-publish-github-merge_nrf`
25310. `docker-publish-github-merge_pcf`
25411. `docker-publish-github-merge_udm`
25512. `docker-publish-github-merge_udr`
25613. `docker-publish-github-merge_webconsole`
You Wangee3a4db2021-04-13 18:50:40 -0700257
258Again take the c3po job as an example. The post-merge job (`docker-publish-github-merge_c3po`)
259runs the following downstream jobs sequentially:
260
You Wangaa558852021-04-15 15:41:54 -07002611. `docker-publish-github_c3po`: this is the same job as the one in pre-merge
262 section. It checks out the latest c3po code, runs docker build and
263 publishes the c3po docker images to `docker hub <https://hub.docker.com/u/omecproject>`__.
You Wangee3a4db2021-04-13 18:50:40 -0700264
265.. Note::
You Wangaeb9c112021-08-03 11:45:27 -0700266 the images for private repos are published to Aether registry instead of docker hub
You Wangee3a4db2021-04-13 18:50:40 -0700267
You Wangaa558852021-04-15 15:41:54 -07002682. `c3po_postrelease`: this job submits a patchset to aether-pod-configs repo
269 for updating the CD pipeline with images published in the job above.
You Wangee3a4db2021-04-13 18:50:40 -0700270
You Wangaeb9c112021-08-03 11:45:27 -0700271Post-merge jobs for other SD-Core repos share the same structure.