TestDuplicateMountpointsForVolumesFromAndMounts: remove unintentional dependency for /tmp/data
/tmp/data needs to be created before running this test (by some other test) Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
parent
3fe2730ab3
commit
d610d3f61c
|
@ -559,6 +559,7 @@ func (s *DockerSuite) TestDuplicateMountpointsForVolumesFromAndBind(c *check.C)
|
||||||
c.Assert(strings.TrimSpace(out), checker.Contains, data1)
|
c.Assert(strings.TrimSpace(out), checker.Contains, data1)
|
||||||
c.Assert(strings.TrimSpace(out), checker.Contains, data2)
|
c.Assert(strings.TrimSpace(out), checker.Contains, data2)
|
||||||
|
|
||||||
|
// /tmp/data is automatically created, because we are not using the modern mount API here
|
||||||
out, _, err := dockerCmdWithError("run", "--name=app", "--volumes-from=data1", "--volumes-from=data2", "-v", "/tmp/data:/tmp/data", "-d", "busybox", "top")
|
out, _, err := dockerCmdWithError("run", "--name=app", "--volumes-from=data1", "--volumes-from=data2", "-v", "/tmp/data:/tmp/data", "-d", "busybox", "top")
|
||||||
c.Assert(err, checker.IsNil, check.Commentf("Out: %s", out))
|
c.Assert(err, checker.IsNil, check.Commentf("Out: %s", out))
|
||||||
|
|
||||||
|
@ -579,7 +580,7 @@ func (s *DockerSuite) TestDuplicateMountpointsForVolumesFromAndBind(c *check.C)
|
||||||
|
|
||||||
// Test case (3) for 21845: duplicate targets for --volumes-from and `Mounts` (API only)
|
// Test case (3) for 21845: duplicate targets for --volumes-from and `Mounts` (API only)
|
||||||
func (s *DockerSuite) TestDuplicateMountpointsForVolumesFromAndMounts(c *check.C) {
|
func (s *DockerSuite) TestDuplicateMountpointsForVolumesFromAndMounts(c *check.C) {
|
||||||
testRequires(c, DaemonIsLinux)
|
testRequires(c, SameHostDaemon, DaemonIsLinux)
|
||||||
|
|
||||||
image := "vimage"
|
image := "vimage"
|
||||||
buildImageSuccessfully(c, image, withDockerfile(`
|
buildImageSuccessfully(c, image, withDockerfile(`
|
||||||
|
@ -602,6 +603,8 @@ func (s *DockerSuite) TestDuplicateMountpointsForVolumesFromAndMounts(c *check.C
|
||||||
c.Assert(strings.TrimSpace(out), checker.Contains, data1)
|
c.Assert(strings.TrimSpace(out), checker.Contains, data1)
|
||||||
c.Assert(strings.TrimSpace(out), checker.Contains, data2)
|
c.Assert(strings.TrimSpace(out), checker.Contains, data2)
|
||||||
|
|
||||||
|
err := os.MkdirAll("/tmp/data", 0755)
|
||||||
|
c.Assert(err, checker.IsNil)
|
||||||
// Mounts is available in API
|
// Mounts is available in API
|
||||||
status, body, err := request.SockRequest("POST", "/containers/create?name=app", map[string]interface{}{
|
status, body, err := request.SockRequest("POST", "/containers/create?name=app", map[string]interface{}{
|
||||||
"Image": "busybox",
|
"Image": "busybox",
|
||||||
|
|
Loading…
Reference in New Issue