Browse code

Fix test file paths

Signed-off-by: John Howard <jhoward@microsoft.com>

John Howard authored on 2015/10/30 07:51:04
Showing 1 changed files
... ...
@@ -86,6 +86,15 @@ func init() {
86 86
 	dockerBasePath = info.DockerRootDir
87 87
 	volumesConfigPath = filepath.Join(dockerBasePath, "volumes")
88 88
 	containerStoragePath = filepath.Join(dockerBasePath, "containers")
89
+	// Make sure in context of daemon, not the local platform. Note we can't
90
+	// use filepath.FromSlash or ToSlash here as they are a no-op on Unix.
91
+	if daemonPlatform == "windows" {
92
+		volumesConfigPath = strings.Replace(volumesConfigPath, `/`, `\`, -1)
93
+		containerStoragePath = strings.Replace(containerStoragePath, `/`, `\`, -1)
94
+	} else {
95
+		volumesConfigPath = strings.Replace(volumesConfigPath, `\`, `/`, -1)
96
+		containerStoragePath = strings.Replace(containerStoragePath, `\`, `/`, -1)
97
+	}
89 98
 }
90 99
 
91 100
 // Daemon represents a Docker daemon for the testing framework.