Skip to content

tests/int: use lowercase keys for linux.resources.cpu - #5501

Open
kolyshkin wants to merge 1 commit into
opencontainers:mainfrom
kolyshkin:tests-lowercase-cpu-keys
Open

kolyshkin wants to merge 1 commit into
opencontainers:mainfrom
kolyshkin:tests-lowercase-cpu-keys

Conversation

@kolyshkin

Copy link
Copy Markdown
Contributor

The "update cpuset parameters via resources.CPU" test uses CPU, Cpus, and Mems keys in linux.resources (in config.json, and in the input for runc update -r), while the OCI runtime spec uses cpu, cpus, and mems.

The test only works because Go's encoding/json matches keys case-insensitively. This is not the case for other OCI runtimes, e.g. crun, when running runc's integration tests against them (as crun CI now does).

Use the proper keys. Since the CPU resources are already set by setup(), merge the new values into them, which is effectively what happened with the old keys, too.

Tested with both runc and crun (rootless, systemd cgroup driver).

The "update cpuset parameters via resources.CPU" test uses "CPU",
"Cpus", and "Mems" keys in linux.resources in config.json, and in the
input for runc update -r.

The OCI runtime spec uses "cpu", "cpus", and "mems" keys. The test only
works because Go's encoding/json matches keys case-insensitively, which
is not the case for other OCI runtimes, such as crun, when running
runc's integration tests against those.

Use the proper keys. Since the CPU resources are already set by setup(),
merge the new values into them (which is what effectively happened with
the old keys, too).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant