Skip to content

Commit

Permalink
cgroups.bats: check cgroups_io_weight
Browse files Browse the repository at this point in the history
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
  • Loading branch information
AkihiroSuda committed Apr 10, 2024
1 parent 83bbab3 commit 6b076bf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/integration/cgroups.bats
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function setup() {
}

@test "runc run (blkio weight)" {
requires cgroups_v2
requires cgroups_v2 cgroups_io_weight
[ $EUID -ne 0 ] && requires rootless_cgroup

set_cgroups_path
Expand Down
16 changes: 16 additions & 0 deletions tests/integration/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,22 @@ function requires() {
skip_me=1
fi
;;
cgroups_io_weight)
local p f f2
init_cgroup_paths
if [ -v CGROUP_V1 ]; then
p="$CGROUP_CPU_BASE_PATH"
f1="blkio.weight"
f2="blkio.bfq.weight"
elif [ -v CGROUP_V2 ]; then
p="$CGROUP_BASE_PATH"
f1="io.weight"
f2="io.bfq.weight"
fi
if [ -z "$(find "$p" -type f \( -name "$f1" -o -name "$f2" \) -print -quit)" ]; then
skip_me=1
fi
;;
cgroupns)
if [ ! -e "/proc/self/ns/cgroup" ]; then
skip_me=1
Expand Down

0 comments on commit 6b076bf

Please sign in to comment.