Skip to content

Commit 6f8cb8b

Browse files
committed
merge branch 'pr-3539'
Kir Kolyshkin (1): CI: workaround CentOS Stream 9 criu issue LGTMs: AkihiroSuda cyphar Closes #3539
2 parents c0d44ea + 4fd4af5 commit 6f8cb8b

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

libcontainer/integration/checkpoint_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"os"
77
"os/exec"
88
"path/filepath"
9+
"regexp"
910
"strings"
1011
"testing"
1112

@@ -61,6 +62,12 @@ func testCheckpoint(t *testing.T, userns bool) {
6162
t.Skipf("criu binary not found: %v", err)
6263
}
6364

65+
// Workaround for https://github.com/opencontainers/runc/issues/3532.
66+
out, err := exec.Command("rpm", "-q", "criu").CombinedOutput()
67+
if err == nil && regexp.MustCompile(`^criu-3\.17-[123]\.el9`).Match(out) {
68+
t.Skip("Test requires criu >= 3.17-4 on CentOS Stream 9.")
69+
}
70+
6471
config := newTemplateConfig(t, &tParam{userns: userns})
6572
stateDir := t.TempDir()
6673

tests/integration/helpers.bash

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ SECCOMP_AGENT="${INTEGRATION_ROOT}/../../contrib/cmd/seccompagent/seccompagent"
2929
# shellcheck disable=SC2034
3030
TESTDATA="${INTEGRATION_ROOT}/testdata"
3131

32-
# Whether we have criu binary.
33-
command -v criu &>/dev/null && HAVE_CRIU=yes
34-
3532
# Kernel version
3633
KERNEL_VERSION="$(uname -r)"
3734
KERNEL_MAJOR="${KERNEL_VERSION%%.*}"
@@ -345,14 +342,24 @@ function rootless_cgroup() {
345342
[[ "$ROOTLESS_FEATURES" == *"cgroup"* || -v RUNC_USE_SYSTEMD ]]
346343
}
347344

345+
# Check if criu is available and working.
346+
function have_criu() {
347+
command -v criu &>/dev/null || return 1
348+
349+
# Workaround for https://github.com/opencontainers/runc/issues/3532.
350+
local ver
351+
ver=$(rpm -q criu 2>/dev/null || true)
352+
! grep -q '^criu-3\.17-[123]\.el9' <<<"$ver"
353+
}
354+
348355
# Allows a test to specify what things it requires. If the environment can't
349356
# support it, the test is skipped with a message.
350357
function requires() {
351358
for var in "$@"; do
352359
local skip_me
353360
case $var in
354361
criu)
355-
if [ ! -v HAVE_CRIU ]; then
362+
if ! have_criu; then
356363
skip_me=1
357364
fi
358365
;;

0 commit comments

Comments
 (0)