Skip to content

tests/int: fix "update rt period and runtime" for rootless#3106

Closed
kolyshkin wants to merge 2 commits intoopencontainers:masterfrom
kolyshkin:fix-update-rt
Closed

tests/int: fix "update rt period and runtime" for rootless#3106
kolyshkin wants to merge 2 commits intoopencontainers:masterfrom
kolyshkin:fix-update-rt

Conversation

@kolyshkin
Copy link
Copy Markdown
Contributor

Since commit f09a3e1, the value passed on to read starts with
a slash, resulting in the first element of the array to be empty.

As a result, the test tries to write to the top-level cgroup, which
fails when rootless:

Writing 1000000 to /sys/fs/cgroup/cpu,cpuacct//cpu.rt_period_us
/tmp/bats-run-106184/bats.115768.src: line 548: /sys/fs/cgroup/cpu,cpuacct//cpu.rt_period_us: Permission denied

To fix, remove the leading slash.

An alternative fix would be to do for ((i = 1; instead of i = 0, but
that seems less readable.

Fixes: f09a3e1
Signed-off-by: Kir Kolyshkin [email protected]

Since commit f09a3e1, the value passed on to read starts with
a slash, resulting in the first element of the array to be empty.

As a result, the test tries to write to the top-level cgroup, which
fails when rootless:

> # Writing 1000000 to /sys/fs/cgroup/cpu,cpuacct//cpu.rt_period_us
> # /tmp/bats-run-106184/bats.115768.src: line 548: /sys/fs/cgroup/cpu,cpuacct//cpu.rt_period_us: Permission denied

To fix, remove the leading slash.

An alternative fix would be to do "for ((i = 1;" instead of "i = 0", but
that seems less readable.

Fixes: f09a3e1
Signed-off-by: Kir Kolyshkin <[email protected]>
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 <[email protected]>
@kolyshkin
Copy link
Copy Markdown
Contributor Author

Closing as this is included in #3104 (the second patch in a fixed form)

@kolyshkin kolyshkin closed this Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant