From 754aeb28fdb9dd3aafb7705224e57f28281db264 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 19 Jun 2018 16:14:12 -0700 Subject: [PATCH] Fix TestDaemonNoSpaceLeftOnDeviceError This test is testing if any "no space left on device" errors that occur during `docker pull` will not be masked by other errors. To test for this, a new loopback-device was created, and used as `--data-dir` ("/var/lib/docker"). However, `/var/lib/docker` is used for storing various other things, including a `cache.db` database, used by BuildKit, which is created during startup of the daemon. Creation of that file failed (due to `--data-dir` path being on a mount with limited size), which caused daemon start to fail before the test was able to run. This patch changes the size-limited mount to be used for the storage-driver directory only, so that the test is not affected by other parts of the code attempting to write files in it. To have a predictable path; the daemon used in this test is configured to use the `vfs` storage-driver. Signed-off-by: Sebastiaan van Stijn --- integration-cli/docker_cli_daemon_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration-cli/docker_cli_daemon_test.go b/integration-cli/docker_cli_daemon_test.go index d2ff9606e5..bd5f6d56c8 100644 --- a/integration-cli/docker_cli_daemon_test.go +++ b/integration-cli/docker_cli_daemon_test.go @@ -1811,10 +1811,10 @@ func (s *DockerDaemonSuite) TestDaemonNoSpaceLeftOnDeviceError(c *check.C) { dockerCmd(c, "run", "--rm", "-v", testDir+":/test", "busybox", "sh", "-c", "dd of=/test/testfs.img bs=1M seek=3 count=0") icmd.RunCommand("mkfs.ext4", "-F", filepath.Join(testDir, "testfs.img")).Assert(c, icmd.Success) - dockerCmd(c, "run", "--privileged", "--rm", "-v", testDir+":/test:shared", "busybox", "sh", "-c", "mkdir -p /test/test-mount && mount -n /test/testfs.img /test/test-mount") + dockerCmd(c, "run", "--privileged", "--rm", "-v", testDir+":/test:shared", "busybox", "sh", "-c", "mkdir -p /test/test-mount/vfs && mount -n /test/testfs.img /test/test-mount/vfs") defer mount.Unmount(filepath.Join(testDir, "test-mount")) - s.d.Start(c, "--data-root", filepath.Join(testDir, "test-mount")) + s.d.Start(c, "--storage-driver", "vfs", "--data-root", filepath.Join(testDir, "test-mount")) defer s.d.Stop(c) // pull a repository large enough to overfill the mounted filesystem