tests/int/update: test bad cpu.idle values

Values other than 1 or 0 are ignored by the kernel,
see sched_group_set_idle() in kernel/sched/fair.c

If the added test case ever fails, it means that the kernel now accepts
values other than 0 or 1, and runc needs to adopt to that.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2023-03-28 13:57:58 -07:00
parent 3ffbd4c85a
commit b5ecad7ba3
+11
View File
@@ -454,6 +454,17 @@ EOF
check_cgroup_value "cpu.idle" "$val"
done
# Values other than 1 or 0 are ignored by the kernel, see
# sched_group_set_idle() in kernel/sched/fair.c.
#
# If this ever fails, it means that the kernel now accepts values
# other than 0 or 1, and runc needs to adopt.
for val in -1 2 3; do
runc update --cpu-idle "$val" test_update
[ "$status" -ne 0 ]
check_cgroup_value "cpu.idle" "1"
done
# https://github.com/opencontainers/runc/issues/3786
[ "$(systemd_version)" -ge 252 ] && return
# test update other option won't impact on cpu.idle