From 01c7e5084bfd4b5ed61da89afb84b25b9b26feeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= Date: Wed, 20 Jul 2022 11:08:12 +0200 Subject: [PATCH] integration-cli: remove emptyfs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Gronowski --- Dockerfile.e2e | 3 --- hack/make/.ensure-emptyfs | 23 -------------------- hack/make/.integration-daemon-setup | 3 --- hack/test/e2e-run.sh | 1 - integration-cli/docker_cli_inspect_test.go | 18 ++------------- integration-cli/docker_cli_run_test.go | 6 +---- integration-cli/docker_cli_save_load_test.go | 6 ++--- 7 files changed, 6 insertions(+), 54 deletions(-) delete mode 100644 hack/make/.ensure-emptyfs diff --git a/Dockerfile.e2e b/Dockerfile.e2e index 32d2c6614953e..8814fda6bd8a6 100644 --- a/Dockerfile.e2e +++ b/Dockerfile.e2e @@ -59,7 +59,6 @@ ENTRYPOINT ["/scripts/run.sh"] # Add an unprivileged user to be used for tests which need it RUN addgroup docker && adduser -D -G docker unprivilegeduser -s /bin/ash -# GNU tar is used for generating the emptyfs image RUN apk --no-cache add \ bash \ ca-certificates \ @@ -69,11 +68,9 @@ RUN apk --no-cache add \ iptables \ libcap2-bin \ pigz \ - tar \ xz COPY hack/test/e2e-run.sh /scripts/run.sh -COPY hack/make/.ensure-emptyfs /scripts/ensure-emptyfs.sh COPY integration/testdata /tests/integration/testdata COPY integration/build/testdata /tests/integration/build/testdata diff --git a/hack/make/.ensure-emptyfs b/hack/make/.ensure-emptyfs deleted file mode 100644 index 898cc22834d33..0000000000000 --- a/hack/make/.ensure-emptyfs +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash -set -e - -if ! docker image inspect emptyfs > /dev/null; then - # build a "docker save" tarball for "emptyfs" - # see https://github.com/docker/docker/pull/5262 - # and also https://github.com/docker/docker/issues/4242 - dir="$DEST/emptyfs" - uuid=511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158 - mkdir -p "$dir/$uuid" - ( - echo '{"emptyfs":{"latest":"511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158"}}' > "$dir/repositories" - cd "$dir/$uuid" - echo '{"id":"511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158","comment":"Imported from -","created":"2013-06-13T14:03:50.821769-07:00","container_config":{"Hostname":"","Domainname":"","User":"","Memory":0,"MemorySwap":0,"CpuShares":0,"AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"PortSpecs":null,"ExposedPorts":null,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":null,"Cmd":null,"Image":"","Volumes":null,"WorkingDir":"","Entrypoint":null,"NetworkDisabled":false,"OnBuild":null},"docker_version":"0.4.0","architecture":"x86_64","Size":0}' > json - echo '1.0' > VERSION - tar -cf layer.tar --files-from /dev/null - ) - ( - [ -n "$TESTDEBUG" ] && set -x - tar -cC "$dir" . | docker load - ) - rm -rf "$dir" -fi diff --git a/hack/make/.integration-daemon-setup b/hack/make/.integration-daemon-setup index c130e23560a77..31b11d2a2cb84 100644 --- a/hack/make/.integration-daemon-setup +++ b/hack/make/.integration-daemon-setup @@ -2,6 +2,3 @@ set -e source "$MAKEDIR/.detect-daemon-osarch" -if [ "$DOCKER_ENGINE_GOOS" != "windows" ]; then - bundle .ensure-emptyfs -fi diff --git a/hack/test/e2e-run.sh b/hack/test/e2e-run.sh index 57127c0d18080..94c0fc16c8383 100755 --- a/hack/test/e2e-run.sh +++ b/hack/test/e2e-run.sh @@ -81,5 +81,4 @@ set_platform_timeout() { fi } -sh /scripts/ensure-emptyfs.sh run_test_integration diff --git a/integration-cli/docker_cli_inspect_test.go b/integration-cli/docker_cli_inspect_test.go index 6554792e016fc..a8f572e38cb57 100644 --- a/integration-cli/docker_cli_inspect_test.go +++ b/integration-cli/docker_cli_inspect_test.go @@ -33,20 +33,6 @@ func checkValidGraphDriver(c *testing.T, name string) { } } -func (s *DockerCLIInspectSuite) TestInspectImage(c *testing.T) { - testRequires(c, DaemonIsLinux) - imageTest := "emptyfs" - // It is important that this ID remain stable. If a code change causes - // it to be different, this is equivalent to a cache bust when pulling - // a legacy-format manifest. If the check at the end of this function - // fails, fix the difference in the image serialization instead of - // updating this hash. - imageTestID := "sha256:11f64303f0f7ffdc71f001788132bca5346831939a956e3e975c93267d89a16d" - id := inspectField(c, imageTest, "Id") - - assert.Equal(c, id, imageTestID) -} - func (s *DockerCLIInspectSuite) TestInspectInt64(c *testing.T) { dockerCmd(c, "run", "-d", "-m=300M", "--name", "inspectTest", "busybox", "true") inspectOut := inspectField(c, "inspectTest", "HostConfig.Memory") @@ -137,7 +123,7 @@ func (s *DockerCLIInspectSuite) TestInspectTypeFlagWithInvalidValue(c *testing.T func (s *DockerCLIInspectSuite) TestInspectImageFilterInt(c *testing.T) { testRequires(c, DaemonIsLinux) - imageTest := "emptyfs" + imageTest := "busybox" out := inspectField(c, imageTest, "Size") size, err := strconv.Atoi(out) @@ -175,7 +161,7 @@ func (s *DockerCLIInspectSuite) TestInspectContainerFilterInt(c *testing.T) { func (s *DockerCLIInspectSuite) TestInspectImageGraphDriver(c *testing.T) { testRequires(c, DaemonIsLinux, Devicemapper) - imageTest := "emptyfs" + imageTest := "busybox" name := inspectField(c, imageTest, "GraphDriver.Name") checkValidGraphDriver(c, name) diff --git a/integration-cli/docker_cli_run_test.go b/integration-cli/docker_cli_run_test.go index c0780a1579215..cee6e6407f9a5 100644 --- a/integration-cli/docker_cli_run_test.go +++ b/integration-cli/docker_cli_run_test.go @@ -1945,11 +1945,7 @@ func (s *DockerCLIRunSuite) TestRunCidFileCleanupIfEmpty(c *testing.T) { defer os.RemoveAll(tmpDir) tmpCidFile := path.Join(tmpDir, "cid") - image := "emptyfs" - if testEnv.OSType == "windows" { - // Windows can't support an emptyfs image. Just use the regular Windows image - image = testEnv.PlatformDefaults.BaseImage - } + image := testEnv.PlatformDefaults.BaseImage out, _, err := dockerCmdWithError("run", "--cidfile", tmpCidFile, image) if err == nil { c.Fatalf("Run without command must fail. out=%s", out) diff --git a/integration-cli/docker_cli_save_load_test.go b/integration-cli/docker_cli_save_load_test.go index 0f9e1d525528f..dfd3e79a0a4a8 100644 --- a/integration-cli/docker_cli_save_load_test.go +++ b/integration-cli/docker_cli_save_load_test.go @@ -130,7 +130,7 @@ func (s *DockerCLISaveLoadSuite) TestSaveCheckTimes(c *testing.T) { func (s *DockerCLISaveLoadSuite) TestSaveImageId(c *testing.T) { testRequires(c, DaemonIsLinux) repoName := "foobar-save-image-id-test" - dockerCmd(c, "tag", "emptyfs:latest", fmt.Sprintf("%v:latest", repoName)) + dockerCmd(c, "tag", "busybox:latest", fmt.Sprintf("%v:latest", repoName)) out, _ := dockerCmd(c, "images", "-q", "--no-trunc", repoName) cleanedLongImageID := strings.TrimPrefix(strings.TrimSpace(out), "sha256:") @@ -202,10 +202,10 @@ func (s *DockerCLISaveLoadSuite) TestSaveMultipleNames(c *testing.T) { repoName := "foobar-save-multi-name-test" // Make one image - dockerCmd(c, "tag", "emptyfs:latest", fmt.Sprintf("%v-one:latest", repoName)) + dockerCmd(c, "tag", "busybox:latest", fmt.Sprintf("%v-one:latest", repoName)) // Make two images - dockerCmd(c, "tag", "emptyfs:latest", fmt.Sprintf("%v-two:latest", repoName)) + dockerCmd(c, "tag", "busybox:latest", fmt.Sprintf("%v-two:latest", repoName)) out, err := RunCommandPipelineWithOutput( exec.Command(dockerBinary, "save", fmt.Sprintf("%v-one", repoName), fmt.Sprintf("%v-two:latest", repoName)),