Skip to content

Commit

Permalink
tests/int: add/use "requires systemd_vNNN"
Browse files Browse the repository at this point in the history
Signed-off-by: Kir Kolyshkin <[email protected]>
  • Loading branch information
kolyshkin committed Jun 28, 2023
1 parent 43564a7 commit 58a811f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 6 additions & 0 deletions tests/integration/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions tests/integration/update.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
Expand Down

0 comments on commit 58a811f

Please sign in to comment.