Exit codes
Every rk command ends with an exit code a script or CI job can act on.
| Code | Meaning |
|---|---|
0 | Pass. The run completed and the verdict is pass. |
1 | Fail. The run completed and a check or the verdict failed. |
2 | Usage. A bad flag or argument, a missing required flag, or an -output-file that can't be written. Nothing ran. |
3 | Unsupported. The flow reached a state its template declares as "the target doesn't support this". An answer, not a failure. |
4 | Infrastructure. The run couldn't happen or finish: a config, template or subscriber file that doesn't load, a transport that doesn't come up, a port that can't be bound, an errored run. |
5 | Licence. The licence can't be read, or it doesn't allow what the run needs. Nothing ran. |
6 | rk report hosts only: a host's CPU steal over the whole run was above -max-cell-steal: the host, not the core, disturbed the measurement. |
How the code is decided
run-flow:0when the verdict is pass;3when it's unsupported;1for any other completed run;4when the run errored. An oracle failure in a fuzz run is1.
run-suite:- the worst outcome over its steps (pass
0, unsupported3, otherwise1); 4when a cycle errored without a graded failure, or when nothing ran.
- the worst outcome over its steps (pass
fuzz:1if any target failed;- otherwise the first errored target's code (
2,4or5); - otherwise
3if no target passed; - otherwise
0.
check:1if a probe failed,4if the config doesn't load or there's nothing to probe.server uspaceandserver dpdk:2when-protocolis missing or isn'ticmp,udportcp;5when the licence doesn't grant what they need (datapath.dpdkfordpdk,obs.prometheusfor-metrics-port);4when a port can't be bound or the datapath doesn't start.server dpdkthen ends with its verdict:0pass,1fail.lint:0valid,1invalid.
Exceptions
A few commands differ from the table:
rk validate: exits1when the licence denies the flow.rk describe: exits1when it can't read the flow file.
The report on failure
With -output json or -output junit, rk writes a report even when it stops before running. That includes a usage error found while parsing flags:
JSON
In JUnit it's a single test case with <error type="exit_N">.