blob: ed3be942dc7d3a5ac785b8e35e639730d5335156 [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
Zack Williams1ae109e2021-07-27 11:17:04 -070012""""
You Wangee3a4db2021-04-13 18:50:40 -070013
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
Zack Williams1ae109e2021-07-27 11:17:04 -070016scenarios that involve data plane verification, NG40 also emulates a few
You Wangee3a4db2021-04-13 18:50:40 -070017application servers which serve as the destinations of data packets.
18
Zack Williams1ae109e2021-07-27 11:17:04 -070019A typical NG40 test case involves UE attaching, data plane verification and
You Wangee3a4db2021-04-13 18:50:40 -070020UE 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
Zack Williams1ae109e2021-07-27 11:17:04 -070027''''''''''
You Wangee3a4db2021-04-13 18:50:40 -070028
29Currently the following NG40 test cases are implemented:
30
You Wangaeb9c112021-08-03 11:45:27 -0700314G Tests:
32
You Wangee3a4db2021-04-13 18:50:40 -0700331. ``4G_M2AS_PING_FIX`` (attach, dl ping, detach)
342. ``4G_M2AS_UDP`` (attach, dl+ul udp traffic, detach)
Zack Williams1ae109e2021-07-27 11:17:04 -0700353. ``4G_M2AS_TCP`` (attach, release, service request, dl+ul tcp traffic, detach)
You Wangee3a4db2021-04-13 18:50:40 -0700364. ``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)
You Wangaeb9c112021-08-03 11:45:27 -0700397. ``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)
You Wangee3a4db2021-04-13 18:50:40 -070053
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
Zack Williams1ae109e2021-07-27 11:17:04 -070061'''''''''''
You Wangee3a4db2021-04-13 18:50:40 -070062
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
You Wangaa558852021-04-15 15:41:54 -0700661. ``functionality test suite`` verifies basic functionality of the
You Wangaeb9c112021-08-03 11:45:27 -070067 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.
You Wangaa558852021-04-15 15:41:54 -0700712. ``scalability test suite`` tests the system by scale and verifies
You Wangaeb9c112021-08-03 11:45:27 -070072 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).
You Wangaa558852021-04-15 15:41:54 -0700763. ``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.
You Wangee3a4db2021-04-13 18:50:40 -070079
80Robot Framework
Zack Williams1ae109e2021-07-27 11:17:04 -070081"""""""""""""""
You Wangee3a4db2021-04-13 18:50:40 -070082
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
Zack Williams1ae109e2021-07-27 11:17:04 -070089Framework. In the integration tests Robot Framework calls the ng40 library to
You Wangee3a4db2021-04-13 18:50:40 -070090perform 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
You Wangaa558852021-04-15 15:41:54 -0700961. Subscriber Attach with HSS Restart
972. Subscriber Attach with MME Restart
983. Subscriber Attach with SPGWC Restart
994. Subscriber Attach with PFCP Agent Restart
You Wangee3a4db2021-04-13 18:50:40 -0700100
101.. Note::
You Wangaa558852021-04-15 15:41:54 -0700102 More integration tests are being developed as part of Robot Framework
You Wangee3a4db2021-04-13 18:50:40 -0700103
104Test Schedules
105--------------
106
107Nightly Tests
Zack Williams1ae109e2021-07-27 11:17:04 -0700108"""""""""""""
You Wangee3a4db2021-04-13 18:50:40 -0700109
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
You Wangaa558852021-04-15 15:41:54 -07001131. ``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.
You Wangee3a4db2021-04-13 18:50:40 -0700119
120And all these jobs can be scheduled on any of the Aether PODs including
You Wangaeb9c112021-08-03 11:45:27 -0700121``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:
You Wangee3a4db2021-04-13 18:50:40 -0700123
You Wangaeb9c112021-08-03 11:45:27 -07001241. ``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`
You Wangaa558852021-04-15 15:41:54 -07001262. ``staging`` pod: `func_staging`, `scale_staging`, `perf_staging`, `integ_staging`
1273. ``qa`` pod: `func_qa`, `scale_qa`, `perf_qa`, `integ_qa`
You Wangee3a4db2021-04-13 18:50:40 -0700128
Zack Williams1ae109e2021-07-27 11:17:04 -0700129Nightly Job structure
130"""""""""""""""""""""
You Wangee3a4db2021-04-13 18:50:40 -0700131
You Wangaeb9c112021-08-03 11:45:27 -0700132Take `sdcore_scale_ci-4g` job as an example. It runs the following downstream jobs:
You Wangee3a4db2021-04-13 18:50:40 -0700133
Zack Williams1ae109e2021-07-27 11:17:04 -07001341. `omec_deploy_ci-4g`: this job re-deploys the ``ci-4g`` pod with latest OMEC images.
You Wangee3a4db2021-04-13 18:50:40 -0700135
136.. Note::
Zack Williams1ae109e2021-07-27 11:17:04 -0700137 only the ``ci-4g`` and ``ci-5g`` pod jobs trigger deployment downstream job. No
You Wangaa558852021-04-15 15:41:54 -0700138 re-deployment is performed on the staging and qa pod before the tests
You Wangee3a4db2021-04-13 18:50:40 -0700139
You Wangaeb9c112021-08-03 11:45:27 -07001402. `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
You Wangaa558852021-04-15 15:41:54 -0700143 test data to database. It also generates plots using Rscript for func and
144 scale tests
You Wangee3a4db2021-04-13 18:50:40 -0700145
146The integration tests are written using Robot Framework so have a slightly
You Wangaeb9c112021-08-03 11:45:27 -0700147different Jenkins Job structure. Take `sdcore_integ_ci-4g` as an example. It runs the
You Wangee3a4db2021-04-13 18:50:40 -0700148following downstream jobs:
149
You Wangaeb9c112021-08-03 11:45:27 -07001501. `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
You Wangaa558852021-04-15 15:41:54 -0700152 exception that instead of directly executing NG40 commands it calls robot
Zack Williams4c1eab92021-05-28 11:37:14 -0700153 framework to execute the test cases and publishes the test results using
You Wangaa558852021-04-15 15:41:54 -0700154 `RobotPublisher` Jenkins plugin. The robot results will also be copied to
155 the upstream job and published there.
You Wangaeb9c112021-08-03 11:45:27 -07001563. `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
You Wangaa558852021-04-15 15:41:54 -0700158 test data to database. It also generates plots using Rscript for func and
159 scale tests
You Wangee3a4db2021-04-13 18:50:40 -0700160
161Patchset Tests
Zack Williams1ae109e2021-07-27 11:17:04 -0700162--------------
You Wangee3a4db2021-04-13 18:50:40 -0700163
Zack Williams1ae109e2021-07-27 11:17:04 -0700164SD-Core pre-merge verification covers the following public Github repos: ``c3po``,
You Wangaeb9c112021-08-03 11:45:27 -0700165``Nucleus``, ``upf-epc`` and the following private Github repos: ``spgw``. ``amf``,
166``smf``, ``ausf``, ``nssf``, ``nrf``, ``pcf``, ``udm``, ``udr``, ``webconsole``.
Zack Williams1ae109e2021-07-27 11:17:04 -0700167SD-Core CI verifies the following:
You Wangee3a4db2021-04-13 18:50:40 -0700168
You Wangaa558852021-04-15 15:41:54 -07001691. ONF CLA verification
Zack Williams1ae109e2021-07-27 11:17:04 -07001702. License verification (FOSSA/Reuse)
You Wangaa558852021-04-15 15:41:54 -07001713. NG40 tests
You Wangee3a4db2021-04-13 18:50:40 -0700172
Zack Williams1ae109e2021-07-27 11:17:04 -0700173These 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.
You Wangee3a4db2021-04-13 18:50:40 -0700176
Zack Williams1ae109e2021-07-27 11:17:04 -0700177The NG40 verification are a set of jobs running on both opencord Jenkins and
You Wangee3a4db2021-04-13 18:50:40 -0700178Aether Jenkins (private). The jobs run on opencord Jenkins include
179
You Wangaa558852021-04-15 15:41:54 -07001801. `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)
You Wangee3a4db2021-04-13 18:50:40 -0700184
185And the jobs run on Aether Jenkins include
186
You Wangaeb9c112021-08-03 11:45:27 -07001871. `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`
You Wangee3a4db2021-04-13 18:50:40 -0700200
Zack Williams1ae109e2021-07-27 11:17:04 -0700201Patchset Job structure
202""""""""""""""""""""""
You Wangee3a4db2021-04-13 18:50:40 -0700203
Zack Williams1ae109e2021-07-27 11:17:04 -0700204Take ``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/>`_.
You Wangee3a4db2021-04-13 18:50:40 -0700211
Zack Williams1ae109e2021-07-27 11:17:04 -0700212The private ``c3po`` job runs the following downstream jobs sequentially:
You Wangee3a4db2021-04-13 18:50:40 -0700213
Zack Williams1ae109e2021-07-27 11:17:04 -07002141. `docker-publish-github_c3po`: this job downloads the ``c3po`` PR, runs docker
215 build and publishes the ``c3po`` docker images to `Aether registry`.
You Wangaeb9c112021-08-03 11:45:27 -07002162. `omec_deploy_ci-4g`: this job deploys the images built from previous job onto
Zack Williams1ae109e2021-07-27 11:17:04 -0700217 the omec ``ci-4g`` pod.
You Wangaeb9c112021-08-03 11:45:27 -07002183. `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.
You Wangee3a4db2021-04-13 18:50:40 -0700220
You Wangaeb9c112021-08-03 11:45:27 -0700221After all the downstream jobs are finished, the upstream job (`c3po_premerge_ci-4g`)
Zack Williams1ae109e2021-07-27 11:17:04 -0700222copies artifacts including k8s/container/ng40 logs and pcap files from
You Wangee3a4db2021-04-13 18:50:40 -0700223downstream jobs and saves them as Jenkins job artifacts.
224
225These artifacts are also copied to and published by the public job
Zack Williams1ae109e2021-07-27 11:17:04 -0700226(`omec_c3po_container_remote <https://jenkins.opencord.org/job/omec_c3po_container_remote/>`_)
You Wangee3a4db2021-04-13 18:50:40 -0700227on opencord Jenkins so that they can be accessed by the OMEC community.
228
You Wangaeb9c112021-08-03 11:45:27 -0700229Pre-merge jobs for other SD-Core repos share the same structure.
You Wangee3a4db2021-04-13 18:50:40 -0700230
231Post-merge
Zack Williams1ae109e2021-07-27 11:17:04 -0700232""""""""""
You Wangee3a4db2021-04-13 18:50:40 -0700233
234The following jobs are triggered as post-merge jobs when PRs are merged to
You Wangaeb9c112021-08-03 11:45:27 -0700235SD-Core repos:
You Wangee3a4db2021-04-13 18:50:40 -0700236
You Wangaa558852021-04-15 15:41:54 -07002371. `docker-publish-github-merge_c3po`
2382. `docker-publish-github-merge_Nucleus`
2393. `docker-publish-github-merge_upf-epc`
2404. `docker-publish-github-merge_spgw`
You Wangaeb9c112021-08-03 11:45:27 -07002415. `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`
You Wangee3a4db2021-04-13 18:50:40 -0700250
Zack Williams1ae109e2021-07-27 11:17:04 -0700251Again take the ``c3po`` job as an example. The post-merge job (`docker-publish-github-merge_c3po`)
You Wangee3a4db2021-04-13 18:50:40 -0700252runs the following downstream jobs sequentially:
253
You Wangaa558852021-04-15 15:41:54 -07002541. `docker-publish-github_c3po`: this is the same job as the one in pre-merge
Zack Williams1ae109e2021-07-27 11:17:04 -0700255 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>`__.
You Wangee3a4db2021-04-13 18:50:40 -0700257
258.. Note::
You Wangaeb9c112021-08-03 11:45:27 -0700259 the images for private repos are published to Aether registry instead of docker hub
You Wangee3a4db2021-04-13 18:50:40 -0700260
You Wangaa558852021-04-15 15:41:54 -07002612. `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.
You Wangee3a4db2021-04-13 18:50:40 -0700263
You Wangaeb9c112021-08-03 11:45:27 -0700264Post-merge jobs for other SD-Core repos share the same structure.