Catch 5G core regressions in CI, before they merge
Run real 5G procedures against your core on every change and gate the merge on an exit code. One on-prem binary, YAML flows, JSON and JUnit reports.
A change to the AMF, the SMF or a shared library can break registration in ways a unit test never sees. The message still encodes. The handler still returns. Then a real UE tries to attach and gets rejected, or the PDU session never comes up. Regression testing for a 5G core means running real procedures against the built core, on every change, and failing the build when one of them stops working.
Runik does that from your pipeline. It is one on-prem binary, rk, that plays the gNB and the UE (or the NF peer), runs a procedure written in YAML, and answers with an exit code and a JSON verdict, step by step.
Why core regressions slip through
Most core teams already test. The gap is usually between the tests and the build:
- Unit and component tests check functions, not procedures. They do not tell you whether a UE still completes registration end to end.
- Lab runs on a simulator produce logs and captures. Someone has to read them to decide whether the run passed.
- Manual lab sessions happen before a release, not on every merge request. By then the change that broke things is weeks old.
What a pipeline needs is a test that drives the procedure over the real interfaces and returns a decision the pipeline can act on without a human reading a trace.
How it works
- Write or pick a flow. A flow is a state machine in YAML: states wait for a message, transitions check fields and send the next message, and
final_checksstate what the run must prove. The public flow catalog is Apache-2.0, so you usually start from one. - Run it against the built core. Point
rkat the AMF address and PLMN inlab.yamland run the flow from a CI job on a host that can reach the core. - Gate on the exit code.
rkwrites the JSON or JUnit report, then exits. Your pipeline reads the exit code and nothing else.
A verdict your pipeline can read
Here is the shape of it. The flow states what must be true at the end, and the verdict reports each check by name:
final_checks:
- name: the UE ended registered
metric: final_state_counts.registered
op: equals
value: 1
{ "flow_name": "registration", "verdict": "pass", "all_passed": true,
"final_checks": [ { "name": "the UE ended registered", "pass": true } ] }
The rule for CI fits on one line: fail the build on exit 1 or 2; for exit 3, gate strictly on 0 or accept 3 with a notice.
| Exit | Meaning |
|---|---|
| 0 | pass: the flow reached a declared final state and every check and final check passed |
| 1 | fail: a check failed or the run errored; the report is written first |
| 2 | usage: unknown subcommand or invalid option; nothing was sent to the core |
| 3 | unsupported: the core does not implement this scenario, and the checks that ran passed |
A metric key that is absent fails instead of reading as zero, so a broken run cannot pass by saying nothing. Every failed leg is reported, not just the earliest one.
Wiring it into a pipeline
The CI step is a shell command. This is the whole gate:
rk run-flow -flow registration -templates ./d3x-templates \
-c lab.yaml -s subscribers.yaml -output junit
code=$?
if [ "$code" -eq 3 ]; then
echo "scenario not implemented by this core: passing with a notice"
exit 0
fi
exit "$code"
Run it on a self-hosted runner that can reach the core under test over N2 (SCTP 38412) and, where the flow needs it, SBI. Publish the JUnit report with your CI's usual test-report step so failures show up in the same view as the rest of your tests.
Start with a short smoke set on every merge request: registration, PDU session establishment and release, deregistration. Add handover and negative flows to a nightly job once the smoke set is stable.
What to test on every change
A practical first set, all drawn from the catalog:
- Registration end to end, with a final check that no REGISTRATION REJECT arrived.
- PDU session establishment, modification and release, with the DNN and slice you deploy.
- Service request from idle, so a change to paging or context handling shows up.
- N2 handover and Xn path switch, if your release touches mobility.
- Negative flows that expect a specific reject, so a change in error handling is caught too.
Because flows are text, they live in git next to the core. A change to a flow is reviewed in the same pull request as the change to the core, and rk lint checks the YAML before anything is sent.
What Community covers, and what needs a licence
Community is free and needs no licence file. It covers individual flows and core NGAP, NAS, and SBI procedures, plus REST and the GTP-U user plane after an N2 session, JSON and JUnit reports with all four exit codes, and up to 1,000 subscribers. That is enough for a merge-request gate on most control-plane changes.
Pro adds test suites, fuzzing, failure injection, and advanced procedures, including PFCP on N4 and Diameter. Enterprise adds the DPDK datapath. Fleet workers (rk running as a worker under Runik Console) are included in Enterprise and in the 30-day trial; they are planned for every edition, with the number of workers set by your Console licence. See editions and pricing.
Fair limits
Runik drives procedures and checks results. For chassis-scale user-plane load, treat it as a complement to the load tester you already have. It does not contain a model, and it does not phone home: rk connects only to the endpoints in your config.
Start
Install Community on Linux amd64 or arm64 with curl -fsSL https://get.dflux.io/runik/install.sh | sh, clone the flow catalog, and run the registration flow against your core. See How it works. If you want to gate an upgrade rather than a merge, see testing a core upgrade before rollout.