blob: 1895b5254661f63150ef744999a5f3e187b2dce9 [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
ajayce0380c2021-12-14 21:51:00 -08005.. _sdcore-testing:
6
7Test frameworks and coverage
8============================
ajayf66b38e2021-12-09 23:44:54 -08009
10Test Framework
11--------------
12
13NG40
14""""
15
16NG40 tool is used as RAN emulator in SD-Core testing. NG40 runs inside a VM
17which is connected to both Aether control plane and data plane. In testing
18scenarios that involve data plane verification, NG40 also emulates a few
19application servers which serve as the destinations of data packets.
20
21A typical NG40 test case involves UE attaching, data plane verification and
22UE detaching. During the test NG40 acts as UEs and eNBs and talks to the
23mobile core to complete attach procedures for each UE it emulates. Then NG40
24verifies that data plane works for each attached UE by sending traffic between
25UEs and application servers. Before finishing each test NG40 performs detach
26procedures for each attached UE.
27
28Test cases
29''''''''''
30
31Currently the following NG40 test cases are implemented:
32
334G Tests:
34
351. ``4G_M2AS_PING_FIX`` (attach, dl ping, detach)
362. ``4G_M2AS_UDP`` (attach, dl+ul udp traffic, detach)
373. ``4G_M2AS_TCP`` (attach, release, service request, dl+ul tcp traffic, detach)
384. ``4G_AS2M_PAGING`` (attach, release, dl udp traffic, detach)
395. ``4G_M2AS_SRQ_UDP`` (attach, release, service request, dl+ul udp traffic)
406. ``4G_M2CN_PS`` (combined IMSI/PTMSI attach, detach)
417. ``4G_HO`` (attach, relocate and dl ping, detach)
428. ``4G_SCALE`` (attach, dl ping, detach with multiple UEs)
Ruchit Bawa5606dd22021-12-15 23:41:43 +0530439. ``4G_3_APPS`` (4G attach-detach with ICMP/UDP Data test with 3 applications)
4410. ``4G_SCALE_HO`` (attach, Handover, dl ping, detach with multiple UEs)
4511. ``4G_ATTACH_STRESS`` (attach-detach 200 times consecutively)
4612. ``4G_TAU`` (attach, Tracking Area Update, detach)
Ruchit Bawacb6e8862022-03-07 20:18:16 +05304713. ``4G_M2AS_UDP_TRAFFIC_CONFORMANT_TO_MAX_RATE`` (attach, UDP Data with correct qos bandwidth, detach)
4814. ``4G_M2AS_UDP_TRAFFIC_EXCEEDING_MAX_RATE`` (attach, UDP Data with exceeding bandwidth, detach)
ajayf66b38e2021-12-09 23:44:54 -080049
505G Tests:
51
521. ``5G_SA_Register_Deregister`` (registration, deregistration)
532. ``5G_SA_Register`` (registration, session establishment, deregistration)
543. ``5G_SA_Release`` (registration, session establishment, dl ping, release, deregistration)
554. ``5G_SA_Activate_Release`` (registration, session establishment, dl ping, release, service request,
56 dl ping, deregistration)
575. ``5G_SA_Scale`` (registration, session establishment, dl ping, deregistration for multiple UEs)
586. ``5G_SA_M2AS_ICMP`` (registration, session establishment, dl ping, deregistration)
597. ``5G_SA_M2AS_TCP`` (registration, session establishment, dl+ul tcp traffic, deregistration)
608. ``5G_SA_M2AS_UDP`` (registration, session establishment, dl+ul udp traffic, deregistration)
Ruchit Bawa5606dd22021-12-15 23:41:43 +0530619. ``5G_SA_SCALE`` (registration, session establishment, dl+ul udp traffic, deregistration with multiple UEs)
6210. ``5G_SA_Error_Malformed_Reg_Type`` (Error Scenario: registration with malformed registration type)
6311. ``5G_SA_Error_Auth_response_with_invalid_RES`` (Error Scenario: Invalid RES sent in Auth Response)
Ruchit Bawacb6e8862022-03-07 20:18:16 +05306412. ``5G_SA_M2AS_UDP_TRAFFIC_CONFORMANT_TO_MAX_RATE``
65 (registration, UDP Data with correct qos bandwidth, deregistration)
6613. ``5G_SA_M2AS_UDP_TRAFFIC_EXCEEDING_MAX_RATE`` (registration, UDP Data with exceeding bandwidth, deregistration)
ajayf66b38e2021-12-09 23:44:54 -080067
68All the test cases are parameterized and can take arguments to specify number
69of UEs, attach/detach rate, traffic type/rate etc. For example, ``4G_SCALE``
70test case can be configured as a mini scalability test which performs only 5
71UE attaches in a patchset pre-merge test, while in the nightly tests it can
72take different arguments to run 10K UE attaches with a high attach rate.
73
74Test suites
75'''''''''''
76
77The test cases are atomic testing units and can be combined to build test
78suites. The following test suites have been built so far:
79
801. ``functionality test suite`` verifies basic functionality of the
81 mobile core. 4G functionality suite runs 4G test case #1 to #8 including
82 ``4G_SCALE`` which attaches 5 UEs with 1/s attach rate. 5G functionality
83 suite runs 5G test case #1 to #8 including ``5G_SA_Scale`` which attaches
84 100 UEs with 1/s attach rate.
852. ``scalability test suite`` tests the system by scale and verifies
86 system stability. It runs ``4G_SCALE`` (or ``5G_SA_Scale``) which attaches
87 a large number of UEs with high attach rate (16k UEs with 100/s rate on 4G
88 CI pod, 1k UEs with 10/s rate on 4G staging pod, and 1k UEs with 1/s rate
89 on 5G CI pod).
903. ``performance test suite`` measures performance of the control and
91 data plane. It runs ``4G_SCALE`` multiple times with different attach rates
92 to understand how the system performs under different loads.
93
94Robot Framework
95"""""""""""""""
96
97Robot Framework was chosen to build test cases that involve interacting with
98not only NG40 but also other parts of the system. In these scenarios Robot
99Framework acts as a high level orchestrator which drives various components
100of the system using component specific libraries including NG40.
101
102Currently the ``Integration test suite`` is implemented using Robot
103Framework. In the integration tests Robot Framework calls the ng40 library to
104perform normal attach/detach procedures. Meanwhile it injects failures into
105the system (container restarts, link down etc.) by calling functions
106implemented in the k8s library.
107
108The following integration tests are implemented at the moment:
109
Ruchit Bawa5606dd22021-12-15 23:41:43 +05301104G Tests:
111
1121. Subscriber Attach with HSS Restart (attach, Restart HSS, detach)
1132. Subscriber Attach with SPGWC Restart (attach, Restart SPGWC, detach)
Ruchit Bawacb6e8862022-03-07 20:18:16 +05301143. Subscriber Attach with pfcp-agent Restart (attach, Restart pfcp-agent, detach)
1154. Subscriber Attach Detach HSS Restart Attach Detach (attach-detach, Restart HSS, attach-detach)
1165. Subscriber Attach Detach SPGWC Restart Attach Detach (attach-detach, Restart SPGWC, attach-detach)
1176. Subscriber Attach Detach MME Restart Attach Detach (attach-detach, Restart MME, attach-detach)
1187. Subscriber Attach Detach pfcp-agent Restart Attach Detach (attach-detach, Restart pfcp-agent, attach-detach)
1198. Measure Downtime for HSS Restart (Verifies if HSS restarts within acceptable time limit)
1209. Measure Downtime for SPGWC Restart (Verifies if SPGWC restarts within acceptable time limit)
12110. Measure Downtime for MME Restart (Verifies if MME restarts within acceptable time limit)
12211. Measure Downtime for pfcp-agent Restart (Verifies if pfcp-agent restarts within acceptable time limit)
12312. Context Replacement at MME (Verifies context replacement at MME after NG40 restart)
12413. Context Replacement at SPGWC (Verifies context replacement at SPGWC after MME restart)
12514. Context Replacement at UPF (Verifies context replacement at UPF after SPGWC restart)
Ruchit Bawa5606dd22021-12-15 23:41:43 +0530126
1275G Tests:
128
1291. ``Subscriber Register-Deregister with SMF Restart`` (registration, SMF Restart, deregistration)
1302. ``Subscriber Register-Deregister with AUSF Restart`` (registration, AUSF Restart, deregistration)
1313. ``Subscriber Register-Deregister with NRF Restart`` (registration, NRF Restart, deregistration)
1324. ``Subscriber Register-Deregister with NSSF Restart`` (registration, NSSF Restart, deregistration)
1335. ``Subscriber Register-Deregister with PCF Restart`` (registration, PCF Restart, deregistration)
1346. ``Subscriber Register-Deregister with UDR Restart`` (registration, UDR Restart, deregistration)
Ruchit Bawacb6e8862022-03-07 20:18:16 +05301357. ``Subscriber Register-Deregister with UDM Restart`` (registration, UDM Restart, deregistration)
1368. ``Subscriber Register-Deregister AMF Restart Subscriber Register-Deregister`` (registration
137 -deregistration, AMF Restart, registration-deregistration)
1389. ``Subscriber Register-Deregister SMF Restart Subscriber Register-Deregister`` (registration
139 -deregistration, SMF Restart, registration-deregistration)
14010. ``Subscriber Register-Deregister AUSF Restart Subscriber Register-Deregister`` (registration
141 -deregistration, AUSF Restart, registration-deregistration)
14211. ``Subscriber Register-Deregister NRF Restart Subscriber Register-Deregister`` (registration
143 -deregistration, NRF Restart, registration-deregistration)
14412. ``Subscriber Register-Deregister NSSF Restart Subscriber Register-Deregister`` (registration
145 -deregistration, NSSF Restart, registration-deregistration)
14613. ``Subscriber Register-Deregister PCF Restart Subscriber Register-Deregister`` (registration
147 -deregistration, PCF Restart, registration-deregistration)
14814. ``Subscriber Register-Deregister UDM Restart Subscriber Register-Deregister`` (registration
149 -deregistration, UDM Restart, registration-deregistration)
15015. ``Subscriber Register-Deregister UDR Restart Subscriber Register-Deregister`` (registration
151 -deregistration, UDR Restart, registration-deregistration)
15216. ``Measure Downtime for SMF Restart`` (Verifies if AMF restarts within acceptable time limit)
15317. ``Measure Downtime for SMF Restart`` (Verifies if SMF restarts within acceptable time limit)
15418. ``Measure Downtime for AUSF Restart`` (Verifies if AUSF restarts within acceptable time limit)
15519. ``Measure Downtime for NRF Restart`` (Verifies if NRF restarts within acceptable time limit)
15620. ``Measure Downtime for NSSF Restart`` (Verifies if NSSF restarts within acceptable time limit)
15721. ``Measure Downtime for PCF Restart`` (Verifies if PCF restarts within acceptable time limit)
15822. ``Measure Downtime for UDR Restart`` (Verifies if UDR restarts within acceptable time limit)
15923. ``Measure Downtime for UDM Restart`` (Verifies if UDM restarts within acceptable time limit)
16024. ``Context Replacement at AMF`` (Verifies context replacement at AMF after NG40 restart)
16125. ``Context Replacement at UPF`` (Verifies context replacement at UPF after SMF restart)
16226. ``Context Replacement at SMF`` (Verifies context replacement at SMF after AMF restart)
ajayf66b38e2021-12-09 23:44:54 -0800163
164.. Note::
165 More integration tests are being developed as part of Robot Framework
166
167Test Schedules
168--------------
169
170Nightly Tests
171"""""""""""""
172
173SD-Core nightly tests are a set of jobs managed by Aether Jenkins.
174All four test suites we mentioned above are scheduled to run nightly.
175
1761. ``functionality job (func)`` runs NG40 test cases included in the
Ruchit Bawa5606dd22021-12-15 23:41:43 +0530177 functionality suite and Integration test suite and verifies all tests pass.
ajayf66b38e2021-12-09 23:44:54 -08001782. ``scalability job (scale)`` runs the scalability test suite and reports
179 the number of successful/failed attaches, detaches and pings.
ajayf66b38e2021-12-09 23:44:54 -0800180
181And all these jobs can be scheduled on any of the Aether PODs including
Ruchit Bawa5606dd22021-12-15 23:41:43 +0530182``ci-4g`` pod, ``ci-5g`` pod, ``qa`` pod and ``qa2`` pod. By combining
ajayf66b38e2021-12-09 23:44:54 -0800183the test type and test pod the following Jenkins jobs are generated:
184
Ruchit Bawa5606dd22021-12-15 23:41:43 +05301851. ``ci-4g`` pod: `sdcore_ci-4g_4g_bess_func`, `sdcore_ci-4g_4g_bess_scale`
1862. ``ci-5g`` pod: `sdcore_ci-5g_5g_bess_func`, `sdcore_ci-5g_5g_bess_scale`
1873. ``qa`` pod: `sdcore_qa_4g_bess_func`, `sdcore_qa_4g_bess_scale`
1884. ``qa2`` pod: `sdcore_qa2_4g_bess_func`, `sdcore_qa2_4g_bess_scale`
ajayf66b38e2021-12-09 23:44:54 -0800189
190Nightly Job structure
191"""""""""""""""""""""
192
Ruchit Bawa5606dd22021-12-15 23:41:43 +0530193Take `sdcore_ci-4g_4g_bess_scale` job as an example. It runs the following downstream jobs:
ajayf66b38e2021-12-09 23:44:54 -0800194
Ruchit Bawa5606dd22021-12-15 23:41:43 +05301951. `sdcore_ci-4g_deploy`: this job re-deploys the ``ci-4g`` pod with latest OMEC images.
ajayf66b38e2021-12-09 23:44:54 -0800196
197.. Note::
198 only the ``ci-4g`` and ``ci-5g`` pod jobs trigger deployment downstream job. No
Ruchit Bawa5606dd22021-12-15 23:41:43 +0530199 re-deployment is performed on the qa and qa2 pods before the tests.
ajayf66b38e2021-12-09 23:44:54 -0800200
Ruchit Bawa5606dd22021-12-15 23:41:43 +05302012. `sdcore_ci-4g_4g_bess_robot-test`: this job executes the scalability test suite.
ajayf66b38e2021-12-09 23:44:54 -08002023. `archive-artifacts_ci-4g`: this job collects and uploads k8s and container logs.
2034. `post-results_ci-4g`: this job collects the NG40 test logs/pcaps and pushes the
204 test data to database. It also generates plots using Rscript for func and
Ruchit Bawa5606dd22021-12-15 23:41:43 +0530205 scale tests.
ajayf66b38e2021-12-09 23:44:54 -0800206
Ruchit Bawa5606dd22021-12-15 23:41:43 +0530207The integration tests are written using Robot Framework and are executed along
208 with the functional tests. Take `sdcore_ci-4g_4g_bess_func` as an example. It runs the
209 following downstream jobs:
ajayf66b38e2021-12-09 23:44:54 -0800210
Ruchit Bawa5606dd22021-12-15 23:41:43 +05302111. `sdcore_ci-4g_deploy`: this job executes the scalability test suite.
2122. `sdcore_ci-4g_4g_bess_robot-test`: this job calls robot
ajayf66b38e2021-12-09 23:44:54 -0800213 framework to execute the test cases and publishes the test results using
214 `RobotPublisher` Jenkins plugin. The robot results will also be copied to
215 the upstream job and published there.
2163. `archive-artifacts_ci-4g`: this job collects and uploads k8s and container logs.
2174. `post-results_ci-4g`: this job collects the NG40 test logs/pcaps and pushes the
218 test data to database. It also generates plots using Rscript for func and
Ruchit Bawa5606dd22021-12-15 23:41:43 +0530219 scale tests.
ajayf66b38e2021-12-09 23:44:54 -0800220
221Patchset Tests
222--------------
223
224SD-Core pre-merge verification covers the following public Github repos: ``c3po``,
225``Nucleus``, ``upf-epc`` and the following private Github repos: ``spgw``. ``amf``,
226``smf``, ``ausf``, ``nssf``, ``nrf``, ``pcf``, ``udm``, ``udr``, ``webconsole``.
227SD-Core CI verifies the following:
228
2291. ONF CLA verification
2302. License verification (FOSSA/Reuse)
2313. NG40 tests
232
233These jobs are automatically triggered by submitted or updated PR to the repos
234above. They can also be triggered manually by commenting ``retest this please``
235to the PR. At this moment only CLI and NG40 verification are mandatory.
236
237The NG40 verification are a set of jobs running on both opencord Jenkins and
238Aether Jenkins (private). The jobs run on opencord Jenkins include
239
2401. `omec_c3po_container_remote <https://jenkins.opencord.org/job/omec_c3po_container_remote/>`_ (public)
2412. `omec_Nucleus_container_remote <https://jenkins.opencord.org/job/omec_Nucleus_container_remote/>`_ (public)
ajaycbd17062022-03-06 11:12:58 -08002423. `omec_spgw_container_remote` (private, under member-only folder)
ajayf66b38e2021-12-09 23:44:54 -0800243
244And the jobs run on Aether Jenkins include
245
Ruchit Bawa5606dd22021-12-15 23:41:43 +05302461. `c3po_premerge_ci-4g_4g_bess`
2472. `Nucleus_premerge_ci-4g_4g_bess`
2483. `upf-epc_premerge_ci-4g_4g_bess`
2494. `spgw_premerge_ci-4g_4g_bess`
2505. `amf_premerge_ci-5g_5g_bess`
2516. `smf_premerge_ci-5g_5g_bess`
2527. `ausf_premerge_ci-5g_5g_bess`
2538. `nssf_premerge_ci-5g_5g_bess`
2549. `nrf_premerge_ci-5g_5g_bess`
25510. `pcf_premerge_ci-5g_5g_bess`
25611. `udm_premerge_ci-5g_5g_bess`
25712. `udr_premerge_ci-5g_5g_bess`
25813. `webconsole_premerge_ci-5g_5g_bess`
ajayf66b38e2021-12-09 23:44:54 -0800259
260Patchset Job structure
261""""""""""""""""""""""
262
263Take ``c3po`` jobs as an example. ``c3po`` PR triggers a public job
264`omec_c3po_container_remote
265<https://jenkins.opencord.org/job/omec_c3po_container_remote/>`_ job running
266on opencord Jenkins through Github webhooks, which then triggers a private job
Ruchit Bawa5606dd22021-12-15 23:41:43 +0530267`c3po_premerge_ci-4g_4g_bess` running on Aether Jenkins using a Jenkins plugin called
ajayf66b38e2021-12-09 23:44:54 -0800268`Parameterized Remote Trigger Plugin
269<https://www.jenkins.io/doc/pipeline/steps/Parameterized-Remote-Trigger/>`_.
270
271The private ``c3po`` job runs the following downstream jobs sequentially:
272
2731. `docker-publish-github_c3po`: this job downloads the ``c3po`` PR, runs docker
274 build and publishes the ``c3po`` docker images to `Aether registry`.
Ruchit Bawa5606dd22021-12-15 23:41:43 +05302752. `sdcore_ci-4g_deploy`: this job deploys the images built from previous job onto
ajayf66b38e2021-12-09 23:44:54 -0800276 the omec ``ci-4g`` pod.
Ruchit Bawa5606dd22021-12-15 23:41:43 +05302773. `sdcore_ci-4g_4g_bess_robot-test`: this job executes the functionality test suite.
ajayf66b38e2021-12-09 23:44:54 -08002784. `archive-artifacts_ci-4g`: this job collects and uploads k8s and container logs.
279
Ruchit Bawa5606dd22021-12-15 23:41:43 +0530280After all the downstream jobs are finished, the upstream job (`c3po_premerge_ci-4g_4g_bess`)
ajayf66b38e2021-12-09 23:44:54 -0800281copies artifacts including k8s/container/ng40 logs and pcap files from
282downstream jobs and saves them as Jenkins job artifacts.
283
284These artifacts are also copied to and published by the public job
285(`omec_c3po_container_remote <https://jenkins.opencord.org/job/omec_c3po_container_remote/>`_)
286on opencord Jenkins so that they can be accessed by the OMEC community.
287
288Pre-merge jobs for other SD-Core repos share the same structure.
289
290Post-merge
291""""""""""
292
293The following jobs are triggered as post-merge jobs when PRs are merged to
294SD-Core repos:
295
2961. `docker-publish-github-merge_c3po`
2972. `docker-publish-github-merge_Nucleus`
2983. `docker-publish-github-merge_upf-epc`
2994. `docker-publish-github-merge_spgw`
3005. `docker-publish-github-merge_amf`
3016. `docker-publish-github-merge_smf`
3027. `docker-publish-github-merge_ausf`
3038. `docker-publish-github-merge_nssf`
3049. `docker-publish-github-merge_nrf`
30510. `docker-publish-github-merge_pcf`
30611. `docker-publish-github-merge_udm`
30712. `docker-publish-github-merge_udr`
30813. `docker-publish-github-merge_webconsole`
309
310Again take the ``c3po`` job as an example. The post-merge job (`docker-publish-github-merge_c3po`)
311runs the following downstream jobs sequentially:
312
3131. `docker-publish-github_c3po`: this is the same job as the one in pre-merge
314 section. It checks out the latest ``c3po`` code, runs docker build and
315 publishes the ``c3po`` docker images to `docker hub <https://hub.docker.com/u/omecproject>`__.
316
317.. Note::
318 the images for private repos are published to Aether registry instead of docker hub
319
3202. `c3po_postrelease`: this job submits a patchset to aether-pod-configs repo
321 for updating the CD pipeline with images published in the job above.
322
323Post-merge jobs for other SD-Core repos share the same structure.