浏览代码

Fix test file paths

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

+ 9 - 0
integration-cli/docker_utils.go

@@ -86,6 +86,15 @@ func init() {
 	dockerBasePath = info.DockerRootDir
 	volumesConfigPath = filepath.Join(dockerBasePath, "volumes")
 	containerStoragePath = filepath.Join(dockerBasePath, "containers")
+	// Make sure in context of daemon, not the local platform. Note we can't
+	// use filepath.FromSlash or ToSlash here as they are a no-op on Unix.
+	if daemonPlatform == "windows" {
+		volumesConfigPath = strings.Replace(volumesConfigPath, `/`, `\`, -1)
+		containerStoragePath = strings.Replace(containerStoragePath, `/`, `\`, -1)
+	} else {
+		volumesConfigPath = strings.Replace(volumesConfigPath, `\`, `/`, -1)
+		containerStoragePath = strings.Replace(containerStoragePath, `\`, `/`, -1)
+	}
 }
 
 // Daemon represents a Docker daemon for the testing framework.