From 66a533eb3ef774e7c812960fb8d515a8c46ae249 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Thu, 10 Jul 2025 17:29:56 -0700 Subject: [PATCH] tests/int/events.bats: don't require root These tests should work as rootless as long as cgroup access works. Signed-off-by: Kir Kolyshkin --- tests/integration/events.bats | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/integration/events.bats b/tests/integration/events.bats index cf42eaf55..ce37c04b7 100644 --- a/tests/integration/events.bats +++ b/tests/integration/events.bats @@ -13,9 +13,8 @@ function teardown() { # This needs to be placed at the top of the bats file to work around # a shellcheck bug. See . function test_events() { - # XXX: currently cgroups require root containers. - requires root - init_cgroup_paths + [ $EUID -ne 0 ] && requires rootless_cgroup + set_cgroups_path local status interval retry_every=1 if [ $# -eq 2 ]; then @@ -45,8 +44,7 @@ function test_events() { } @test "events --stats" { - # XXX: currently cgroups require root containers. - requires root + [ $EUID -ne 0 ] && requires rootless_cgroup init_cgroup_paths # run busybox detached @@ -61,6 +59,7 @@ function test_events() { } @test "events --stats with psi data" { + # XXX: CPU PSI avg data only available to root. requires root cgroups_v2 psi init_cgroup_paths @@ -101,7 +100,7 @@ function test_events() { } @test "events oom" { - # XXX: currently cgroups require root containers. + # XXX: oom is not triggered for rootless containers. requires root cgroups_swap init_cgroup_paths