Skip to content

Commit d618c6f

Browse files
committed
cgroups.bats: check cgroups_io_weight
Signed-off-by: Akihiro Suda <[email protected]>
1 parent 053f6a0 commit d618c6f

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

tests/integration/cgroups.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ function setup() {
132132
}
133133

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

138138
set_cgroups_path

tests/integration/helpers.bash

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,22 @@ function requires() {
472472
skip_me=1
473473
fi
474474
;;
475+
cgroups_io_weight)
476+
local p f1 f2
477+
init_cgroup_paths
478+
if [ -v CGROUP_V1 ]; then
479+
p="$CGROUP_CPU_BASE_PATH"
480+
f1="blkio.weight"
481+
f2="blkio.bfq.weight"
482+
elif [ -v CGROUP_V2 ]; then
483+
p="$CGROUP_BASE_PATH"
484+
f1="io.weight"
485+
f2="io.bfq.weight"
486+
fi
487+
if [ -z "$(find "$p" -type f \( -name "$f1" -o -name "$f2" \) -print -quit)" ]; then
488+
skip_me=1
489+
fi
490+
;;
475491
cgroupns)
476492
if [ ! -e "/proc/self/ns/cgroup" ]; then
477493
skip_me=1

0 commit comments

Comments
 (0)