Skip to content

Commit

Permalink
Fix alma ci target
Browse files Browse the repository at this point in the history
Ensure alma test are ran against the right version of containerd, ubuntu and rootlesskit inside the container.

Signed-off-by: apostasie <[email protected]>
  • Loading branch information
apostasie committed Mar 3, 2025
1 parent 088fe02 commit 31a1c62
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 25 deletions.
27 changes: 19 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,10 @@ jobs:
matrix:
mode: ["rootful", "rootless"]
runs-on: ubuntu-24.04
env:
UBUNTU_VERSION: 20.04
CONTAINERD_VERSION: v1.6.36
ROOTLESSKIT_VERSION: v1.1.1
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand Down Expand Up @@ -493,15 +497,22 @@ jobs:
MODE: ${{ matrix.mode }}
run: |
set -eux
TARGET=test-integration
[ "$MODE" = "rootless" ] && TARGET=test-integration-rootless
docker build -t test-integration --target "${TARGET}" .
# losetup not working as expected on EL8?
# > === FAIL: cmd/nerdctl/container TestRunDevice (0.44s)
# > container_run_cgroup_linux_test.go:236: assertion failed: error is not nil: loopback setup failed ([losetup --find --show /tmp/containerd-test-loopback3931357228]):
# > stdout="", stderr="losetup: /tmp/containerd-test-loopback3931357228: failed to set up loop device: No such file or directory\n": exit status 1
# https://github.com/containerd/nerdctl/pull/3904#issuecomment-2670917820
sudo losetup -Dv
sudo losetup -lv
sudo systemctl restart docker
TARGET=test-integration
[ "$MODE" = "rootless" ] && TARGET=test-integration-rootless
docker buildx create --name with-gha --use
docker buildx build \
--output=type=docker \
--cache-from type=gha,scope=amd64-${CONTAINERD_VERSION} \
-t test-integration --target "${TARGET}" \
--build-arg UBUNTU_VERSION=${UBUNTU_VERSION} \
--build-arg CONTAINERD_VERSION=${CONTAINERD_VERSION} \
--build-arg ROOTLESSKIT_VERSION=${ROOTLESSKIT_VERSION} \
.
- name: "Run integration tests"
run: docker run -t --rm --privileged test-integration
10 changes: 0 additions & 10 deletions cmd/nerdctl/container/container_run_cgroup_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"fmt"
"os"
"path/filepath"
"strings"
"testing"

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

"github.com/containerd/nerdctl/v2/pkg/cmd/container"
"github.com/containerd/nerdctl/v2/pkg/idutil/containerwalker"
"github.com/containerd/nerdctl/v2/pkg/infoutil"
"github.com/containerd/nerdctl/v2/pkg/testutil"
"github.com/containerd/nerdctl/v2/pkg/testutil/nerdtest"
)
Expand Down Expand Up @@ -228,14 +226,6 @@ func TestRunDevice(t *testing.T) {
t.Skip("test requires the root in the initial user namespace")
}

if unameR := infoutil.UnameR(); strings.Contains(unameR, ".el8") {
t.Logf("Assuming to be running on EL8 (kernel release %q)", unameR)
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")
// > === FAIL: cmd/nerdctl/container TestRunDevice (0.44s)
// > container_run_cgroup_linux_test.go:236: assertion failed: error is not nil: loopback setup failed ([losetup --find --show /tmp/containerd-test-loopback3931357228]):
// > stdout="", stderr="losetup: /tmp/containerd-test-loopback3931357228: failed to set up loop device: No such file or directory\n": exit status 1
}

const n = 3
lo := make([]*loopback.Loopback, n)
loContent := make([]string, n)
Expand Down
7 changes: 0 additions & 7 deletions cmd/nerdctl/container/container_stats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ package container

import (
"runtime"
"strings"
"testing"

"github.com/containerd/nerdctl/mod/tigron/expect"
"github.com/containerd/nerdctl/mod/tigron/require"
"github.com/containerd/nerdctl/mod/tigron/test"

"github.com/containerd/nerdctl/v2/pkg/infoutil"
"github.com/containerd/nerdctl/v2/pkg/testutil"
"github.com/containerd/nerdctl/v2/pkg/testutil/nerdtest"
)
Expand All @@ -45,11 +43,6 @@ func TestStats(t *testing.T) {
)
}

if unameR := infoutil.UnameR(); strings.Contains(unameR, ".el8") {
t.Logf("Assuming to be running on EL8 (kernel release %q)", unameR)
t.Skip("FIXME: the test seems to hang on EL8: https://github.com/containerd/nerdctl/pull/3904#issuecomment-2693931822")
}

testCase.Cleanup = func(data test.Data, helpers test.Helpers) {
helpers.Anyhow("rm", "-f", data.Identifier("container"))
helpers.Anyhow("rm", "-f", data.Identifier("memlimited"))
Expand Down

0 comments on commit 31a1c62

Please sign in to comment.