Browse code

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>

Akihiro Suda authored on 2017/03/09 18:32:04
Showing 1 changed files
... ...
@@ -559,6 +559,7 @@ func (s *DockerSuite) TestDuplicateMountpointsForVolumesFromAndBind(c *check.C)
559 559
 	c.Assert(strings.TrimSpace(out), checker.Contains, data1)
560 560
 	c.Assert(strings.TrimSpace(out), checker.Contains, data2)
561 561
 
562
+	// /tmp/data is automatically created, because we are not using the modern mount API here
562 563
 	out, _, err := dockerCmdWithError("run", "--name=app", "--volumes-from=data1", "--volumes-from=data2", "-v", "/tmp/data:/tmp/data", "-d", "busybox", "top")
563 564
 	c.Assert(err, checker.IsNil, check.Commentf("Out: %s", out))
564 565
 
... ...
@@ -579,7 +580,7 @@ func (s *DockerSuite) TestDuplicateMountpointsForVolumesFromAndBind(c *check.C)
579 579
 
580 580
 // Test case (3) for 21845: duplicate targets for --volumes-from and `Mounts` (API only)
581 581
 func (s *DockerSuite) TestDuplicateMountpointsForVolumesFromAndMounts(c *check.C) {
582
-	testRequires(c, DaemonIsLinux)
582
+	testRequires(c, SameHostDaemon, DaemonIsLinux)
583 583
 
584 584
 	image := "vimage"
585 585
 	buildImageSuccessfully(c, image, withDockerfile(`
... ...
@@ -602,6 +603,8 @@ func (s *DockerSuite) TestDuplicateMountpointsForVolumesFromAndMounts(c *check.C
602 602
 	c.Assert(strings.TrimSpace(out), checker.Contains, data1)
603 603
 	c.Assert(strings.TrimSpace(out), checker.Contains, data2)
604 604
 
605
+	err := os.MkdirAll("/tmp/data", 0755)
606
+	c.Assert(err, checker.IsNil)
605 607
 	// Mounts is available in API
606 608
 	status, body, err := request.SockRequest("POST", "/containers/create?name=app", map[string]interface{}{
607 609
 		"Image": "busybox",