From 58a811f6aaa6051fdf807ac1de9f95d74589dc69 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Tue, 13 Jun 2023 15:04:30 -0700 Subject: [PATCH] tests/int: add/use "requires systemd_vNNN" Signed-off-by: Kir Kolyshkin --- tests/integration/helpers.bash | 6 ++++++ tests/integration/update.bats | 5 +---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/integration/helpers.bash b/tests/integration/helpers.bash index e2e6c86bb53..4998390e2ee 100644 --- a/tests/integration/helpers.bash +++ b/tests/integration/helpers.bash @@ -460,6 +460,12 @@ function requires() { skip_me=1 fi ;; + systemd_v*) + var=${var#systemd_v} + if [ "$(systemd_version)" -lt "$var" ]; then + skip "requires systemd >= v${var}" + fi + ;; no_systemd) if [ -v RUNC_USE_SYSTEMD ]; then skip_me=1 diff --git a/tests/integration/update.bats b/tests/integration/update.bats index ba7a41809f4..1a16c9ae34c 100644 --- a/tests/integration/update.bats +++ b/tests/integration/update.bats @@ -474,11 +474,8 @@ EOF } @test "update cgroup cpu.idle via systemd v252+" { - requires cgroups_v2 systemd cgroups_cpu_idle + requires cgroups_v2 systemd_v252 cgroups_cpu_idle [ $EUID -ne 0 ] && requires rootless_cgroup - if [ "$(systemd_version)" -lt 252 ]; then - skip "requires systemd >= v252" - fi runc run -d --console-socket "$CONSOLE_SOCKET" test_update [ "$status" -eq 0 ]