mirror of
https://github.com/opencontainers/runc.git
synced 2026-11-06 05:17:05 +00:00
Go's encoding/json (v1) matches object keys case-insensitively, and silently ignores unknown keys. As a result, runc happily accepts a config.json with e.g. "CPU" instead of "cpu", or "pagesize" instead of "pageSize", while other runtimes (which run runc integration tests, e.g. crun) may not. In addition, runc will likely switch to encoding/json/v2 at some point, which matches keys case-sensitively, so such keys will be silently ignored by runc, too. Add a simple check-config helper, which checks that all keys in config.json are known to runtime-spec (and spelled exactly as in the spec), and call it from update_config, so tests using wrong keys fail right away. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
These are helpers used by integration tests.
They are compiled from the top-level Makefile via make test-binaries,
and the resulting binaries can be found in ./_bin.