diff --git a/.github/workflows/.test.yml b/.github/workflows/.test.yml index dfd93f11db..8178ac9675 100644 --- a/.github/workflows/.test.yml +++ b/.github/workflows/.test.yml @@ -27,7 +27,7 @@ env: ITG_CLI_MATRIX_SIZE: 6 DOCKER_EXPERIMENTAL: 1 DOCKER_GRAPHDRIVER: ${{ inputs.storage == 'snapshotter' && 'overlayfs' || 'overlay2' }} - TEST_INTEGRATION_USE_SNAPSHOTTER: ${{ inputs.storage == 'snapshotter' && '1' || '' }} + TEST_INTEGRATION_USE_GRAPHDRIVER: ${{ inputs.storage == 'graphdriver' && '1' || '' }} SETUP_BUILDX_VERSION: edge SETUP_BUILDKIT_IMAGE: moby/buildkit:latest diff --git a/.github/workflows/.windows.yml b/.github/workflows/.windows.yml index f476a7100d..1f8f968110 100644 --- a/.github/workflows/.windows.yml +++ b/.github/workflows/.windows.yml @@ -364,10 +364,10 @@ jobs: "--exec-root=$env:TEMP\moby-exec", ` "--pidfile=$env:TEMP\docker.pid", ` "--register-service" - If ("${{ inputs.storage }}" -eq "snapshotter") { + If ("${{ inputs.storage }}" -eq "graphdriver") { # Make the env-var visible to the service-managed dockerd, as there's no CLI flag for this option. - & reg add "HKLM\SYSTEM\CurrentControlSet\Services\docker" /v Environment /t REG_MULTI_SZ /s '@' /d TEST_INTEGRATION_USE_SNAPSHOTTER=1 - echo "TEST_INTEGRATION_USE_SNAPSHOTTER=1" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append + & reg add "HKLM\SYSTEM\CurrentControlSet\Services\docker" /v Environment /t REG_MULTI_SZ /s '@' /d TEST_INTEGRATION_USE_GRAPHDRIVER=1 + echo "TEST_INTEGRATION_USE_GRAPHDRIVER=1" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append } Write-Host "Starting service" Start-Service -Name docker diff --git a/Makefile b/Makefile index 87f2dfef43..26e453c642 100644 --- a/Makefile +++ b/Makefile @@ -54,7 +54,7 @@ DOCKER_ENVS := \ -e GITHUB_ACTIONS \ -e TEST_FORCE_VALIDATE \ -e TEST_INTEGRATION_DIR \ - -e TEST_INTEGRATION_USE_SNAPSHOTTER \ + -e TEST_INTEGRATION_USE_GRAPHDRIVER \ -e TEST_INTEGRATION_FAIL_FAST \ -e TEST_SKIP_INTEGRATION \ -e TEST_SKIP_INTEGRATION_CLI \ diff --git a/hack/make/.integration-test-helpers b/hack/make/.integration-test-helpers index 3c7d7265b7..334d5a76bf 100644 --- a/hack/make/.integration-test-helpers +++ b/hack/make/.integration-test-helpers @@ -210,7 +210,7 @@ test_env() { PATH="$PATH" \ TEMP="$TEMP" \ TEST_CLIENT_BINARY="$TEST_CLIENT_BINARY" \ - TEST_INTEGRATION_USE_SNAPSHOTTER="$TEST_INTEGRATION_USE_SNAPSHOTTER" \ + TEST_INTEGRATION_USE_GRAPHDRIVER="$TEST_INTEGRATION_USE_GRAPHDRIVER" \ OTEL_EXPORTER_OTLP_ENDPOINT="$OTEL_EXPORTER_OTLP_ENDPOINT" \ OTEL_SERVICE_NAME="$OTEL_SERVICE_NAME" \ "$@" diff --git a/hack/make/test-docker-py b/hack/make/test-docker-py index 764ccfc08e..4d3f98cbef 100644 --- a/hack/make/test-docker-py +++ b/hack/make/test-docker-py @@ -15,7 +15,7 @@ source hack/make/.integration-test-helpers : "${PY_TEST_OPTIONS:=--junitxml=${DEST}/junit-report.xml}" # build --squash is not supported with containerd integration. -if [ -n "$TEST_INTEGRATION_USE_SNAPSHOTTER" ]; then +if [ -z "$TEST_INTEGRATION_USE_GRAPHDRIVER" ]; then PY_TEST_OPTIONS="$PY_TEST_OPTIONS --deselect=tests/integration/api_build_test.py::BuildTest::test_build_squash" fi diff --git a/integration/daemon/migration_test.go b/integration/daemon/migration_test.go index 5949c7855c..d56cfac05c 100644 --- a/integration/daemon/migration_test.go +++ b/integration/daemon/migration_test.go @@ -9,6 +9,7 @@ import ( containertypes "github.com/moby/moby/api/types/container" "github.com/moby/moby/api/types/image" + "github.com/moby/moby/client" "github.com/moby/moby/v2/integration/internal/container" "github.com/moby/moby/v2/testutil" "github.com/moby/moby/v2/testutil/daemon" @@ -27,7 +28,7 @@ func TestMigrateNativeSnapshotter(t *testing.T) { func testMigrateSnapshotter(t *testing.T, graphdriver, snapshotter string) { skip.If(t, runtime.GOOS != "linux") - skip.If(t, os.Getenv("TEST_INTEGRATION_USE_SNAPSHOTTER") != "") + skip.If(t, os.Getenv("TEST_INTEGRATION_USE_GRAPHDRIVER") == "") ctx := testutil.StartSpan(baseContext, t) @@ -89,7 +90,7 @@ func testMigrateSnapshotter(t *testing.T, graphdriver, snapshotter string) { func TestMigrateSaveLoad(t *testing.T) { skip.If(t, runtime.GOOS != "linux") - skip.If(t, os.Getenv("TEST_INTEGRATION_USE_SNAPSHOTTER") != "") + skip.If(t, os.Getenv("TEST_INTEGRATION_USE_GRAPHDRIVER") == "") var ( ctx = testutil.StartSpan(baseContext, t) @@ -125,7 +126,7 @@ func TestMigrateSaveLoad(t *testing.T) { apiClient := d.NewClientT(t) // Save image to buffer - rdr, err := apiClient.ImageSave(ctx, []string{"busybox:latest"}, image.SaveOptions{}) + rdr, err := apiClient.ImageSave(ctx, []string{"busybox:latest"}) assert.NilError(t, err) buf := bytes.NewBuffer(nil) io.Copy(buf, rdr) @@ -135,7 +136,7 @@ func TestMigrateSaveLoad(t *testing.T) { list, err := apiClient.ImageList(ctx, image.ListOptions{}) assert.NilError(t, err) for _, i := range list { - _, err = apiClient.ImageRemove(ctx, i.ID, image.RemoveOptions{}) + _, err = apiClient.ImageRemove(ctx, i.ID, image.RemoveOptions{Force: true}) assert.NilError(t, err) } @@ -144,7 +145,7 @@ func TestMigrateSaveLoad(t *testing.T) { assert.Equal(t, info.Images, 0) // Import - lr, err := apiClient.ImageLoad(ctx, bytes.NewReader(buf.Bytes()), image.LoadOptions{Quiet: true}) + lr, err := apiClient.ImageLoad(ctx, bytes.NewReader(buf.Bytes()), client.ImageLoadWithQuiet(true)) assert.NilError(t, err) io.Copy(io.Discard, lr.Body) lr.Body.Close() diff --git a/testutil/environment/environment.go b/testutil/environment/environment.go index d89b4cc3d4..2ab1f6433e 100644 --- a/testutil/environment/environment.go +++ b/testutil/environment/environment.go @@ -189,10 +189,9 @@ func (e *Execution) IsUserNamespaceInKernel() bool { } // UsingSnapshotter returns whether containerd snapshotters are used for the -// tests by checking if the "TEST_INTEGRATION_USE_SNAPSHOTTER" is set to a -// non-empty value. +// tests by checking if the "TEST_INTEGRATION_USE_GRAPHDRIVER" is empty func (e *Execution) UsingSnapshotter() bool { - return os.Getenv("TEST_INTEGRATION_USE_SNAPSHOTTER") != "" + return os.Getenv("TEST_INTEGRATION_USE_GRAPHDRIVER") == "" } // HasExistingImage checks whether there is an image with the given reference.