浏览代码

integ-cli: fix volume test by passing unix path as volume

This fixes `TestVolumesNoCopyData` for test execution on
windows by passing a unix-style path as volume even though
it's running on windows.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Ahmet Alp Balkan 10 年之前
父节点
当前提交
6062838756
共有 1 个文件被更改,包括 1 次插入7 次删除
  1. 1 7
      integration-cli/docker_cli_run_test.go

+ 1 - 7
integration-cli/docker_cli_run_test.go

@@ -2548,13 +2548,7 @@ func TestVolumesNoCopyData(t *testing.T) {
 		t.Fatalf("Data was copied on volumes-from but shouldn't be:\n%q", out)
 	}
 
-	tmpDir, err := ioutil.TempDir("", "docker_test_bind_mount_copy_data")
-	if err != nil {
-		t.Fatal(err)
-	}
-
-	defer os.RemoveAll(tmpDir)
-
+	tmpDir := randomUnixTmpDirPath("docker_test_bind_mount_copy_data")
 	cmd = exec.Command(dockerBinary, "run", "-v", tmpDir+":/foo", "dataimage", "ls", "-lh", "/foo/bar")
 	if out, _, err := runCommandWithOutput(cmd); err == nil || !strings.Contains(out, "No such file or directory") {
 		t.Fatalf("Data was copied on bind-mount but shouldn't be:\n%q", out)