浏览代码

Windows: Correct TestVolumesNoCopyData

Signed-off-by: John Howard <jhoward@microsoft.com>
John Howard 8 年之前
父节点
当前提交
8a1fdce7fe
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      integration-cli/docker_cli_run_test.go

+ 5 - 4
integration-cli/docker_cli_run_test.go

@@ -2276,18 +2276,19 @@ func (s *DockerSuite) TestRunCreateVolumeEtc(c *check.C) {
 }
 }
 
 
 func (s *DockerSuite) TestVolumesNoCopyData(c *check.C) {
 func (s *DockerSuite) TestVolumesNoCopyData(c *check.C) {
-	// TODO Windows (Post TP5). Windows does not support volumes which
+	// TODO Windows (Post RS1). Windows does not support volumes which
 	// are pre-populated such as is built in the dockerfile used in this test.
 	// are pre-populated such as is built in the dockerfile used in this test.
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
+	prefix, slash := getPrefixAndSlashFromDaemonPlatform()
 	if _, err := buildImage("dataimage",
 	if _, err := buildImage("dataimage",
 		`FROM busybox
 		`FROM busybox
-		RUN mkdir -p /foo
-		RUN touch /foo/bar`,
+		RUN ["mkdir", "-p", "/foo"]
+		RUN ["touch", "/foo/bar"]`,
 		true); err != nil {
 		true); err != nil {
 		c.Fatal(err)
 		c.Fatal(err)
 	}
 	}
 
 
-	dockerCmd(c, "run", "--name", "test", "-v", "/foo", "busybox")
+	dockerCmd(c, "run", "--name", "test", "-v", prefix+slash+"foo", "busybox")
 
 
 	if out, _, err := dockerCmdWithError("run", "--volumes-from", "test", "dataimage", "ls", "-lh", "/foo/bar"); err == nil || !strings.Contains(out, "No such file or directory") {
 	if out, _, err := dockerCmdWithError("run", "--volumes-from", "test", "dataimage", "ls", "-lh", "/foo/bar"); err == nil || !strings.Contains(out, "No such file or directory") {
 		c.Fatalf("Data was copied on volumes-from but shouldn't be:\n%q", out)
 		c.Fatalf("Data was copied on volumes-from but shouldn't be:\n%q", out)