blob: 22b5f3a79c20c3385ef893a3dde0e8fc9c399902 [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
341. ``4G_M2AS_PING_FIX`` (attach, dl ping, detach)
352. ``4G_M2AS_UDP`` (attach, dl+ul udp traffic, detach)
363. ``4G_M2AS_TCP`` (attach, relaese, service request, dl+ul tcp traffic, detach)
374. ``4G_AS2M_PAGING`` (attach, release, dl udp traffic, detach)
385. ``4G_M2AS_SRQ_UDP`` (attach, release, service request, dl+ul udp traffic)
396. ``4G_M2CN_PS`` (combined IMSI/PTMSI attach, detach)
407. ``4G_HO`` (attach, relocate and ping, detach)
418. ``4G_SCALE`` (attach with multiple UEs, ping, detach)
42
43All the test cases are parameterized and can take arguments to specify number
44of UEs, attach/detach rate, traffic type/rate etc. For example, ``4G_SCALE``
45test case can be configured as a mini scalability test which performs only 5
46UE attaches in a patchset pre-merge test, while in the nightly tests it can
47take different arguments to run 10K UE attaches with a high attach rate.
48
49Test suites
50^^^^^^^^^^^
51
52The test cases are atomic testing units and can be combined to build test
53suites. The following test suites have been built so far:
54
You Wangaa558852021-04-15 15:41:54 -0700551. ``functionality test suite`` verifies basic functionality of the
56 mobile core. It runs test case #1 to #8 including ``4G_SCALE`` which attaches
57 5 UEs with 1/s attach rate
582. ``scalability test suite`` tests the system by scale and verifies
59 system stability. It runs ``4G_SCALE`` which attaches a large number of UEs
60 with high attach rate (16k UEs with 100/s rate on dev pod, and 10k UEs with
61 10/s rate on staging pod)
623. ``performance test suite`` measures performance of the control and
63 data plane. It runs ``4G_SCALE`` multiple times with different attach rates
64 to understand how the system performs under different loads.
You Wangee3a4db2021-04-13 18:50:40 -070065
66Robot Framework
67~~~~~~~~~~~~~~~
68
69Robot Framework was chosen to build test cases that involve interacting with
70not only NG40 but also other parts of the system. In these scenarios Robot
71Framework acts as a high level orchestrator which drives various components
72of the system using component specific libraries including NG40.
73
74Currently the ``Integration test suite`` is implemented using Robot
75Framework. In the integration tests Robot Framework calls ng40 library to
76perform normal attach/detach procedures. Meanwhile it injects failures into
77the system (container restarts, link down etc.) by calling functions
78implemented in the k8s library.
79
80The following integration tests are implemented at the moment:
81
You Wangaa558852021-04-15 15:41:54 -0700821. Subscriber Attach with HSS Restart
832. Subscriber Attach with MME Restart
843. Subscriber Attach with SPGWC Restart
854. Subscriber Attach with PFCP Agent Restart
You Wangee3a4db2021-04-13 18:50:40 -070086
87.. Note::
You Wangaa558852021-04-15 15:41:54 -070088 More integration tests are being developed as part of Robot Framework
You Wangee3a4db2021-04-13 18:50:40 -070089
90Test Schedules
91--------------
92
93Nightly Tests
94~~~~~~~~~~~~~
95
96Overview
97^^^^^^^^
98
99SD-Core nightly tests are a set of jobs managed by Aether Jenkins.
100All four test suites we mentioned above are scheduled to run nightly.
101
You Wangaa558852021-04-15 15:41:54 -07001021. ``functionality job (func)`` runs NG40 test cases included in the
103 functionality suite and verifies all tests pass.
1042. ``scalability job (scale)`` runs the scalability test suite and reports
105 the number of successful/failed attaches, detaches and pings.
1063. ``performance job (perf)`` runs the performance test suite and reports
107 SCTP heartbeat RTT, GTP ICMP RTT and call setup latency numbers.
You Wangee3a4db2021-04-13 18:50:40 -0700108
109And all these jobs can be scheduled on any of the Aether PODs including
110``dev`` pod, ``staging`` pod and ``qa`` pod. By combining the test type and
111test pod the following Jenkins jobs are generated:
112
You Wangaa558852021-04-15 15:41:54 -07001131. ``dev`` pod: `func_dev`, `scale_dev`, `perf_dev`, `integ_dev`
1142. ``staging`` pod: `func_staging`, `scale_staging`, `perf_staging`, `integ_staging`
1153. ``qa`` pod: `func_qa`, `scale_qa`, `perf_qa`, `integ_qa`
You Wangee3a4db2021-04-13 18:50:40 -0700116
117Job structure
118^^^^^^^^^^^^^
119
120Take `scale_dev` job as an example. It runs the following downstream jobs:
121
You Wangaa558852021-04-15 15:41:54 -07001221. `omec_deploy_dev`: this job re-deploys the dev pod with latest OMEC images.
You Wangee3a4db2021-04-13 18:50:40 -0700123
124.. Note::
You Wangaa558852021-04-15 15:41:54 -0700125 only the dev pod job triggers a deployment downstream job. No
126 re-deployment is performed on the staging and qa pod before the tests
You Wangee3a4db2021-04-13 18:50:40 -0700127
You Wangaa558852021-04-15 15:41:54 -07001282. `ng40-test_dev`: this job executes the scalability test suite.
1293. `archive-artifacts_dev`: this job collects and uploads k8s and container logs.
1304. `post-results_dev`: this job collects the NG40 test logs/pcaps and pushes the
131 test data to database. It also generates plots using Rscript for func and
132 scale tests
You Wangee3a4db2021-04-13 18:50:40 -0700133
134The integration tests are written using Robot Framework so have a slightly
135different Jenkins Job structure. Take `integ_dev` as an example. It runs the
136following downstream jobs:
137
You Wangaa558852021-04-15 15:41:54 -07001381. `omec_deploy_dev`: this job executes the scalability test suite.
1392. `robotframework-test_dev`: this job is similar to `ng40-test_dev` with the
140 exception that instead of directly executing NG40 commands it calls robot
Zack Williams4c1eab92021-05-28 11:37:14 -0700141 framework to execute the test cases and publishes the test results using
You Wangaa558852021-04-15 15:41:54 -0700142 `RobotPublisher` Jenkins plugin. The robot results will also be copied to
143 the upstream job and published there.
1443. `archive-artifacts_dev`: this job collects and uploads k8s and container logs.
1454. `post-results_dev`: this job collects the NG40 test logs/pcaps and pushes the
146 test data to database. It also generates plots using Rscript for func and
147 scale tests
You Wangee3a4db2021-04-13 18:50:40 -0700148
149Patchset Tests
150~~~~~~~~~~~~~~
151
152Overview
153^^^^^^^^
154
155SD-Core pre-merge verifications cover the following Github repos: ``c3po``,
156``Nucleus``, ``upf-epc`` and ``spgw`` (private). OMEC CI includes the following
157verifications:
158
You Wangaa558852021-04-15 15:41:54 -07001591. ONF CLA verification
1602. License verifications (FOSSA/Reuse)
1613. NG40 tests
You Wangee3a4db2021-04-13 18:50:40 -0700162
163These verifications are automatically triggered by submitted or updated PR to
164the repos above. They can also be triggered manually by commenting ``retest
165this please`` to the PR. At this moment only CLI and NG40 verifications are
166mandatory.
167
168The NG40 verifications are a set of jobs running on both opencord Jenkins and
169Aether Jenkins (private). The jobs run on opencord Jenkins include
170
You Wangaa558852021-04-15 15:41:54 -07001711. `omec_c3po_container_remote <https://jenkins.opencord.org/job/omec_c3po_container_remote/>`_ (public)
1722. `omec_Nucleus_container_remote <https://jenkins.opencord.org/job/omec_Nucleus_container_remote/>`_ (public)
1733. `omec_upf-epc_container_remote <https://jenkins.opencord.org/job/omec_upf-epc_container_remote/>`_ (public)
1744. `omec_spgw_container_remote` (private, under member-only folder)
You Wangee3a4db2021-04-13 18:50:40 -0700175
176And the jobs run on Aether Jenkins include
177
You Wangaa558852021-04-15 15:41:54 -07001781. `c3po_premerge_dev`
1792. `Nucleus_premerge_dev`
1803. `upf-epc_premerge_dev`
1814. `spgw_premerge_dev`
You Wangee3a4db2021-04-13 18:50:40 -0700182
183Job structure
184^^^^^^^^^^^^^
185
186Take c3po jobs as an example. c3po PR triggers a public job `omec_c3po_container_remote <https://jenkins.opencord.org/job/omec_c3po_container_remote/>`__
187job running on opencord Jenkins through Github webhooks,
188which then triggers a private job `c3po_premerge_dev` running on Aether Jenkins
189using a Jenkins plugin called `Parameterized Remote Trigger Plugin <https://www.jenkins.io/doc/pipeline/steps/Parameterized-Remote-Trigger/>`__.
190
191The private c3po job runs the following downstream jobs sequentially:
192
You Wangaa558852021-04-15 15:41:54 -07001931. `docker-publish-github_c3po`: this job downloads the c3po PR, runs docker
194 build and publishes the c3po docker images to `Aether registry`.
1952. `omec_deploy_dev`: this job deploys the images built from previous job onto
196 the omec dev pod.
1973. `ng40-test_dev`: this job executes the functionality test suite.
1984. `archive-artifacts_dev`: this job collects and uploads k8s and container logs.
You Wangee3a4db2021-04-13 18:50:40 -0700199
200After all the downstream jobs are finished, the upstream job (`c3po_premerge_dev`)
201copies artifacts including k8s/container/NG40 logs and pcap files from
202downstream jobs and saves them as Jenkins job artifacts.
203
204These artifacts are also copied to and published by the public job
205(`omec_c3po_container_remote <https://jenkins.opencord.org/job/omec_c3po_container_remote/>`__)
206on opencord Jenkins so that they can be accessed by the OMEC community.
207
208Pre-merge jobs for other OMEC repos share the same structure.
209
210Post-merge
211^^^^^^^^^^
212
213The following jobs are triggered as post-merge jobs when PRs are merged to
214OMEC repos:
215
You Wangaa558852021-04-15 15:41:54 -07002161. `docker-publish-github-merge_c3po`
2172. `docker-publish-github-merge_Nucleus`
2183. `docker-publish-github-merge_upf-epc`
2194. `docker-publish-github-merge_spgw`
You Wangee3a4db2021-04-13 18:50:40 -0700220
221Again take the c3po job as an example. The post-merge job (`docker-publish-github-merge_c3po`)
222runs the following downstream jobs sequentially:
223
You Wangaa558852021-04-15 15:41:54 -07002241. `docker-publish-github_c3po`: this is the same job as the one in pre-merge
225 section. It checks out the latest c3po code, runs docker build and
226 publishes the c3po docker images to `docker hub <https://hub.docker.com/u/omecproject>`__.
You Wangee3a4db2021-04-13 18:50:40 -0700227
228.. Note::
You Wangaa558852021-04-15 15:41:54 -0700229 the spgw images are published to Aether registry instead of docker hub
You Wangee3a4db2021-04-13 18:50:40 -0700230
You Wangaa558852021-04-15 15:41:54 -07002312. `c3po_postrelease`: this job submits a patchset to aether-pod-configs repo
232 for updating the CD pipeline with images published in the job above.
You Wangee3a4db2021-04-13 18:50:40 -0700233
234Post-merge jobs for other OMEC repos share the same structure.