blob: d5d9d3d97ac7252ba4dba19ae0a29271be02f71e [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
Jeremy Ronquillo4857c972022-03-07 10:48:38 -0800176* ``functionality job (func)`` - runs NG40 test cases included in the
177 functionality and integration test suites and verifies all tests pass.
ajayf66b38e2021-12-09 23:44:54 -0800178
Jeremy Ronquillo4857c972022-03-07 10:48:38 -0800179* ``scalability job (scale)`` - runs the scalability test suite and reports the
180 number of successful/failed attaches, detaches and pings.
181
182All these jobs can be scheduled on any of the Aether PODs. By combining
ajayf66b38e2021-12-09 23:44:54 -0800183the test type and test pod the following Jenkins jobs are generated:
184
Jeremy Ronquillo4857c972022-03-07 10:48:38 -0800185* ``ci-4g`` pod: `sdcore_ci-4g_4g_bess_func`, `sdcore_ci-4g_4g_bess_scale`
186* ``ci-5g`` pod: `sdcore_ci-5g_5g_bess_func`, `sdcore_ci-5g_5g_bess_scale`
187* ``qa`` pod: `sdcore_qa_4g_bess_func`, `sdcore_qa_4g_bess_scale`
188* ``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 +0530193The integration tests are written using Robot Framework and are executed along
Jeremy Ronquillo4857c972022-03-07 10:48:38 -0800194with the functional tests. The top-level pipeline
195(for example, `sdcore_ci-4g_4g_bess_func`) runs the following downstream jobs:
ajayf66b38e2021-12-09 23:44:54 -0800196
Jeremy Ronquillo4857c972022-03-07 10:48:38 -08001971. `sdcore_ci-4g_deploy`
1982. `sdcore_ci-4g_4g_bess_robot-test`
1993. `archive-artifacts_ci-4g`
2004. `post-results_ci-4g`
ajayf66b38e2021-12-09 23:44:54 -0800201
Jeremy Ronquillo4857c972022-03-07 10:48:38 -0800202Pre-Merge Tests
203---------------
ajayf66b38e2021-12-09 23:44:54 -0800204
Jeremy Ronquillo4857c972022-03-07 10:48:38 -0800205SD-Core pre-merge verification covers the following 4G/5G Core Github repos:
206
207* ``c3po``
208* ``Nucleus``
209* ``upf-epc``
210* ``spgw``
211
212and 5G Core GitHub repos:
213
214* ``amf``
215* ``smf``
216* ``ausf``
217* ``nssf``
218* ``nrf``
219* ``pcf``
220* ``udm``
221* ``udr``
222* ``webconsole``
223
ajayf66b38e2021-12-09 23:44:54 -0800224SD-Core CI verifies the following:
225
2261. ONF CLA verification
2272. License verification (FOSSA/Reuse)
2283. NG40 tests
229
Jeremy Ronquillo4857c972022-03-07 10:48:38 -0800230These jobs are automatically triggered by submitted or updated pull-request to the repos
231above. Re-trigger the checks by commenting one of the following phrases in the active pull-request:
ajayf66b38e2021-12-09 23:44:54 -0800232
Jeremy Ronquillo4857c972022-03-07 10:48:38 -0800233* ``retest this please`` - re-tests all checks
234* ``test container`` - re-tests pre-merge jobs
235* ``test license`` - re-tests license verification
236* ``test fossa`` - re-tests FOSSA verification
ajayf66b38e2021-12-09 23:44:54 -0800237
Jeremy Ronquillo4857c972022-03-07 10:48:38 -0800238The NG40 verification are a set of jobs running on both OpenCORD Jenkins and
239Aether Jenkins (private). The jobs run on OpenCORD Jenkins include:
ajayf66b38e2021-12-09 23:44:54 -0800240
Jeremy Ronquillo4857c972022-03-07 10:48:38 -0800241* `omec_c3po_container_remote <https://jenkins.opencord.org/job/omec_c3po_container_remote/>`_ (public)
242* `omec_Nucleus_container_remote <https://jenkins.opencord.org/job/omec_Nucleus_container_remote/>`_ (public)
243* `omec_spgw_container_remote` (private, under member-only folder)
ajayf66b38e2021-12-09 23:44:54 -0800244
Jeremy Ronquillo4857c972022-03-07 10:48:38 -0800245And the jobs run on Aether Jenkins include:
246
247* `c3po_premerge_ci-4g_4g_bess`
248* `Nucleus_premerge_ci-4g_4g_bess`
249* `upf-epc_premerge_ci-4g_4g_bess`
250* `spgw_premerge_ci-4g_4g_bess`
251* `amf_premerge_ci-5g_5g_bess`
252* `smf_premerge_ci-5g_5g_bess`
253* `ausf_premerge_ci-5g_5g_bess`
254* `nssf_premerge_ci-5g_5g_bess`
255* `nrf_premerge_ci-5g_5g_bess`
256* `pcf_premerge_ci-5g_5g_bess`
257* `udm_premerge_ci-5g_5g_bess`
258* `udr_premerge_ci-5g_5g_bess`
259* `webconsole_premerge_ci-5g_5g_bess`
ajayf66b38e2021-12-09 23:44:54 -0800260
261Patchset Job structure
262""""""""""""""""""""""
263
264Take ``c3po`` jobs as an example. ``c3po`` PR triggers a public job
265`omec_c3po_container_remote
266<https://jenkins.opencord.org/job/omec_c3po_container_remote/>`_ job running
267on opencord Jenkins through Github webhooks, which then triggers a private job
Ruchit Bawa5606dd22021-12-15 23:41:43 +0530268`c3po_premerge_ci-4g_4g_bess` running on Aether Jenkins using a Jenkins plugin called
ajayf66b38e2021-12-09 23:44:54 -0800269`Parameterized Remote Trigger Plugin
270<https://www.jenkins.io/doc/pipeline/steps/Parameterized-Remote-Trigger/>`_.
271
272The private ``c3po`` job runs the following downstream jobs sequentially:
273
Jeremy Ronquillo4857c972022-03-07 10:48:38 -08002741. `docker-publish-github_c3po`
2752. `sdcore_ci-4g_deploy`
2763. `sdcore_ci-4g_4g_bess_robot-test`
2774. `archive-artifacts_ci-4g`
ajayf66b38e2021-12-09 23:44:54 -0800278
Ruchit Bawa5606dd22021-12-15 23:41:43 +0530279After all the downstream jobs are finished, the upstream job (`c3po_premerge_ci-4g_4g_bess`)
ajayf66b38e2021-12-09 23:44:54 -0800280copies artifacts including k8s/container/ng40 logs and pcap files from
281downstream jobs and saves them as Jenkins job artifacts.
282
283These artifacts are also copied to and published by the public job
284(`omec_c3po_container_remote <https://jenkins.opencord.org/job/omec_c3po_container_remote/>`_)
285on opencord Jenkins so that they can be accessed by the OMEC community.
286
287Pre-merge jobs for other SD-Core repos share the same structure.
288
289Post-merge
290""""""""""
291
292The following jobs are triggered as post-merge jobs when PRs are merged to
293SD-Core repos:
294
Jeremy Ronquillo4857c972022-03-07 10:48:38 -0800295* `docker-publish-github-merge_c3po`
296* `docker-publish-github-merge_Nucleus`
297* `docker-publish-github-merge_upf-epc`
298* `docker-publish-github-merge_spgw`
299* `docker-publish-github-merge_amf`
300* `docker-publish-github-merge_smf`
301* `docker-publish-github-merge_ausf`
302* `docker-publish-github-merge_nssf`
303* `docker-publish-github-merge_nrf`
304* `docker-publish-github-merge_pcf`
305* `docker-publish-github-merge_udm`
306* `docker-publish-github-merge_udr`
307* `docker-publish-github-merge_webconsole`
ajayf66b38e2021-12-09 23:44:54 -0800308
Jeremy Ronquillo4857c972022-03-07 10:48:38 -0800309Take the ``c3po`` job as an example. The post-merge job (`docker-publish-github-merge_c3po`)
ajayf66b38e2021-12-09 23:44:54 -0800310runs the following downstream jobs sequentially:
311
Jeremy Ronquillo4857c972022-03-07 10:48:38 -0800312* `docker-publish-github_c3po`: this is the same job as the one in pre-merge section. It checks out the latest ``c3po`` code, runs docker build and publishes the ``c3po`` docker images to `docker hub <https://hub.docker.com/u/omecproject>`__.
ajayf66b38e2021-12-09 23:44:54 -0800313
314Post-merge jobs for other SD-Core repos share the same structure.