Skip to content

Commit

Permalink
tests/int/update: test bad cpu.idle values
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
kolyshkin committed Apr 4, 2023
1 parent 3ffbd4c commit b5ecad7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/integration/update.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b5ecad7

Please sign in to comment.