diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9e8054acff6..f7c678e5064 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -49,7 +49,7 @@ jobs: run: go test -v ./pkg/... test-integration: - runs-on: "ubuntu-${{ matrix.ubuntu }}" + runs-on: "${{ matrix.runner }}" timeout-minutes: 40 strategy: fail-fast: false @@ -58,10 +58,16 @@ jobs: include: - ubuntu: 20.04 containerd: v1.6.33 + runner: "ubuntu-20.04" - ubuntu: 22.04 containerd: v1.7.19 + runner: "ubuntu-22.04" + - ubuntu: 24.04 + containerd: v2.0.0-rc.3 + runner: "ubuntu-24.04" - ubuntu: 24.04 containerd: v2.0.0-rc.3 + runner: github-arm64-2c-8gb env: UBUNTU_VERSION: "${{ matrix.ubuntu }}" CONTAINERD_VERSION: "${{ matrix.containerd }}" diff --git a/cmd/nerdctl/container_run_linux_test.go b/cmd/nerdctl/container_run_linux_test.go index f73fd8ebfda..7be7870b3d0 100644 --- a/cmd/nerdctl/container_run_linux_test.go +++ b/cmd/nerdctl/container_run_linux_test.go @@ -398,6 +398,13 @@ func TestRunSigProxy(t *testing.T) { } } +func fluentdImage() string { + if runtime.GOARCH == "arm64" { + return testutil.FluentdImageArm64 + } + return testutil.FluentdImage +} + func TestRunWithFluentdLogDriver(t *testing.T) { if runtime.GOOS == "windows" { t.Skip("fluentd log driver is not yet implemented on Windows") @@ -409,7 +416,8 @@ func TestRunWithFluentdLogDriver(t *testing.T) { containerName := testutil.Identifier(t) base.Cmd("run", "-d", "--name", containerName, "-p", "24224:24224", - "-v", fmt.Sprintf("%s:/fluentd/log", tempDirectory), testutil.FluentdImage).AssertOK() + "-v", fmt.Sprintf("%s:/fluentd/log", tempDirectory), + fluentdImage()).AssertOK() defer base.Cmd("rm", "-f", containerName).AssertOK() time.Sleep(3 * time.Second) @@ -441,7 +449,8 @@ func TestRunWithFluentdLogDriverWithLogOpt(t *testing.T) { containerName := testutil.Identifier(t) base.Cmd("run", "-d", "--name", containerName, "-p", "24225:24224", - "-v", fmt.Sprintf("%s:/fluentd/log", tempDirectory), testutil.FluentdImage).AssertOK() + "-v", fmt.Sprintf("%s:/fluentd/log", tempDirectory), + fluentdImage()).AssertOK() defer base.Cmd("rm", "-f", containerName).AssertOK() time.Sleep(3 * time.Second) diff --git a/cmd/nerdctl/multi_platform_linux_test.go b/cmd/nerdctl/multi_platform_linux_test.go index cf9b130dd59..f7410e5f939 100644 --- a/cmd/nerdctl/multi_platform_linux_test.go +++ b/cmd/nerdctl/multi_platform_linux_test.go @@ -19,6 +19,7 @@ package main import ( "fmt" "io" + "runtime" "strings" "testing" @@ -38,6 +39,12 @@ func testMultiPlatformRun(base *testutil.Base, alpineImage string) { "linux/arm": "armv7l", "linux/arm/v7": "armv7l", } + // using aarch64 instead of armv7l because the arm64 system is compatible with armv7. + if runtime.GOARCH == "arm64" { + testCases["arm"] = "aarch64" + testCases["linux/arm"] = "aarch64" + testCases["linux/arm/v7"] = "aarch64" + } for plat, expectedUnameM := range testCases { t.Logf("Testing %q (%q)", plat, expectedUnameM) cmd := base.Cmd("run", "--rm", "--platform="+plat, alpineImage, "uname", "-m") @@ -159,6 +166,10 @@ RUN uname -m > /usr/share/nginx/html/index.html "http://127.0.0.1:8081": "aarch64", "http://127.0.0.1:8082": "armv7l", } + // using aarch64 instead of armv7l because the arm64 system is compatible with armv7. + if runtime.GOARCH == "arm64" { + testCases["http://127.0.0.1:8082"] = "aarch64" + } for testURL, expectedIndexHTML := range testCases { resp, err := nettestutil.HTTPGet(testURL, 50, false) diff --git a/pkg/testutil/testutil_linux.go b/pkg/testutil/testutil_linux.go index 7aa47117294..b03fd885adf 100644 --- a/pkg/testutil/testutil_linux.go +++ b/pkg/testutil/testutil_linux.go @@ -41,6 +41,7 @@ var ( MariaDBImage = mirrorOf("mariadb:10.5") DockerAuthImage = mirrorOf("cesanta/docker_auth:1.7") FluentdImage = mirrorOf("fluent/fluentd:v1.14-1") + FluentdImageArm64 = mirrorOf("fluent/fluentd:v1.14-arm64-debian") KuboImage = mirrorOf("ipfs/kubo:v0.16.0") SystemdImage = "ghcr.io/containerd/stargz-snapshotter:0.15.1-kind"