Skip to content

Commit 31a1c62

Browse files
committed
Fix alma ci target
Ensure alma test are ran against the right version of containerd, ubuntu and rootlesskit inside the container. Signed-off-by: apostasie <[email protected]>
1 parent 088fe02 commit 31a1c62

File tree

3 files changed

+19
-25
lines changed

3 files changed

+19
-25
lines changed

.github/workflows/test.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,10 @@ jobs:
427427
matrix:
428428
mode: ["rootful", "rootless"]
429429
runs-on: ubuntu-24.04
430+
env:
431+
UBUNTU_VERSION: 20.04
432+
CONTAINERD_VERSION: v1.6.36
433+
ROOTLESSKIT_VERSION: v1.1.1
430434
steps:
431435
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
432436
with:
@@ -493,15 +497,22 @@ jobs:
493497
MODE: ${{ matrix.mode }}
494498
run: |
495499
set -eux
496-
TARGET=test-integration
497-
[ "$MODE" = "rootless" ] && TARGET=test-integration-rootless
498-
docker build -t test-integration --target "${TARGET}" .
499-
# losetup not working as expected on EL8?
500-
# > === FAIL: cmd/nerdctl/container TestRunDevice (0.44s)
501-
# > container_run_cgroup_linux_test.go:236: assertion failed: error is not nil: loopback setup failed ([losetup --find --show /tmp/containerd-test-loopback3931357228]):
502-
# > stdout="", stderr="losetup: /tmp/containerd-test-loopback3931357228: failed to set up loop device: No such file or directory\n": exit status 1
503-
# https://github.com/containerd/nerdctl/pull/3904#issuecomment-2670917820
500+
504501
sudo losetup -Dv
505502
sudo losetup -lv
503+
sudo systemctl restart docker
504+
505+
TARGET=test-integration
506+
[ "$MODE" = "rootless" ] && TARGET=test-integration-rootless
507+
docker buildx create --name with-gha --use
508+
docker buildx build \
509+
--output=type=docker \
510+
--cache-from type=gha,scope=amd64-${CONTAINERD_VERSION} \
511+
-t test-integration --target "${TARGET}" \
512+
--build-arg UBUNTU_VERSION=${UBUNTU_VERSION} \
513+
--build-arg CONTAINERD_VERSION=${CONTAINERD_VERSION} \
514+
--build-arg ROOTLESSKIT_VERSION=${ROOTLESSKIT_VERSION} \
515+
.
516+
506517
- name: "Run integration tests"
507518
run: docker run -t --rm --privileged test-integration

cmd/nerdctl/container/container_run_cgroup_linux_test.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
"fmt"
2323
"os"
2424
"path/filepath"
25-
"strings"
2625
"testing"
2726

2827
"github.com/moby/sys/userns"
@@ -35,7 +34,6 @@ import (
3534

3635
"github.com/containerd/nerdctl/v2/pkg/cmd/container"
3736
"github.com/containerd/nerdctl/v2/pkg/idutil/containerwalker"
38-
"github.com/containerd/nerdctl/v2/pkg/infoutil"
3937
"github.com/containerd/nerdctl/v2/pkg/testutil"
4038
"github.com/containerd/nerdctl/v2/pkg/testutil/nerdtest"
4139
)
@@ -228,14 +226,6 @@ func TestRunDevice(t *testing.T) {
228226
t.Skip("test requires the root in the initial user namespace")
229227
}
230228

231-
if unameR := infoutil.UnameR(); strings.Contains(unameR, ".el8") {
232-
t.Logf("Assuming to be running on EL8 (kernel release %q)", unameR)
233-
t.Skip("FIXME: loopback.New fails on EL8 (when the test is executed inside a container) https://github.com/containerd/nerdctl/pull/3904#issuecomment-2670917820")
234-
// > === FAIL: cmd/nerdctl/container TestRunDevice (0.44s)
235-
// > container_run_cgroup_linux_test.go:236: assertion failed: error is not nil: loopback setup failed ([losetup --find --show /tmp/containerd-test-loopback3931357228]):
236-
// > stdout="", stderr="losetup: /tmp/containerd-test-loopback3931357228: failed to set up loop device: No such file or directory\n": exit status 1
237-
}
238-
239229
const n = 3
240230
lo := make([]*loopback.Loopback, n)
241231
loContent := make([]string, n)

cmd/nerdctl/container/container_stats_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@ package container
1818

1919
import (
2020
"runtime"
21-
"strings"
2221
"testing"
2322

2423
"github.com/containerd/nerdctl/mod/tigron/expect"
2524
"github.com/containerd/nerdctl/mod/tigron/require"
2625
"github.com/containerd/nerdctl/mod/tigron/test"
2726

28-
"github.com/containerd/nerdctl/v2/pkg/infoutil"
2927
"github.com/containerd/nerdctl/v2/pkg/testutil"
3028
"github.com/containerd/nerdctl/v2/pkg/testutil/nerdtest"
3129
)
@@ -45,11 +43,6 @@ func TestStats(t *testing.T) {
4543
)
4644
}
4745

48-
if unameR := infoutil.UnameR(); strings.Contains(unameR, ".el8") {
49-
t.Logf("Assuming to be running on EL8 (kernel release %q)", unameR)
50-
t.Skip("FIXME: the test seems to hang on EL8: https://github.com/containerd/nerdctl/pull/3904#issuecomment-2693931822")
51-
}
52-
5346
testCase.Cleanup = func(data test.Data, helpers test.Helpers) {
5447
helpers.Anyhow("rm", "-f", data.Identifier("container"))
5548
helpers.Anyhow("rm", "-f", data.Identifier("memlimited"))

0 commit comments

Comments
 (0)