mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
tests/rootless.sh: fixup for "update rt" test
Without this, the test case fails with > Writing 1000000 to /sys/fs/cgroup/cpu,cpuacct/runc-cgroups-integration-test/cpu.rt_period_us > /tmp/bats-run-106836/bats.116418.src: line 548: /sys/fs/cgroup/cpu,cpuacct/runc-cgroups-integration-test/cpu.rt_period_us: Permission denied Since we do not currently have a setup to test this, this went unnoticed (can be seen in RHEL8 though). Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com> Signed-off-by: Adrian Reber <areber@redhat.com>
This commit is contained in:
committed by
Adrian Reber
parent
86af524866
commit
d448016486
@@ -114,6 +114,15 @@ function enable_cgroup() {
|
||||
# necessary, and might actually be a bug in our impl of cgroup
|
||||
# handling.
|
||||
[[ "$cg" == "cpuset" ]] && chown rootless:rootless "$CGROUP_MOUNT/$cg$CGROUP_PATH/cpuset."{cpus,mems}
|
||||
# The following is required by "update rt period and runtime".
|
||||
if [[ "$cg" == "cpu" ]]; then
|
||||
if [[ -e "$CGROUP_MOUNT/$cg$CGROUP_PATH/cpu.rt_period_us" ]]; then
|
||||
chown rootless:rootless "$CGROUP_MOUNT/$cg$CGROUP_PATH/cpu.rt_period_us"
|
||||
fi
|
||||
if [[ -e "$CGROUP_MOUNT/$cg$CGROUP_PATH/cpu.rt_runtime_us" ]]; then
|
||||
chown rootless:rootless "$CGROUP_MOUNT/$cg$CGROUP_PATH/cpu.rt_runtime_us"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
# cgroup v2
|
||||
if [[ -e "$CGROUP_MOUNT/cgroup.controllers" ]]; then
|
||||
|
||||
Reference in New Issue
Block a user