Remove deprecated integration-cli/environment functions
Yong Tang authored on 2018/01/16 06:24:52... | ... |
@@ -129,7 +129,7 @@ func (s *DockerRegistrySuite) SetUpTest(c *check.C) { |
129 | 129 |
testRequires(c, DaemonIsLinux, registry.Hosting, SameHostDaemon) |
130 | 130 |
s.reg = setupRegistry(c, false, "", "") |
131 | 131 |
s.d = daemon.New(c, dockerBinary, dockerdBinary, daemon.Config{ |
132 |
- Experimental: testEnv.ExperimentalDaemon(), |
|
132 |
+ Experimental: testEnv.DaemonInfo.ExperimentalBuild, |
|
133 | 133 |
}) |
134 | 134 |
} |
135 | 135 |
|
... | ... |
@@ -163,7 +163,7 @@ func (s *DockerSchema1RegistrySuite) SetUpTest(c *check.C) { |
163 | 163 |
testRequires(c, DaemonIsLinux, registry.Hosting, NotArm64, SameHostDaemon) |
164 | 164 |
s.reg = setupRegistry(c, true, "", "") |
165 | 165 |
s.d = daemon.New(c, dockerBinary, dockerdBinary, daemon.Config{ |
166 |
- Experimental: testEnv.ExperimentalDaemon(), |
|
166 |
+ Experimental: testEnv.DaemonInfo.ExperimentalBuild, |
|
167 | 167 |
}) |
168 | 168 |
} |
169 | 169 |
|
... | ... |
@@ -197,7 +197,7 @@ func (s *DockerRegistryAuthHtpasswdSuite) SetUpTest(c *check.C) { |
197 | 197 |
testRequires(c, DaemonIsLinux, registry.Hosting, SameHostDaemon) |
198 | 198 |
s.reg = setupRegistry(c, false, "htpasswd", "") |
199 | 199 |
s.d = daemon.New(c, dockerBinary, dockerdBinary, daemon.Config{ |
200 |
- Experimental: testEnv.ExperimentalDaemon(), |
|
200 |
+ Experimental: testEnv.DaemonInfo.ExperimentalBuild, |
|
201 | 201 |
}) |
202 | 202 |
} |
203 | 203 |
|
... | ... |
@@ -232,7 +232,7 @@ func (s *DockerRegistryAuthTokenSuite) OnTimeout(c *check.C) { |
232 | 232 |
func (s *DockerRegistryAuthTokenSuite) SetUpTest(c *check.C) { |
233 | 233 |
testRequires(c, DaemonIsLinux, registry.Hosting, SameHostDaemon) |
234 | 234 |
s.d = daemon.New(c, dockerBinary, dockerdBinary, daemon.Config{ |
235 |
- Experimental: testEnv.ExperimentalDaemon(), |
|
235 |
+ Experimental: testEnv.DaemonInfo.ExperimentalBuild, |
|
236 | 236 |
}) |
237 | 237 |
} |
238 | 238 |
|
... | ... |
@@ -273,7 +273,7 @@ func (s *DockerDaemonSuite) OnTimeout(c *check.C) { |
273 | 273 |
func (s *DockerDaemonSuite) SetUpTest(c *check.C) { |
274 | 274 |
testRequires(c, DaemonIsLinux, SameHostDaemon) |
275 | 275 |
s.d = daemon.New(c, dockerBinary, dockerdBinary, daemon.Config{ |
276 |
- Experimental: testEnv.ExperimentalDaemon(), |
|
276 |
+ Experimental: testEnv.DaemonInfo.ExperimentalBuild, |
|
277 | 277 |
}) |
278 | 278 |
} |
279 | 279 |
|
... | ... |
@@ -331,7 +331,7 @@ func (s *DockerSwarmSuite) SetUpTest(c *check.C) { |
331 | 331 |
func (s *DockerSwarmSuite) AddDaemon(c *check.C, joinSwarm, manager bool) *daemon.Swarm { |
332 | 332 |
d := &daemon.Swarm{ |
333 | 333 |
Daemon: daemon.New(c, dockerBinary, dockerdBinary, daemon.Config{ |
334 |
- Experimental: testEnv.ExperimentalDaemon(), |
|
334 |
+ Experimental: testEnv.DaemonInfo.ExperimentalBuild, |
|
335 | 335 |
}), |
336 | 336 |
Port: defaultSwarmPort + s.portIndex, |
337 | 337 |
} |
... | ... |
@@ -30,7 +30,7 @@ func (s *DockerSuite) TestBuildAPIDockerFileRemote(c *check.C) { |
30 | 30 |
testRequires(c, NotUserNamespace) |
31 | 31 |
|
32 | 32 |
var testD string |
33 |
- if testEnv.DaemonPlatform() == "windows" { |
|
33 |
+ if testEnv.OSType == "windows" { |
|
34 | 34 |
testD = `FROM busybox |
35 | 35 |
RUN find / -name ba* |
36 | 36 |
RUN find /tmp/` |
... | ... |
@@ -1016,7 +1016,7 @@ func (s *DockerSuite) TestContainerAPIWait(c *check.C) { |
1016 | 1016 |
name := "test-api-wait" |
1017 | 1017 |
|
1018 | 1018 |
sleepCmd := "/bin/sleep" |
1019 |
- if testEnv.DaemonPlatform() == "windows" { |
|
1019 |
+ if testEnv.OSType == "windows" { |
|
1020 | 1020 |
sleepCmd = "sleep" |
1021 | 1021 |
} |
1022 | 1022 |
dockerCmd(c, "run", "--name", name, "busybox", sleepCmd, "2") |
... | ... |
@@ -1216,7 +1216,7 @@ func (s *DockerSuite) TestContainerAPIDeleteRemoveVolume(c *check.C) { |
1216 | 1216 |
testRequires(c, SameHostDaemon) |
1217 | 1217 |
|
1218 | 1218 |
vol := "/testvolume" |
1219 |
- if testEnv.DaemonPlatform() == "windows" { |
|
1219 |
+ if testEnv.OSType == "windows" { |
|
1220 | 1220 |
vol = `c:\testvolume` |
1221 | 1221 |
} |
1222 | 1222 |
|
... | ... |
@@ -1890,7 +1890,7 @@ func (s *DockerSuite) TestContainersAPICreateMountsCreate(c *check.C) { |
1890 | 1890 |
var ( |
1891 | 1891 |
testImg string |
1892 | 1892 |
) |
1893 |
- if testEnv.DaemonPlatform() != "windows" { |
|
1893 |
+ if testEnv.OSType != "windows" { |
|
1894 | 1894 |
testImg = "test-mount-config" |
1895 | 1895 |
buildImageSuccessfully(c, testImg, build.WithDockerfile(` |
1896 | 1896 |
FROM busybox |
... | ... |
@@ -1987,7 +1987,7 @@ func (s *DockerSuite) TestContainersAPICreateMountsCreate(c *check.C) { |
1987 | 1987 |
} |
1988 | 1988 |
} |
1989 | 1989 |
|
1990 |
- if testEnv.DaemonPlatform() != "windows" { // Windows does not support volume populate |
|
1990 |
+ if testEnv.OSType != "windows" { // Windows does not support volume populate |
|
1991 | 1991 |
cases = append(cases, []testCase{ |
1992 | 1992 |
{ |
1993 | 1993 |
spec: mounttypes.Mount{Type: "volume", Target: destPath, VolumeOptions: &mounttypes.VolumeOptions{NoCopy: true}}, |
... | ... |
@@ -47,7 +47,7 @@ func (s *DockerSuite) TestContainersAPICreateMountsBindNamedPipe(c *check.C) { |
47 | 47 |
|
48 | 48 |
name := "test-bind-npipe" |
49 | 49 |
data := map[string]interface{}{ |
50 |
- "Image": testEnv.MinimalBaseImage(), |
|
50 |
+ "Image": testEnv.PlatformDefaults.BaseImage, |
|
51 | 51 |
"Cmd": []string{"cmd", "/c", cmd}, |
52 | 52 |
"HostConfig": map[string]interface{}{"Mounts": []map[string]interface{}{{"Type": "npipe", "Source": hostPipeName, "Target": containerPipeName}}}, |
53 | 53 |
} |
... | ... |
@@ -80,7 +80,7 @@ func (s *DockerSuite) TestAPIImagesDelete(c *check.C) { |
80 | 80 |
c.Assert(err, checker.IsNil) |
81 | 81 |
defer cli.Close() |
82 | 82 |
|
83 |
- if testEnv.DaemonPlatform() != "windows" { |
|
83 |
+ if testEnv.OSType != "windows" { |
|
84 | 84 |
testRequires(c, Network) |
85 | 85 |
} |
86 | 86 |
name := "test-api-images-delete" |
... | ... |
@@ -104,7 +104,7 @@ func (s *DockerSuite) TestAPIImagesHistory(c *check.C) { |
104 | 104 |
c.Assert(err, checker.IsNil) |
105 | 105 |
defer cli.Close() |
106 | 106 |
|
107 |
- if testEnv.DaemonPlatform() != "windows" { |
|
107 |
+ if testEnv.OSType != "windows" { |
|
108 | 108 |
testRequires(c, Network) |
109 | 109 |
} |
110 | 110 |
name := "test-api-images-history" |
... | ... |
@@ -39,7 +39,7 @@ func (s *DockerSuite) TestAPIStatsNoStreamGetCpu(c *check.C) { |
39 | 39 |
|
40 | 40 |
var cpuPercent = 0.0 |
41 | 41 |
|
42 |
- if testEnv.DaemonPlatform() != "windows" { |
|
42 |
+ if testEnv.OSType != "windows" { |
|
43 | 43 |
cpuDelta := float64(v.CPUStats.CPUUsage.TotalUsage - v.PreCPUStats.CPUUsage.TotalUsage) |
44 | 44 |
systemDelta := float64(v.CPUStats.SystemUsage - v.PreCPUStats.SystemUsage) |
45 | 45 |
cpuPercent = (cpuDelta / systemDelta) * float64(len(v.CPUStats.CPUUsage.PercpuUsage)) * 100.0 |
... | ... |
@@ -105,7 +105,7 @@ func (s *DockerSuite) TestAPIStatsNetworkStats(c *check.C) { |
105 | 105 |
|
106 | 106 |
// Retrieve the container address |
107 | 107 |
net := "bridge" |
108 |
- if testEnv.DaemonPlatform() == "windows" { |
|
108 |
+ if testEnv.OSType == "windows" { |
|
109 | 109 |
net = "nat" |
110 | 110 |
} |
111 | 111 |
contIP := findContainerIP(c, id, net) |
... | ... |
@@ -153,7 +153,7 @@ func (s *DockerSuite) TestAPIStatsNetworkStats(c *check.C) { |
153 | 153 |
// On Linux, account for ARP. |
154 | 154 |
expRxPkts := preRxPackets + uint64(numPings) |
155 | 155 |
expTxPkts := preTxPackets + uint64(numPings) |
156 |
- if testEnv.DaemonPlatform() != "windows" { |
|
156 |
+ if testEnv.OSType != "windows" { |
|
157 | 157 |
expRxPkts++ |
158 | 158 |
expTxPkts++ |
159 | 159 |
} |
... | ... |
@@ -33,7 +33,7 @@ func (s *DockerSuite) TestAPIGetEnabledCORS(c *check.C) { |
33 | 33 |
} |
34 | 34 |
|
35 | 35 |
func (s *DockerSuite) TestAPIClientVersionOldNotSupported(c *check.C) { |
36 |
- if testEnv.DaemonPlatform() != runtime.GOOS { |
|
36 |
+ if testEnv.OSType != runtime.GOOS { |
|
37 | 37 |
c.Skip("Daemon platform doesn't match test platform") |
38 | 38 |
} |
39 | 39 |
if api.MinVersion == api.DefaultVersion { |
... | ... |
@@ -40,7 +40,7 @@ func (s *DockerSuite) TestBuildJSONEmptyRun(c *check.C) { |
40 | 40 |
func (s *DockerSuite) TestBuildShCmdJSONEntrypoint(c *check.C) { |
41 | 41 |
name := "testbuildshcmdjsonentrypoint" |
42 | 42 |
expected := "/bin/sh -c echo test" |
43 |
- if testEnv.DaemonPlatform() == "windows" { |
|
43 |
+ if testEnv.OSType == "windows" { |
|
44 | 44 |
expected = "cmd /S /C echo test" |
45 | 45 |
} |
46 | 46 |
|
... | ... |
@@ -78,7 +78,7 @@ func (s *DockerSuite) TestBuildEnvironmentReplacementVolume(c *check.C) { |
78 | 78 |
|
79 | 79 |
var volumePath string |
80 | 80 |
|
81 |
- if testEnv.DaemonPlatform() == "windows" { |
|
81 |
+ if testEnv.OSType == "windows" { |
|
82 | 82 |
volumePath = "c:/quux" |
83 | 83 |
} else { |
84 | 84 |
volumePath = "/quux" |
... | ... |
@@ -135,7 +135,7 @@ func (s *DockerSuite) TestBuildEnvironmentReplacementWorkdir(c *check.C) { |
135 | 135 |
res := inspectFieldJSON(c, name, "Config.WorkingDir") |
136 | 136 |
|
137 | 137 |
expected := `"/work"` |
138 |
- if testEnv.DaemonPlatform() == "windows" { |
|
138 |
+ if testEnv.OSType == "windows" { |
|
139 | 139 |
expected = `"C:\\work"` |
140 | 140 |
} |
141 | 141 |
if res != expected { |
... | ... |
@@ -610,7 +610,7 @@ RUN [ $(cat "/test dir/test_file6") = 'test6' ]`, command, command, command, com |
610 | 610 |
|
611 | 611 |
func (s *DockerSuite) TestBuildCopyFileWithWhitespaceOnWindows(c *check.C) { |
612 | 612 |
testRequires(c, DaemonIsWindows) |
613 |
- dockerfile := `FROM ` + testEnv.MinimalBaseImage() + ` |
|
613 |
+ dockerfile := `FROM ` + testEnv.PlatformDefaults.BaseImage + ` |
|
614 | 614 |
RUN mkdir "C:/test dir" |
615 | 615 |
RUN mkdir "C:/test_dir" |
616 | 616 |
COPY [ "test file1", "/test_file1" ] |
... | ... |
@@ -1311,7 +1311,7 @@ func (s *DockerSuite) TestBuildRelativeWorkdir(c *check.C) { |
1311 | 1311 |
expectedFinal string |
1312 | 1312 |
) |
1313 | 1313 |
|
1314 |
- if testEnv.DaemonPlatform() == "windows" { |
|
1314 |
+ if testEnv.OSType == "windows" { |
|
1315 | 1315 |
expected1 = `C:/` |
1316 | 1316 |
expected2 = `C:/test1` |
1317 | 1317 |
expected3 = `C:/test2` |
... | ... |
@@ -1390,7 +1390,7 @@ func (s *DockerSuite) TestBuildWorkdirWithEnvVariables(c *check.C) { |
1390 | 1390 |
name := "testbuildworkdirwithenvvariables" |
1391 | 1391 |
|
1392 | 1392 |
var expected string |
1393 |
- if testEnv.DaemonPlatform() == "windows" { |
|
1393 |
+ if testEnv.OSType == "windows" { |
|
1394 | 1394 |
expected = `C:\test1\test2` |
1395 | 1395 |
} else { |
1396 | 1396 |
expected = `/test1/test2` |
... | ... |
@@ -1412,7 +1412,7 @@ func (s *DockerSuite) TestBuildRelativeCopy(c *check.C) { |
1412 | 1412 |
testRequires(c, NotUserNamespace) |
1413 | 1413 |
|
1414 | 1414 |
var expected string |
1415 |
- if testEnv.DaemonPlatform() == "windows" { |
|
1415 |
+ if testEnv.OSType == "windows" { |
|
1416 | 1416 |
expected = `C:/test1/test2` |
1417 | 1417 |
} else { |
1418 | 1418 |
expected = `/test1/test2` |
... | ... |
@@ -1521,7 +1521,7 @@ func (s *DockerSuite) TestBuildContextCleanup(c *check.C) { |
1521 | 1521 |
testRequires(c, SameHostDaemon) |
1522 | 1522 |
|
1523 | 1523 |
name := "testbuildcontextcleanup" |
1524 |
- entries, err := ioutil.ReadDir(filepath.Join(testEnv.DockerBasePath(), "tmp")) |
|
1524 |
+ entries, err := ioutil.ReadDir(filepath.Join(testEnv.DaemonInfo.DockerRootDir, "tmp")) |
|
1525 | 1525 |
if err != nil { |
1526 | 1526 |
c.Fatalf("failed to list contents of tmp dir: %s", err) |
1527 | 1527 |
} |
... | ... |
@@ -1529,7 +1529,7 @@ func (s *DockerSuite) TestBuildContextCleanup(c *check.C) { |
1529 | 1529 |
buildImageSuccessfully(c, name, build.WithDockerfile(`FROM `+minimalBaseImage()+` |
1530 | 1530 |
ENTRYPOINT ["/bin/echo"]`)) |
1531 | 1531 |
|
1532 |
- entriesFinal, err := ioutil.ReadDir(filepath.Join(testEnv.DockerBasePath(), "tmp")) |
|
1532 |
+ entriesFinal, err := ioutil.ReadDir(filepath.Join(testEnv.DaemonInfo.DockerRootDir, "tmp")) |
|
1533 | 1533 |
if err != nil { |
1534 | 1534 |
c.Fatalf("failed to list contents of tmp dir: %s", err) |
1535 | 1535 |
} |
... | ... |
@@ -1543,7 +1543,7 @@ func (s *DockerSuite) TestBuildContextCleanupFailedBuild(c *check.C) { |
1543 | 1543 |
testRequires(c, SameHostDaemon) |
1544 | 1544 |
|
1545 | 1545 |
name := "testbuildcontextcleanup" |
1546 |
- entries, err := ioutil.ReadDir(filepath.Join(testEnv.DockerBasePath(), "tmp")) |
|
1546 |
+ entries, err := ioutil.ReadDir(filepath.Join(testEnv.DaemonInfo.DockerRootDir, "tmp")) |
|
1547 | 1547 |
if err != nil { |
1548 | 1548 |
c.Fatalf("failed to list contents of tmp dir: %s", err) |
1549 | 1549 |
} |
... | ... |
@@ -1553,7 +1553,7 @@ func (s *DockerSuite) TestBuildContextCleanupFailedBuild(c *check.C) { |
1553 | 1553 |
ExitCode: 1, |
1554 | 1554 |
}) |
1555 | 1555 |
|
1556 |
- entriesFinal, err := ioutil.ReadDir(filepath.Join(testEnv.DockerBasePath(), "tmp")) |
|
1556 |
+ entriesFinal, err := ioutil.ReadDir(filepath.Join(testEnv.DaemonInfo.DockerRootDir, "tmp")) |
|
1557 | 1557 |
if err != nil { |
1558 | 1558 |
c.Fatalf("failed to list contents of tmp dir: %s", err) |
1559 | 1559 |
} |
... | ... |
@@ -2196,7 +2196,7 @@ func (s *DockerSuite) TestBuildAddFileNotFound(c *check.C) { |
2196 | 2196 |
name := "testbuildaddnotfound" |
2197 | 2197 |
expected := "foo: no such file or directory" |
2198 | 2198 |
|
2199 |
- if testEnv.DaemonPlatform() == "windows" { |
|
2199 |
+ if testEnv.OSType == "windows" { |
|
2200 | 2200 |
expected = "foo: The system cannot find the file specified" |
2201 | 2201 |
} |
2202 | 2202 |
|
... | ... |
@@ -2250,7 +2250,7 @@ func (s *DockerSuite) TestBuildOnBuild(c *check.C) { |
2250 | 2250 |
// gh #2446 |
2251 | 2251 |
func (s *DockerSuite) TestBuildAddToSymlinkDest(c *check.C) { |
2252 | 2252 |
makeLink := `ln -s /foo /bar` |
2253 |
- if testEnv.DaemonPlatform() == "windows" { |
|
2253 |
+ if testEnv.OSType == "windows" { |
|
2254 | 2254 |
makeLink = `mklink /D C:\bar C:\foo` |
2255 | 2255 |
} |
2256 | 2256 |
name := "testbuildaddtosymlinkdest" |
... | ... |
@@ -3205,7 +3205,7 @@ func (s *DockerSuite) TestBuildCmdShDashC(c *check.C) { |
3205 | 3205 |
|
3206 | 3206 |
res := inspectFieldJSON(c, name, "Config.Cmd") |
3207 | 3207 |
expected := `["/bin/sh","-c","echo cmd"]` |
3208 |
- if testEnv.DaemonPlatform() == "windows" { |
|
3208 |
+ if testEnv.OSType == "windows" { |
|
3209 | 3209 |
expected = `["cmd","/S","/C","echo cmd"]` |
3210 | 3210 |
} |
3211 | 3211 |
if res != expected { |
... | ... |
@@ -3278,7 +3278,7 @@ func (s *DockerSuite) TestBuildEntrypointCanBeOverriddenByChildInspect(c *check. |
3278 | 3278 |
expected = `["/bin/sh","-c","echo quux"]` |
3279 | 3279 |
) |
3280 | 3280 |
|
3281 |
- if testEnv.DaemonPlatform() == "windows" { |
|
3281 |
+ if testEnv.OSType == "windows" { |
|
3282 | 3282 |
expected = `["cmd","/S","/C","echo quux"]` |
3283 | 3283 |
} |
3284 | 3284 |
|
... | ... |
@@ -3335,7 +3335,7 @@ func (s *DockerSuite) TestBuildVerifySingleQuoteFails(c *check.C) { |
3335 | 3335 |
// it should barf on it. |
3336 | 3336 |
name := "testbuildsinglequotefails" |
3337 | 3337 |
expectedExitCode := 2 |
3338 |
- if testEnv.DaemonPlatform() == "windows" { |
|
3338 |
+ if testEnv.OSType == "windows" { |
|
3339 | 3339 |
expectedExitCode = 127 |
3340 | 3340 |
} |
3341 | 3341 |
|
... | ... |
@@ -3351,7 +3351,7 @@ func (s *DockerSuite) TestBuildVerboseOut(c *check.C) { |
3351 | 3351 |
name := "testbuildverboseout" |
3352 | 3352 |
expected := "\n123\n" |
3353 | 3353 |
|
3354 |
- if testEnv.DaemonPlatform() == "windows" { |
|
3354 |
+ if testEnv.OSType == "windows" { |
|
3355 | 3355 |
expected = "\n123\r\n" |
3356 | 3356 |
} |
3357 | 3357 |
|
... | ... |
@@ -3367,7 +3367,7 @@ func (s *DockerSuite) TestBuildWithTabs(c *check.C) { |
3367 | 3367 |
res := inspectFieldJSON(c, name, "ContainerConfig.Cmd") |
3368 | 3368 |
expected1 := `["/bin/sh","-c","echo\tone\t\ttwo"]` |
3369 | 3369 |
expected2 := `["/bin/sh","-c","echo\u0009one\u0009\u0009two"]` // syntactically equivalent, and what Go 1.3 generates |
3370 |
- if testEnv.DaemonPlatform() == "windows" { |
|
3370 |
+ if testEnv.OSType == "windows" { |
|
3371 | 3371 |
expected1 = `["cmd","/S","/C","echo\tone\t\ttwo"]` |
3372 | 3372 |
expected2 = `["cmd","/S","/C","echo\u0009one\u0009\u0009two"]` // syntactically equivalent, and what Go 1.3 generates |
3373 | 3373 |
} |
... | ... |
@@ -3562,7 +3562,7 @@ func (s *DockerSuite) TestBuildStderr(c *check.C) { |
3562 | 3562 |
result.Assert(c, icmd.Success) |
3563 | 3563 |
|
3564 | 3564 |
// Windows to non-Windows should have a security warning |
3565 |
- if runtime.GOOS == "windows" && testEnv.DaemonPlatform() != "windows" && !strings.Contains(result.Stdout(), "SECURITY WARNING:") { |
|
3565 |
+ if runtime.GOOS == "windows" && testEnv.OSType != "windows" && !strings.Contains(result.Stdout(), "SECURITY WARNING:") { |
|
3566 | 3566 |
c.Fatalf("Stdout contains unexpected output: %q", result.Stdout()) |
3567 | 3567 |
} |
3568 | 3568 |
|
... | ... |
@@ -3674,7 +3674,7 @@ func (s *DockerSuite) TestBuildVolumesRetainContents(c *check.C) { |
3674 | 3674 |
volName = "/foo" |
3675 | 3675 |
) |
3676 | 3676 |
|
3677 |
- if testEnv.DaemonPlatform() == "windows" { |
|
3677 |
+ if testEnv.OSType == "windows" { |
|
3678 | 3678 |
volName = "C:/foo" |
3679 | 3679 |
} |
3680 | 3680 |
|
... | ... |
@@ -3975,7 +3975,7 @@ RUN echo " \ |
3975 | 3975 |
|
3976 | 3976 |
expected := "\n foo \n" |
3977 | 3977 |
// Windows uses the builtin echo, which preserves quotes |
3978 |
- if testEnv.DaemonPlatform() == "windows" { |
|
3978 |
+ if testEnv.OSType == "windows" { |
|
3979 | 3979 |
expected = "\" foo \"" |
3980 | 3980 |
} |
3981 | 3981 |
|
... | ... |
@@ -4009,7 +4009,7 @@ func (s *DockerSuite) TestBuildMissingArgs(c *check.C) { |
4009 | 4009 |
"INSERT": {}, |
4010 | 4010 |
} |
4011 | 4011 |
|
4012 |
- if testEnv.DaemonPlatform() == "windows" { |
|
4012 |
+ if testEnv.OSType == "windows" { |
|
4013 | 4013 |
skipCmds = map[string]struct{}{ |
4014 | 4014 |
"CMD": {}, |
4015 | 4015 |
"RUN": {}, |
... | ... |
@@ -4142,7 +4142,7 @@ func (s *DockerSuite) TestBuildRUNErrMsg(c *check.C) { |
4142 | 4142 |
name := "testbuildbadrunerrmsg" |
4143 | 4143 |
shell := "/bin/sh -c" |
4144 | 4144 |
exitCode := 127 |
4145 |
- if testEnv.DaemonPlatform() == "windows" { |
|
4145 |
+ if testEnv.OSType == "windows" { |
|
4146 | 4146 |
shell = "cmd /S /C" |
4147 | 4147 |
// architectural - Windows has to start the container to determine the exe is bad, Linux does not |
4148 | 4148 |
exitCode = 1 |
... | ... |
@@ -4294,7 +4294,7 @@ func (s *DockerTrustSuite) TestTrustedBuildTagIgnoresOtherDelegationRoles(c *che |
4294 | 4294 |
func (s *DockerSuite) TestBuildNullStringInAddCopyVolume(c *check.C) { |
4295 | 4295 |
name := "testbuildnullstringinaddcopyvolume" |
4296 | 4296 |
volName := "nullvolume" |
4297 |
- if testEnv.DaemonPlatform() == "windows" { |
|
4297 |
+ if testEnv.OSType == "windows" { |
|
4298 | 4298 |
volName = `C:\\nullvolume` |
4299 | 4299 |
} |
4300 | 4300 |
|
... | ... |
@@ -4334,7 +4334,7 @@ func (s *DockerSuite) TestBuildBuildTimeArg(c *check.C) { |
4334 | 4334 |
envKey := "foo" |
4335 | 4335 |
envVal := "bar" |
4336 | 4336 |
var dockerfile string |
4337 |
- if testEnv.DaemonPlatform() == "windows" { |
|
4337 |
+ if testEnv.OSType == "windows" { |
|
4338 | 4338 |
// Bugs in Windows busybox port - use the default base image and native cmd stuff |
4339 | 4339 |
dockerfile = fmt.Sprintf(`FROM `+minimalBaseImage()+` |
4340 | 4340 |
ARG %s |
... | ... |
@@ -4949,7 +4949,7 @@ func (s *DockerSuite) TestBuildMultiStageUnusedArg(c *check.C) { |
4949 | 4949 |
func (s *DockerSuite) TestBuildNoNamedVolume(c *check.C) { |
4950 | 4950 |
volName := "testname:/foo" |
4951 | 4951 |
|
4952 |
- if testEnv.DaemonPlatform() == "windows" { |
|
4952 |
+ if testEnv.OSType == "windows" { |
|
4953 | 4953 |
volName = "testname:C:\\foo" |
4954 | 4954 |
} |
4955 | 4955 |
dockerCmd(c, "run", "-v", volName, "busybox", "sh", "-c", "touch /foo/oops") |
... | ... |
@@ -5155,7 +5155,7 @@ func (s *DockerSuite) TestBuildWorkdirWindowsPath(c *check.C) { |
5155 | 5155 |
testRequires(c, DaemonIsWindows) |
5156 | 5156 |
name := "testbuildworkdirwindowspath" |
5157 | 5157 |
buildImageSuccessfully(c, name, build.WithDockerfile(` |
5158 |
- FROM `+testEnv.MinimalBaseImage()+` |
|
5158 |
+ FROM `+testEnv.PlatformDefaults.BaseImage+` |
|
5159 | 5159 |
RUN mkdir C:\\work |
5160 | 5160 |
WORKDIR C:\\work |
5161 | 5161 |
RUN if "%CD%" NEQ "C:\work" exit -1 |
... | ... |
@@ -6150,7 +6150,7 @@ func (s *DockerTrustSuite) TestBuildMultiStageTrusted(c *check.C) { |
6150 | 6150 |
func (s *DockerSuite) TestBuildMultiStageMultipleBuildsWindows(c *check.C) { |
6151 | 6151 |
testRequires(c, DaemonIsWindows) |
6152 | 6152 |
dockerfile := ` |
6153 |
- FROM ` + testEnv.MinimalBaseImage() + ` |
|
6153 |
+ FROM ` + testEnv.PlatformDefaults.BaseImage + ` |
|
6154 | 6154 |
COPY foo c:\\bar` |
6155 | 6155 |
ctx := fakecontext.New(c, "", |
6156 | 6156 |
fakecontext.WithDockerfile(dockerfile), |
... | ... |
@@ -6163,7 +6163,7 @@ func (s *DockerSuite) TestBuildMultiStageMultipleBuildsWindows(c *check.C) { |
6163 | 6163 |
|
6164 | 6164 |
dockerfile = ` |
6165 | 6165 |
FROM build1:latest |
6166 |
- FROM ` + testEnv.MinimalBaseImage() + ` |
|
6166 |
+ FROM ` + testEnv.PlatformDefaults.BaseImage + ` |
|
6167 | 6167 |
COPY --from=0 c:\\bar / |
6168 | 6168 |
COPY foo /` |
6169 | 6169 |
ctx = fakecontext.New(c, "", |
... | ... |
@@ -6184,8 +6184,8 @@ func (s *DockerSuite) TestBuildMultiStageMultipleBuildsWindows(c *check.C) { |
6184 | 6184 |
func (s *DockerSuite) TestBuildCopyFromForbidWindowsSystemPaths(c *check.C) { |
6185 | 6185 |
testRequires(c, DaemonIsWindows) |
6186 | 6186 |
dockerfile := ` |
6187 |
- FROM ` + testEnv.MinimalBaseImage() + ` |
|
6188 |
- FROM ` + testEnv.MinimalBaseImage() + ` |
|
6187 |
+ FROM ` + testEnv.PlatformDefaults.BaseImage + ` |
|
6188 |
+ FROM ` + testEnv.PlatformDefaults.BaseImage + ` |
|
6189 | 6189 |
COPY --from=0 %s c:\\oscopy |
6190 | 6190 |
` |
6191 | 6191 |
exp := icmd.Expected{ |
... | ... |
@@ -6201,8 +6201,8 @@ func (s *DockerSuite) TestBuildCopyFromForbidWindowsSystemPaths(c *check.C) { |
6201 | 6201 |
func (s *DockerSuite) TestBuildCopyFromForbidWindowsRelativePaths(c *check.C) { |
6202 | 6202 |
testRequires(c, DaemonIsWindows) |
6203 | 6203 |
dockerfile := ` |
6204 |
- FROM ` + testEnv.MinimalBaseImage() + ` |
|
6205 |
- FROM ` + testEnv.MinimalBaseImage() + ` |
|
6204 |
+ FROM ` + testEnv.PlatformDefaults.BaseImage + ` |
|
6205 |
+ FROM ` + testEnv.PlatformDefaults.BaseImage + ` |
|
6206 | 6206 |
COPY --from=0 %s c:\\oscopy |
6207 | 6207 |
` |
6208 | 6208 |
exp := icmd.Expected{ |
... | ... |
@@ -6219,9 +6219,9 @@ func (s *DockerSuite) TestBuildCopyFromForbidWindowsRelativePaths(c *check.C) { |
6219 | 6219 |
func (s *DockerSuite) TestBuildCopyFromWindowsIsCaseInsensitive(c *check.C) { |
6220 | 6220 |
testRequires(c, DaemonIsWindows) |
6221 | 6221 |
dockerfile := ` |
6222 |
- FROM ` + testEnv.MinimalBaseImage() + ` |
|
6222 |
+ FROM ` + testEnv.PlatformDefaults.BaseImage + ` |
|
6223 | 6223 |
COPY foo / |
6224 |
- FROM ` + testEnv.MinimalBaseImage() + ` |
|
6224 |
+ FROM ` + testEnv.PlatformDefaults.BaseImage + ` |
|
6225 | 6225 |
COPY --from=0 c:\\fOo c:\\copied |
6226 | 6226 |
RUN type c:\\copied |
6227 | 6227 |
` |
... | ... |
@@ -6301,7 +6301,7 @@ func (s *DockerSuite) TestBuildOpaqueDirectory(c *check.C) { |
6301 | 6301 |
func (s *DockerSuite) TestBuildWindowsUser(c *check.C) { |
6302 | 6302 |
testRequires(c, DaemonIsWindows) |
6303 | 6303 |
name := "testbuildwindowsuser" |
6304 |
- buildImage(name, build.WithDockerfile(`FROM `+testEnv.MinimalBaseImage()+` |
|
6304 |
+ buildImage(name, build.WithDockerfile(`FROM `+testEnv.PlatformDefaults.BaseImage+` |
|
6305 | 6305 |
RUN net user user /add |
6306 | 6306 |
USER user |
6307 | 6307 |
RUN set username |
... | ... |
@@ -6332,7 +6332,7 @@ func (s *DockerSuite) TestBuildWindowsEnvCaseInsensitive(c *check.C) { |
6332 | 6332 |
testRequires(c, DaemonIsWindows) |
6333 | 6333 |
name := "testbuildwindowsenvcaseinsensitive" |
6334 | 6334 |
buildImageSuccessfully(c, name, build.WithDockerfile(` |
6335 |
- FROM `+testEnv.MinimalBaseImage()+` |
|
6335 |
+ FROM `+testEnv.PlatformDefaults.BaseImage+` |
|
6336 | 6336 |
ENV FOO=bar foo=baz |
6337 | 6337 |
`)) |
6338 | 6338 |
res := inspectFieldJSON(c, name, "Config.Env") |
... | ... |
@@ -6352,7 +6352,7 @@ WORKDIR /foo/bar |
6352 | 6352 |
|
6353 | 6353 |
// The Windows busybox image has a blank `cmd` |
6354 | 6354 |
lookingFor := `["sh"]` |
6355 |
- if testEnv.DaemonPlatform() == "windows" { |
|
6355 |
+ if testEnv.OSType == "windows" { |
|
6356 | 6356 |
lookingFor = "null" |
6357 | 6357 |
} |
6358 | 6358 |
c.Assert(strings.TrimSpace(out), checker.Equals, lookingFor) |
... | ... |
@@ -635,7 +635,7 @@ func (s *DockerRegistrySuite) TestPullFailsWithAlteredLayer(c *check.C) { |
635 | 635 |
// digest verification for the target layer digest. |
636 | 636 |
|
637 | 637 |
// Remove distribution cache to force a re-pull of the blobs |
638 |
- if err := os.RemoveAll(filepath.Join(testEnv.DockerBasePath(), "image", s.d.StorageDriver(), "distribution")); err != nil { |
|
638 |
+ if err := os.RemoveAll(filepath.Join(testEnv.DaemonInfo.DockerRootDir, "image", s.d.StorageDriver(), "distribution")); err != nil { |
|
639 | 639 |
c.Fatalf("error clearing distribution cache: %v", err) |
640 | 640 |
} |
641 | 641 |
|
... | ... |
@@ -678,7 +678,7 @@ func (s *DockerSchema1RegistrySuite) TestPullFailsWithAlteredLayer(c *check.C) { |
678 | 678 |
// digest verification for the target layer digest. |
679 | 679 |
|
680 | 680 |
// Remove distribution cache to force a re-pull of the blobs |
681 |
- if err := os.RemoveAll(filepath.Join(testEnv.DockerBasePath(), "image", s.d.StorageDriver(), "distribution")); err != nil { |
|
681 |
+ if err := os.RemoveAll(filepath.Join(testEnv.DaemonInfo.DockerRootDir, "image", s.d.StorageDriver(), "distribution")); err != nil { |
|
682 | 682 |
c.Fatalf("error clearing distribution cache: %v", err) |
683 | 683 |
} |
684 | 684 |
|
... | ... |
@@ -125,7 +125,7 @@ func (s *DockerSuite) TestCommitChange(c *check.C) { |
125 | 125 |
// ENV. On windows, the container doesn't have a `PATH` ENV variable so |
126 | 126 |
// the ordering is the same as the cli. |
127 | 127 |
expectedEnv := "[PATH=/foo DEBUG=true test=1]" |
128 |
- if testEnv.DaemonPlatform() == "windows" { |
|
128 |
+ if testEnv.OSType == "windows" { |
|
129 | 129 |
expectedEnv = "[DEBUG=true test=1 PATH=/foo]" |
130 | 130 |
} |
131 | 131 |
|
... | ... |
@@ -64,7 +64,7 @@ func (s *DockerSuite) TestCpCheckDestOwnership(c *check.C) { |
64 | 64 |
} |
65 | 65 |
|
66 | 66 |
func getRootUIDGID() (int, int, error) { |
67 |
- uidgid := strings.Split(filepath.Base(testEnv.DockerBasePath()), ".") |
|
67 |
+ uidgid := strings.Split(filepath.Base(testEnv.DaemonInfo.DockerRootDir), ".") |
|
68 | 68 |
if len(uidgid) == 1 { |
69 | 69 |
//user namespace remapping is not turned on; return 0 |
70 | 70 |
return 0, 0, nil |
... | ... |
@@ -60,7 +60,7 @@ func (s *DockerSuite) TestCreateArgs(c *check.C) { |
60 | 60 |
// Make sure we can grow the container's rootfs at creation time. |
61 | 61 |
func (s *DockerSuite) TestCreateGrowRootfs(c *check.C) { |
62 | 62 |
// Windows and Devicemapper support growing the rootfs |
63 |
- if testEnv.DaemonPlatform() != "windows" { |
|
63 |
+ if testEnv.OSType != "windows" { |
|
64 | 64 |
testRequires(c, Devicemapper) |
65 | 65 |
} |
66 | 66 |
out, _ := dockerCmd(c, "create", "--storage-opt", "size=120G", "busybox") |
... | ... |
@@ -224,8 +224,8 @@ func (s *DockerSuite) TestCreateLabelFromImage(c *check.C) { |
224 | 224 |
func (s *DockerSuite) TestCreateHostnameWithNumber(c *check.C) { |
225 | 225 |
image := "busybox" |
226 | 226 |
// Busybox on Windows does not implement hostname command |
227 |
- if testEnv.DaemonPlatform() == "windows" { |
|
228 |
- image = testEnv.MinimalBaseImage() |
|
227 |
+ if testEnv.OSType == "windows" { |
|
228 |
+ image = testEnv.PlatformDefaults.BaseImage |
|
229 | 229 |
} |
230 | 230 |
out, _ := dockerCmd(c, "run", "-h", "web.0", image, "hostname") |
231 | 231 |
c.Assert(strings.TrimSpace(out), checker.Equals, "web.0", check.Commentf("hostname not set, expected `web.0`, got: %s", out)) |
... | ... |
@@ -378,7 +378,7 @@ func (s *DockerSuite) TestCreateWithWorkdir(c *check.C) { |
378 | 378 |
|
379 | 379 |
dockerCmd(c, "create", "--name", name, "-w", dir, "busybox") |
380 | 380 |
// Windows does not create the workdir until the container is started |
381 |
- if testEnv.DaemonPlatform() == "windows" { |
|
381 |
+ if testEnv.OSType == "windows" { |
|
382 | 382 |
dockerCmd(c, "start", name) |
383 | 383 |
} |
384 | 384 |
dockerCmd(c, "cp", fmt.Sprintf("%s:%s", name, dir), prefix+slash+"tmp") |
... | ... |
@@ -1433,7 +1433,7 @@ func (s *DockerDaemonSuite) TestDaemonRestartWithSocketAsVolume(c *check.C) { |
1433 | 1433 |
// A subsequent daemon restart should clean up said mounts. |
1434 | 1434 |
func (s *DockerDaemonSuite) TestCleanupMountsAfterDaemonAndContainerKill(c *check.C) { |
1435 | 1435 |
d := daemon.New(c, dockerBinary, dockerdBinary, daemon.Config{ |
1436 |
- Experimental: testEnv.ExperimentalDaemon(), |
|
1436 |
+ Experimental: testEnv.DaemonInfo.ExperimentalBuild, |
|
1437 | 1437 |
}) |
1438 | 1438 |
d.StartWithBusybox(c) |
1439 | 1439 |
|
... | ... |
@@ -1473,7 +1473,7 @@ func (s *DockerDaemonSuite) TestCleanupMountsAfterDaemonAndContainerKill(c *chec |
1473 | 1473 |
// os.Interrupt should perform a graceful daemon shutdown and hence cleanup mounts. |
1474 | 1474 |
func (s *DockerDaemonSuite) TestCleanupMountsAfterGracefulShutdown(c *check.C) { |
1475 | 1475 |
d := daemon.New(c, dockerBinary, dockerdBinary, daemon.Config{ |
1476 |
- Experimental: testEnv.ExperimentalDaemon(), |
|
1476 |
+ Experimental: testEnv.DaemonInfo.ExperimentalBuild, |
|
1477 | 1477 |
}) |
1478 | 1478 |
d.StartWithBusybox(c) |
1479 | 1479 |
|
... | ... |
@@ -1694,7 +1694,7 @@ func (s *DockerDaemonSuite) TestDaemonRestartLocalVolumes(c *check.C) { |
1694 | 1694 |
// FIXME(vdemeester) should be a unit test |
1695 | 1695 |
func (s *DockerDaemonSuite) TestDaemonCorruptedLogDriverAddress(c *check.C) { |
1696 | 1696 |
d := daemon.New(c, dockerBinary, dockerdBinary, daemon.Config{ |
1697 |
- Experimental: testEnv.ExperimentalDaemon(), |
|
1697 |
+ Experimental: testEnv.DaemonInfo.ExperimentalBuild, |
|
1698 | 1698 |
}) |
1699 | 1699 |
c.Assert(d.StartWithError("--log-driver=syslog", "--log-opt", "syslog-address=corrupted:42"), check.NotNil) |
1700 | 1700 |
expected := "Failed to set log opts: syslog-address should be in form proto://address" |
... | ... |
@@ -1704,7 +1704,7 @@ func (s *DockerDaemonSuite) TestDaemonCorruptedLogDriverAddress(c *check.C) { |
1704 | 1704 |
// FIXME(vdemeester) should be a unit test |
1705 | 1705 |
func (s *DockerDaemonSuite) TestDaemonCorruptedFluentdAddress(c *check.C) { |
1706 | 1706 |
d := daemon.New(c, dockerBinary, dockerdBinary, daemon.Config{ |
1707 |
- Experimental: testEnv.ExperimentalDaemon(), |
|
1707 |
+ Experimental: testEnv.DaemonInfo.ExperimentalBuild, |
|
1708 | 1708 |
}) |
1709 | 1709 |
c.Assert(d.StartWithError("--log-driver=fluentd", "--log-opt", "fluentd-address=corrupted:c"), check.NotNil) |
1710 | 1710 |
expected := "Failed to set log opts: invalid fluentd-address corrupted:c: " |
... | ... |
@@ -3081,7 +3081,7 @@ func (s *DockerDaemonSuite) TestDaemonIpcModeShareableFromConfig(c *check.C) { |
3081 | 3081 |
|
3082 | 3082 |
func testDaemonStartIpcMode(c *check.C, from, mode string, valid bool) { |
3083 | 3083 |
d := daemon.New(c, dockerBinary, dockerdBinary, daemon.Config{ |
3084 |
- Experimental: testEnv.ExperimentalDaemon(), |
|
3084 |
+ Experimental: testEnv.DaemonInfo.ExperimentalBuild, |
|
3085 | 3085 |
}) |
3086 | 3086 |
c.Logf("Checking IpcMode %s set from %s\n", mode, from) |
3087 | 3087 |
var serr error |
... | ... |
@@ -20,7 +20,7 @@ func (s *DockerSuite) TestDiffFilenameShownInOutput(c *check.C) { |
20 | 20 |
// a "Files/" prefix. |
21 | 21 |
containerID := strings.TrimSpace(out) |
22 | 22 |
lookingFor := "A /foo/bar" |
23 |
- if testEnv.DaemonPlatform() == "windows" { |
|
23 |
+ if testEnv.OSType == "windows" { |
|
24 | 24 |
cli.WaitExited(c, containerID, 60*time.Second) |
25 | 25 |
lookingFor = "C Files/foo/bar" |
26 | 26 |
} |
... | ... |
@@ -659,7 +659,7 @@ func (s *DockerSuite) TestEventsContainerRestart(c *check.C) { |
659 | 659 |
|
660 | 660 |
// wait until test2 is auto removed. |
661 | 661 |
waitTime := 10 * time.Second |
662 |
- if testEnv.DaemonPlatform() == "windows" { |
|
662 |
+ if testEnv.OSType == "windows" { |
|
663 | 663 |
// Windows takes longer... |
664 | 664 |
waitTime = 90 * time.Second |
665 | 665 |
} |
... | ... |
@@ -53,7 +53,7 @@ type graphEventsCounter struct { |
53 | 53 |
|
54 | 54 |
func (s *DockerExternalGraphdriverSuite) SetUpTest(c *check.C) { |
55 | 55 |
s.d = daemon.New(c, dockerBinary, dockerdBinary, daemon.Config{ |
56 |
- Experimental: testEnv.ExperimentalDaemon(), |
|
56 |
+ Experimental: testEnv.DaemonInfo.ExperimentalBuild, |
|
57 | 57 |
}) |
58 | 58 |
} |
59 | 59 |
|
... | ... |
@@ -52,7 +52,7 @@ type DockerExternalVolumeSuite struct { |
52 | 52 |
func (s *DockerExternalVolumeSuite) SetUpTest(c *check.C) { |
53 | 53 |
testRequires(c, SameHostDaemon) |
54 | 54 |
s.d = daemon.New(c, dockerBinary, dockerdBinary, daemon.Config{ |
55 |
- Experimental: testEnv.ExperimentalDaemon(), |
|
55 |
+ Experimental: testEnv.DaemonInfo.ExperimentalBuild, |
|
56 | 56 |
}) |
57 | 57 |
s.ec = &eventCounter{} |
58 | 58 |
} |
... | ... |
@@ -36,7 +36,7 @@ func (s *DockerSuite) TestInfoEnsureSucceeds(c *check.C) { |
36 | 36 |
"Live Restore Enabled:", |
37 | 37 |
} |
38 | 38 |
|
39 |
- if testEnv.DaemonPlatform() == "linux" { |
|
39 |
+ if testEnv.OSType == "linux" { |
|
40 | 40 |
stringsToCheck = append(stringsToCheck, "Init Binary:", "Security Options:", "containerd version:", "runc version:", "init version:") |
41 | 41 |
} |
42 | 42 |
|
... | ... |
@@ -44,7 +44,7 @@ func (s *DockerSuite) TestInfoEnsureSucceeds(c *check.C) { |
44 | 44 |
stringsToCheck = append(stringsToCheck, "Runtimes:", "Default Runtime: runc") |
45 | 45 |
} |
46 | 46 |
|
47 |
- if testEnv.ExperimentalDaemon() { |
|
47 |
+ if testEnv.DaemonInfo.ExperimentalBuild { |
|
48 | 48 |
stringsToCheck = append(stringsToCheck, "Experimental: true") |
49 | 49 |
} else { |
50 | 50 |
stringsToCheck = append(stringsToCheck, "Experimental: false") |
... | ... |
@@ -72,7 +72,7 @@ func (s *DockerSuite) TestInfoDiscoveryBackend(c *check.C) { |
72 | 72 |
testRequires(c, SameHostDaemon, DaemonIsLinux) |
73 | 73 |
|
74 | 74 |
d := daemon.New(c, dockerBinary, dockerdBinary, daemon.Config{ |
75 |
- Experimental: testEnv.ExperimentalDaemon(), |
|
75 |
+ Experimental: testEnv.DaemonInfo.ExperimentalBuild, |
|
76 | 76 |
}) |
77 | 77 |
discoveryBackend := "consul://consuladdr:consulport/some/path" |
78 | 78 |
discoveryAdvertise := "1.1.1.1:2375" |
... | ... |
@@ -91,7 +91,7 @@ func (s *DockerSuite) TestInfoDiscoveryInvalidAdvertise(c *check.C) { |
91 | 91 |
testRequires(c, SameHostDaemon, DaemonIsLinux) |
92 | 92 |
|
93 | 93 |
d := daemon.New(c, dockerBinary, dockerdBinary, daemon.Config{ |
94 |
- Experimental: testEnv.ExperimentalDaemon(), |
|
94 |
+ Experimental: testEnv.DaemonInfo.ExperimentalBuild, |
|
95 | 95 |
}) |
96 | 96 |
discoveryBackend := "consul://consuladdr:consulport/some/path" |
97 | 97 |
|
... | ... |
@@ -110,7 +110,7 @@ func (s *DockerSuite) TestInfoDiscoveryAdvertiseInterfaceName(c *check.C) { |
110 | 110 |
testRequires(c, SameHostDaemon, Network, DaemonIsLinux) |
111 | 111 |
|
112 | 112 |
d := daemon.New(c, dockerBinary, dockerdBinary, daemon.Config{ |
113 |
- Experimental: testEnv.ExperimentalDaemon(), |
|
113 |
+ Experimental: testEnv.DaemonInfo.ExperimentalBuild, |
|
114 | 114 |
}) |
115 | 115 |
discoveryBackend := "consul://consuladdr:consulport/some/path" |
116 | 116 |
discoveryAdvertise := "eth0" |
... | ... |
@@ -183,7 +183,7 @@ func (s *DockerSuite) TestInfoDebug(c *check.C) { |
183 | 183 |
testRequires(c, SameHostDaemon, DaemonIsLinux) |
184 | 184 |
|
185 | 185 |
d := daemon.New(c, dockerBinary, dockerdBinary, daemon.Config{ |
186 |
- Experimental: testEnv.ExperimentalDaemon(), |
|
186 |
+ Experimental: testEnv.DaemonInfo.ExperimentalBuild, |
|
187 | 187 |
}) |
188 | 188 |
d.Start(c, "--debug") |
189 | 189 |
defer d.Stop(c) |
... | ... |
@@ -206,7 +206,7 @@ func (s *DockerSuite) TestInsecureRegistries(c *check.C) { |
206 | 206 |
registryHost := "insecurehost.com:5000" |
207 | 207 |
|
208 | 208 |
d := daemon.New(c, dockerBinary, dockerdBinary, daemon.Config{ |
209 |
- Experimental: testEnv.ExperimentalDaemon(), |
|
209 |
+ Experimental: testEnv.DaemonInfo.ExperimentalBuild, |
|
210 | 210 |
}) |
211 | 211 |
d.Start(c, "--insecure-registry="+registryCIDR, "--insecure-registry="+registryHost) |
212 | 212 |
defer d.Stop(c) |
... | ... |
@@ -61,7 +61,7 @@ func (s *DockerSuite) TestInspectStatus(c *check.C) { |
61 | 61 |
|
62 | 62 |
// Windows does not support pause/unpause on Windows Server Containers. |
63 | 63 |
// (RS1 does for Hyper-V Containers, but production CI is not setup for that) |
64 |
- if testEnv.DaemonPlatform() != "windows" { |
|
64 |
+ if testEnv.OSType != "windows" { |
|
65 | 65 |
dockerCmd(c, "pause", out) |
66 | 66 |
inspectOut = inspectField(c, out, "State.Status") |
67 | 67 |
c.Assert(inspectOut, checker.Equals, "paused") |
... | ... |
@@ -206,7 +206,7 @@ func (s *DockerSuite) TestInspectContainerGraphDriver(c *check.C) { |
206 | 206 |
func (s *DockerSuite) TestInspectBindMountPoint(c *check.C) { |
207 | 207 |
modifier := ",z" |
208 | 208 |
prefix, slash := getPrefixAndSlashFromDaemonPlatform() |
209 |
- if testEnv.DaemonPlatform() == "windows" { |
|
209 |
+ if testEnv.OSType == "windows" { |
|
210 | 210 |
modifier = "" |
211 | 211 |
// Linux creates the host directory if it doesn't exist. Windows does not. |
212 | 212 |
os.Mkdir(`c:\data`, os.ModeDir) |
... | ... |
@@ -229,7 +229,7 @@ func (s *DockerSuite) TestInspectBindMountPoint(c *check.C) { |
229 | 229 |
c.Assert(m.Driver, checker.Equals, "") |
230 | 230 |
c.Assert(m.Source, checker.Equals, prefix+slash+"data") |
231 | 231 |
c.Assert(m.Destination, checker.Equals, prefix+slash+"data") |
232 |
- if testEnv.DaemonPlatform() != "windows" { // Windows does not set mode |
|
232 |
+ if testEnv.OSType != "windows" { // Windows does not set mode |
|
233 | 233 |
c.Assert(m.Mode, checker.Equals, "ro"+modifier) |
234 | 234 |
} |
235 | 235 |
c.Assert(m.RW, checker.Equals, false) |
... | ... |
@@ -50,7 +50,7 @@ type DockerNetworkSuite struct { |
50 | 50 |
|
51 | 51 |
func (s *DockerNetworkSuite) SetUpTest(c *check.C) { |
52 | 52 |
s.d = daemon.New(c, dockerBinary, dockerdBinary, daemon.Config{ |
53 |
- Experimental: testEnv.ExperimentalDaemon(), |
|
53 |
+ Experimental: testEnv.DaemonInfo.ExperimentalBuild, |
|
54 | 54 |
}) |
55 | 55 |
} |
56 | 56 |
|
... | ... |
@@ -55,7 +55,7 @@ func (ps *DockerPluginSuite) TestPluginBasicOps(c *check.C) { |
55 | 55 |
c.Assert(err, checker.IsNil) |
56 | 56 |
c.Assert(out, checker.Contains, plugin) |
57 | 57 |
|
58 |
- _, err = os.Stat(filepath.Join(testEnv.DockerBasePath(), "plugins", id)) |
|
58 |
+ _, err = os.Stat(filepath.Join(testEnv.DaemonInfo.DockerRootDir, "plugins", id)) |
|
59 | 59 |
if !os.IsNotExist(err) { |
60 | 60 |
c.Fatal(err) |
61 | 61 |
} |
... | ... |
@@ -506,14 +506,14 @@ func (s *DockerSuite) TestPluginUpgrade(c *check.C) { |
506 | 506 |
id := strings.TrimSpace(out) |
507 | 507 |
|
508 | 508 |
// make sure "v2" does not exists |
509 |
- _, err = os.Stat(filepath.Join(testEnv.DockerBasePath(), "plugins", id, "rootfs", "v2")) |
|
509 |
+ _, err = os.Stat(filepath.Join(testEnv.DaemonInfo.DockerRootDir, "plugins", id, "rootfs", "v2")) |
|
510 | 510 |
c.Assert(os.IsNotExist(err), checker.True, check.Commentf(out)) |
511 | 511 |
|
512 | 512 |
dockerCmd(c, "plugin", "disable", "-f", plugin) |
513 | 513 |
dockerCmd(c, "plugin", "upgrade", "--grant-all-permissions", "--skip-remote-check", plugin, pluginV2) |
514 | 514 |
|
515 | 515 |
// make sure "v2" file exists |
516 |
- _, err = os.Stat(filepath.Join(testEnv.DockerBasePath(), "plugins", id, "rootfs", "v2")) |
|
516 |
+ _, err = os.Stat(filepath.Join(testEnv.DaemonInfo.DockerRootDir, "plugins", id, "rootfs", "v2")) |
|
517 | 517 |
c.Assert(err, checker.IsNil) |
518 | 518 |
|
519 | 519 |
dockerCmd(c, "plugin", "enable", plugin) |
... | ... |
@@ -216,7 +216,7 @@ func (s *DockerSuite) TestPsListContainersFilterStatus(c *check.C) { |
216 | 216 |
}) |
217 | 217 |
|
218 | 218 |
// Windows doesn't support pausing of containers |
219 |
- if testEnv.DaemonPlatform() != "windows" { |
|
219 |
+ if testEnv.OSType != "windows" { |
|
220 | 220 |
// pause running container |
221 | 221 |
out = cli.DockerCmd(c, "run", "-itd", "busybox").Combined() |
222 | 222 |
pausedID := strings.TrimSpace(out) |
... | ... |
@@ -269,7 +269,7 @@ func (s *DockerSuite) TestRestartContainerwithRestartPolicy(c *check.C) { |
269 | 269 |
id1 := strings.TrimSpace(string(out1)) |
270 | 270 |
id2 := strings.TrimSpace(string(out2)) |
271 | 271 |
waitTimeout := 15 * time.Second |
272 |
- if testEnv.DaemonPlatform() == "windows" { |
|
272 |
+ if testEnv.OSType == "windows" { |
|
273 | 273 |
waitTimeout = 150 * time.Second |
274 | 274 |
} |
275 | 275 |
err := waitInspect(id1, "{{ .State.Restarting }} {{ .State.Running }}", "false false", waitTimeout) |
... | ... |
@@ -68,7 +68,7 @@ func (s *DockerSuite) TestRmiImgIDMultipleTag(c *check.C) { |
68 | 68 |
|
69 | 69 |
// Wait for it to exit as cannot commit a running container on Windows, and |
70 | 70 |
// it will take a few seconds to exit |
71 |
- if testEnv.DaemonPlatform() == "windows" { |
|
71 |
+ if testEnv.OSType == "windows" { |
|
72 | 72 |
cli.WaitExited(c, containerID, 60*time.Second) |
73 | 73 |
} |
74 | 74 |
|
... | ... |
@@ -109,7 +109,7 @@ func (s *DockerSuite) TestRmiImgIDForce(c *check.C) { |
109 | 109 |
|
110 | 110 |
// Wait for it to exit as cannot commit a running container on Windows, and |
111 | 111 |
// it will take a few seconds to exit |
112 |
- if testEnv.DaemonPlatform() == "windows" { |
|
112 |
+ if testEnv.OSType == "windows" { |
|
113 | 113 |
cli.WaitExited(c, containerID, 60*time.Second) |
114 | 114 |
} |
115 | 115 |
|
... | ... |
@@ -72,10 +72,10 @@ func (s *DockerSuite) TestRunLeakyFileDescriptors(c *check.C) { |
72 | 72 |
// this will fail when Internet access is unavailable |
73 | 73 |
func (s *DockerSuite) TestRunLookupGoogleDNS(c *check.C) { |
74 | 74 |
testRequires(c, Network, NotArm) |
75 |
- if testEnv.DaemonPlatform() == "windows" { |
|
75 |
+ if testEnv.OSType == "windows" { |
|
76 | 76 |
// nslookup isn't present in Windows busybox. Is built-in. Further, |
77 | 77 |
// nslookup isn't present in nanoserver. Hence just use PowerShell... |
78 |
- dockerCmd(c, "run", testEnv.MinimalBaseImage(), "powershell", "Resolve-DNSName", "google.com") |
|
78 |
+ dockerCmd(c, "run", testEnv.PlatformDefaults.BaseImage, "powershell", "Resolve-DNSName", "google.com") |
|
79 | 79 |
} else { |
80 | 80 |
dockerCmd(c, "run", "busybox", "nslookup", "google.com") |
81 | 81 |
} |
... | ... |
@@ -137,7 +137,7 @@ func (s *DockerSuite) TestRunDetachedContainerIDPrinting(c *check.C) { |
137 | 137 |
func (s *DockerSuite) TestRunWorkingDirectory(c *check.C) { |
138 | 138 |
dir := "/root" |
139 | 139 |
image := "busybox" |
140 |
- if testEnv.DaemonPlatform() == "windows" { |
|
140 |
+ if testEnv.OSType == "windows" { |
|
141 | 141 |
dir = `C:/Windows` |
142 | 142 |
} |
143 | 143 |
|
... | ... |
@@ -160,9 +160,9 @@ func (s *DockerSuite) TestRunWorkingDirectory(c *check.C) { |
160 | 160 |
func (s *DockerSuite) TestRunWithoutNetworking(c *check.C) { |
161 | 161 |
count := "-c" |
162 | 162 |
image := "busybox" |
163 |
- if testEnv.DaemonPlatform() == "windows" { |
|
163 |
+ if testEnv.OSType == "windows" { |
|
164 | 164 |
count = "-n" |
165 |
- image = testEnv.MinimalBaseImage() |
|
165 |
+ image = testEnv.PlatformDefaults.BaseImage |
|
166 | 166 |
} |
167 | 167 |
|
168 | 168 |
// First using the long form --net |
... | ... |
@@ -354,8 +354,8 @@ func (s *DockerSuite) TestRunWithVolumesFromExited(c *check.C) { |
354 | 354 |
) |
355 | 355 |
|
356 | 356 |
// Create a file in a volume |
357 |
- if testEnv.DaemonPlatform() == "windows" { |
|
358 |
- out, exitCode = dockerCmd(c, "run", "--name", "test-data", "--volume", `c:\some\dir`, testEnv.MinimalBaseImage(), "cmd", "/c", `echo hello > c:\some\dir\file`) |
|
357 |
+ if testEnv.OSType == "windows" { |
|
358 |
+ out, exitCode = dockerCmd(c, "run", "--name", "test-data", "--volume", `c:\some\dir`, testEnv.PlatformDefaults.BaseImage, "cmd", "/c", `echo hello > c:\some\dir\file`) |
|
359 | 359 |
} else { |
360 | 360 |
out, exitCode = dockerCmd(c, "run", "--name", "test-data", "--volume", "/some/dir", "busybox", "touch", "/some/dir/file") |
361 | 361 |
} |
... | ... |
@@ -364,8 +364,8 @@ func (s *DockerSuite) TestRunWithVolumesFromExited(c *check.C) { |
364 | 364 |
} |
365 | 365 |
|
366 | 366 |
// Read the file from another container using --volumes-from to access the volume in the second container |
367 |
- if testEnv.DaemonPlatform() == "windows" { |
|
368 |
- out, exitCode = dockerCmd(c, "run", "--volumes-from", "test-data", testEnv.MinimalBaseImage(), "cmd", "/c", `type c:\some\dir\file`) |
|
367 |
+ if testEnv.OSType == "windows" { |
|
368 |
+ out, exitCode = dockerCmd(c, "run", "--volumes-from", "test-data", testEnv.PlatformDefaults.BaseImage, "cmd", "/c", `type c:\some\dir\file`) |
|
369 | 369 |
} else { |
370 | 370 |
out, exitCode = dockerCmd(c, "run", "--volumes-from", "test-data", "busybox", "cat", "/some/dir/file") |
371 | 371 |
} |
... | ... |
@@ -396,7 +396,7 @@ func (s *DockerSuite) TestRunCreateVolumesInSymlinkDir(c *check.C) { |
396 | 396 |
// In the case of Windows to Windows CI, if the machine is setup so that |
397 | 397 |
// the temp directory is not the C: drive, this test is invalid and will |
398 | 398 |
// not work. |
399 |
- if testEnv.DaemonPlatform() == "windows" && strings.ToLower(dir[:1]) != "c" { |
|
399 |
+ if testEnv.OSType == "windows" && strings.ToLower(dir[:1]) != "c" { |
|
400 | 400 |
c.Skip("Requires TEMP to point to C: drive") |
401 | 401 |
} |
402 | 402 |
|
... | ... |
@@ -406,8 +406,8 @@ func (s *DockerSuite) TestRunCreateVolumesInSymlinkDir(c *check.C) { |
406 | 406 |
} |
407 | 407 |
f.Close() |
408 | 408 |
|
409 |
- if testEnv.DaemonPlatform() == "windows" { |
|
410 |
- dockerFile = fmt.Sprintf("FROM %s\nRUN mkdir %s\nRUN mklink /D c:\\test %s", testEnv.MinimalBaseImage(), dir, dir) |
|
409 |
+ if testEnv.OSType == "windows" { |
|
410 |
+ dockerFile = fmt.Sprintf("FROM %s\nRUN mkdir %s\nRUN mklink /D c:\\test %s", testEnv.PlatformDefaults.BaseImage, dir, dir) |
|
411 | 411 |
containerPath = `c:\test\test` |
412 | 412 |
cmd = "tasklist" |
413 | 413 |
} else { |
... | ... |
@@ -431,8 +431,8 @@ func (s *DockerSuite) TestRunCreateVolumesInSymlinkDir2(c *check.C) { |
431 | 431 |
testRequires(c, SameHostDaemon, DaemonIsLinux) |
432 | 432 |
name := "test-volume-symlink2" |
433 | 433 |
|
434 |
- if testEnv.DaemonPlatform() == "windows" { |
|
435 |
- dockerFile = fmt.Sprintf("FROM %s\nRUN mkdir c:\\%s\nRUN mklink /D c:\\test c:\\%s", testEnv.MinimalBaseImage(), name, name) |
|
434 |
+ if testEnv.OSType == "windows" { |
|
435 |
+ dockerFile = fmt.Sprintf("FROM %s\nRUN mkdir c:\\%s\nRUN mklink /D c:\\test c:\\%s", testEnv.PlatformDefaults.BaseImage, name, name) |
|
436 | 436 |
containerPath = `c:\test\test` |
437 | 437 |
cmd = "tasklist" |
438 | 438 |
} else { |
... | ... |
@@ -455,7 +455,7 @@ func (s *DockerSuite) TestRunVolumesFromInReadonlyModeFails(c *check.C) { |
455 | 455 |
volumeDir string |
456 | 456 |
fileInVol string |
457 | 457 |
) |
458 |
- if testEnv.DaemonPlatform() == "windows" { |
|
458 |
+ if testEnv.OSType == "windows" { |
|
459 | 459 |
volumeDir = `c:/test` // Forward-slash as using busybox |
460 | 460 |
fileInVol = `c:/test/file` |
461 | 461 |
} else { |
... | ... |
@@ -476,7 +476,7 @@ func (s *DockerSuite) TestRunVolumesFromInReadWriteMode(c *check.C) { |
476 | 476 |
volumeDir string |
477 | 477 |
fileInVol string |
478 | 478 |
) |
479 |
- if testEnv.DaemonPlatform() == "windows" { |
|
479 |
+ if testEnv.OSType == "windows" { |
|
480 | 480 |
volumeDir = `c:/test` // Forward-slash as using busybox |
481 | 481 |
fileInVol = `c:/test/file` |
482 | 482 |
} else { |
... | ... |
@@ -497,7 +497,7 @@ func (s *DockerSuite) TestRunVolumesFromInReadWriteMode(c *check.C) { |
497 | 497 |
func (s *DockerSuite) TestVolumesFromGetsProperMode(c *check.C) { |
498 | 498 |
testRequires(c, SameHostDaemon) |
499 | 499 |
prefix, slash := getPrefixAndSlashFromDaemonPlatform() |
500 |
- hostpath := RandomTmpDirPath("test", testEnv.DaemonPlatform()) |
|
500 |
+ hostpath := RandomTmpDirPath("test", testEnv.OSType) |
|
501 | 501 |
if err := os.MkdirAll(hostpath, 0755); err != nil { |
502 | 502 |
c.Fatalf("Failed to create %s: %q", hostpath, err) |
503 | 503 |
} |
... | ... |
@@ -520,11 +520,11 @@ func (s *DockerSuite) TestVolumesFromGetsProperMode(c *check.C) { |
520 | 520 |
|
521 | 521 |
// Test for GH#10618 |
522 | 522 |
func (s *DockerSuite) TestRunNoDupVolumes(c *check.C) { |
523 |
- path1 := RandomTmpDirPath("test1", testEnv.DaemonPlatform()) |
|
524 |
- path2 := RandomTmpDirPath("test2", testEnv.DaemonPlatform()) |
|
523 |
+ path1 := RandomTmpDirPath("test1", testEnv.OSType) |
|
524 |
+ path2 := RandomTmpDirPath("test2", testEnv.OSType) |
|
525 | 525 |
|
526 | 526 |
someplace := ":/someplace" |
527 |
- if testEnv.DaemonPlatform() == "windows" { |
|
527 |
+ if testEnv.OSType == "windows" { |
|
528 | 528 |
// Windows requires that the source directory exists before calling HCS |
529 | 529 |
testRequires(c, SameHostDaemon) |
530 | 530 |
someplace = `:c:\someplace` |
... | ... |
@@ -573,7 +573,7 @@ func (s *DockerSuite) TestRunNoDupVolumes(c *check.C) { |
573 | 573 |
// Test for #1351 |
574 | 574 |
func (s *DockerSuite) TestRunApplyVolumesFromBeforeVolumes(c *check.C) { |
575 | 575 |
prefix := "" |
576 |
- if testEnv.DaemonPlatform() == "windows" { |
|
576 |
+ if testEnv.OSType == "windows" { |
|
577 | 577 |
prefix = `c:` |
578 | 578 |
} |
579 | 579 |
dockerCmd(c, "run", "--name", "parent", "-v", prefix+"/test", "busybox", "touch", prefix+"/test/foo") |
... | ... |
@@ -582,7 +582,7 @@ func (s *DockerSuite) TestRunApplyVolumesFromBeforeVolumes(c *check.C) { |
582 | 582 |
|
583 | 583 |
func (s *DockerSuite) TestRunMultipleVolumesFrom(c *check.C) { |
584 | 584 |
prefix := "" |
585 |
- if testEnv.DaemonPlatform() == "windows" { |
|
585 |
+ if testEnv.OSType == "windows" { |
|
586 | 586 |
prefix = `c:` |
587 | 587 |
} |
588 | 588 |
dockerCmd(c, "run", "--name", "parent1", "-v", prefix+"/test", "busybox", "touch", prefix+"/test/foo") |
... | ... |
@@ -612,7 +612,7 @@ func (s *DockerSuite) TestRunVerifyContainerID(c *check.C) { |
612 | 612 |
// Test that creating a container with a volume doesn't crash. Regression test for #995. |
613 | 613 |
func (s *DockerSuite) TestRunCreateVolume(c *check.C) { |
614 | 614 |
prefix := "" |
615 |
- if testEnv.DaemonPlatform() == "windows" { |
|
615 |
+ if testEnv.OSType == "windows" { |
|
616 | 616 |
prefix = `c:` |
617 | 617 |
} |
618 | 618 |
dockerCmd(c, "run", "-v", prefix+"/var/lib/data", "busybox", "true") |
... | ... |
@@ -668,9 +668,9 @@ func (s *DockerSuite) TestRunVolumesFromSymlinkPath(c *check.C) { |
668 | 668 |
RUN ln -s home /foo |
669 | 669 |
VOLUME ["/foo/bar"]` |
670 | 670 |
|
671 |
- if testEnv.DaemonPlatform() == "windows" { |
|
671 |
+ if testEnv.OSType == "windows" { |
|
672 | 672 |
prefix = `c:` |
673 |
- dfContents = `FROM ` + testEnv.MinimalBaseImage() + ` |
|
673 |
+ dfContents = `FROM ` + testEnv.PlatformDefaults.BaseImage + ` |
|
674 | 674 |
RUN mkdir c:\home |
675 | 675 |
RUN mklink /D c:\foo c:\home |
676 | 676 |
VOLUME ["c:/foo/bar"] |
... | ... |
@@ -714,7 +714,7 @@ func (s *DockerSuite) TestRunExitCode(c *check.C) { |
714 | 714 |
|
715 | 715 |
func (s *DockerSuite) TestRunUserDefaults(c *check.C) { |
716 | 716 |
expected := "uid=0(root) gid=0(root)" |
717 |
- if testEnv.DaemonPlatform() == "windows" { |
|
717 |
+ if testEnv.OSType == "windows" { |
|
718 | 718 |
expected = "uid=1000(ContainerAdministrator) gid=1000(ContainerAdministrator)" |
719 | 719 |
} |
720 | 720 |
out, _ := dockerCmd(c, "run", "busybox", "id") |
... | ... |
@@ -920,9 +920,9 @@ func (s *DockerSuite) TestRunEnvironmentOverride(c *check.C) { |
920 | 920 |
} |
921 | 921 |
|
922 | 922 |
func (s *DockerSuite) TestRunContainerNetwork(c *check.C) { |
923 |
- if testEnv.DaemonPlatform() == "windows" { |
|
923 |
+ if testEnv.OSType == "windows" { |
|
924 | 924 |
// Windows busybox does not have ping. Use built in ping instead. |
925 |
- dockerCmd(c, "run", testEnv.MinimalBaseImage(), "ping", "-n", "1", "127.0.0.1") |
|
925 |
+ dockerCmd(c, "run", testEnv.PlatformDefaults.BaseImage, "ping", "-n", "1", "127.0.0.1") |
|
926 | 926 |
} else { |
927 | 927 |
dockerCmd(c, "run", "busybox", "ping", "-c", "1", "127.0.0.1") |
928 | 928 |
} |
... | ... |
@@ -1220,7 +1220,7 @@ func (s *DockerSuite) TestRunModeHostname(c *check.C) { |
1220 | 1220 |
func (s *DockerSuite) TestRunRootWorkdir(c *check.C) { |
1221 | 1221 |
out, _ := dockerCmd(c, "run", "--workdir", "/", "busybox", "pwd") |
1222 | 1222 |
expected := "/\n" |
1223 |
- if testEnv.DaemonPlatform() == "windows" { |
|
1223 |
+ if testEnv.OSType == "windows" { |
|
1224 | 1224 |
expected = "C:" + expected |
1225 | 1225 |
} |
1226 | 1226 |
if out != expected { |
... | ... |
@@ -1229,9 +1229,9 @@ func (s *DockerSuite) TestRunRootWorkdir(c *check.C) { |
1229 | 1229 |
} |
1230 | 1230 |
|
1231 | 1231 |
func (s *DockerSuite) TestRunAllowBindMountingRoot(c *check.C) { |
1232 |
- if testEnv.DaemonPlatform() == "windows" { |
|
1232 |
+ if testEnv.OSType == "windows" { |
|
1233 | 1233 |
// Windows busybox will fail with Permission Denied on items such as pagefile.sys |
1234 |
- dockerCmd(c, "run", "-v", `c:\:c:\host`, testEnv.MinimalBaseImage(), "cmd", "-c", "dir", `c:\host`) |
|
1234 |
+ dockerCmd(c, "run", "-v", `c:\:c:\host`, testEnv.PlatformDefaults.BaseImage, "cmd", "-c", "dir", `c:\host`) |
|
1235 | 1235 |
} else { |
1236 | 1236 |
dockerCmd(c, "run", "-v", "/:/host", "busybox", "ls", "/host") |
1237 | 1237 |
} |
... | ... |
@@ -1240,7 +1240,7 @@ func (s *DockerSuite) TestRunAllowBindMountingRoot(c *check.C) { |
1240 | 1240 |
func (s *DockerSuite) TestRunDisallowBindMountingRootToRoot(c *check.C) { |
1241 | 1241 |
mount := "/:/" |
1242 | 1242 |
targetDir := "/host" |
1243 |
- if testEnv.DaemonPlatform() == "windows" { |
|
1243 |
+ if testEnv.OSType == "windows" { |
|
1244 | 1244 |
mount = `c:\:c\` |
1245 | 1245 |
targetDir = "c:/host" // Forward slash as using busybox |
1246 | 1246 |
} |
... | ... |
@@ -1704,15 +1704,15 @@ func (s *DockerSuite) TestRunCleanupCmdOnEntrypoint(c *check.C) { |
1704 | 1704 |
} |
1705 | 1705 |
out = strings.TrimSpace(out) |
1706 | 1706 |
expected := "root" |
1707 |
- if testEnv.DaemonPlatform() == "windows" { |
|
1708 |
- if strings.Contains(testEnv.MinimalBaseImage(), "windowsservercore") { |
|
1707 |
+ if testEnv.OSType == "windows" { |
|
1708 |
+ if strings.Contains(testEnv.PlatformDefaults.BaseImage, "windowsservercore") { |
|
1709 | 1709 |
expected = `user manager\containeradministrator` |
1710 | 1710 |
} else { |
1711 | 1711 |
expected = `ContainerAdministrator` // nanoserver |
1712 | 1712 |
} |
1713 | 1713 |
} |
1714 | 1714 |
if out != expected { |
1715 |
- c.Fatalf("Expected output %s, got %q. %s", expected, out, testEnv.MinimalBaseImage()) |
|
1715 |
+ c.Fatalf("Expected output %s, got %q. %s", expected, out, testEnv.PlatformDefaults.BaseImage) |
|
1716 | 1716 |
} |
1717 | 1717 |
} |
1718 | 1718 |
|
... | ... |
@@ -1720,7 +1720,7 @@ func (s *DockerSuite) TestRunCleanupCmdOnEntrypoint(c *check.C) { |
1720 | 1720 |
func (s *DockerSuite) TestRunWorkdirExistsAndIsFile(c *check.C) { |
1721 | 1721 |
existingFile := "/bin/cat" |
1722 | 1722 |
expected := "not a directory" |
1723 |
- if testEnv.DaemonPlatform() == "windows" { |
|
1723 |
+ if testEnv.OSType == "windows" { |
|
1724 | 1724 |
existingFile = `\windows\system32\ntdll.dll` |
1725 | 1725 |
expected = `The directory name is invalid.` |
1726 | 1726 |
} |
... | ... |
@@ -1736,7 +1736,7 @@ func (s *DockerSuite) TestRunExitOnStdinClose(c *check.C) { |
1736 | 1736 |
|
1737 | 1737 |
meow := "/bin/cat" |
1738 | 1738 |
delay := 60 |
1739 |
- if testEnv.DaemonPlatform() == "windows" { |
|
1739 |
+ if testEnv.OSType == "windows" { |
|
1740 | 1740 |
meow = "cat" |
1741 | 1741 |
} |
1742 | 1742 |
runCmd := exec.Command(dockerBinary, "run", "--name", name, "-i", "busybox", meow) |
... | ... |
@@ -1881,7 +1881,7 @@ func (s *DockerSuite) TestRunEntrypoint(c *check.C) { |
1881 | 1881 |
|
1882 | 1882 |
func (s *DockerSuite) TestRunBindMounts(c *check.C) { |
1883 | 1883 |
testRequires(c, SameHostDaemon) |
1884 |
- if testEnv.DaemonPlatform() == "linux" { |
|
1884 |
+ if testEnv.OSType == "linux" { |
|
1885 | 1885 |
testRequires(c, DaemonIsLinux, NotUserNamespace) |
1886 | 1886 |
} |
1887 | 1887 |
|
... | ... |
@@ -1902,7 +1902,7 @@ func (s *DockerSuite) TestRunBindMounts(c *check.C) { |
1902 | 1902 |
} |
1903 | 1903 |
|
1904 | 1904 |
// test writing to bind mount |
1905 |
- if testEnv.DaemonPlatform() == "windows" { |
|
1905 |
+ if testEnv.OSType == "windows" { |
|
1906 | 1906 |
dockerCmd(c, "run", "-v", fmt.Sprintf(`%s:c:\tmp:rw`, tmpDir), "busybox", "touch", "c:/tmp/holla") |
1907 | 1907 |
} else { |
1908 | 1908 |
dockerCmd(c, "run", "-v", fmt.Sprintf("%s:/tmp:rw", tmpDir), "busybox", "touch", "/tmp/holla") |
... | ... |
@@ -1917,7 +1917,7 @@ func (s *DockerSuite) TestRunBindMounts(c *check.C) { |
1917 | 1917 |
} |
1918 | 1918 |
|
1919 | 1919 |
// Windows does not (and likely never will) support mounting a single file |
1920 |
- if testEnv.DaemonPlatform() != "windows" { |
|
1920 |
+ if testEnv.OSType != "windows" { |
|
1921 | 1921 |
// test mount a file |
1922 | 1922 |
dockerCmd(c, "run", "-v", fmt.Sprintf("%s/holla:/tmp/holla:rw", tmpDir), "busybox", "sh", "-c", "echo -n 'yotta' > /tmp/holla") |
1923 | 1923 |
content := readFile(path.Join(tmpDir, "holla"), c) // Will fail if the file doesn't exist |
... | ... |
@@ -1942,9 +1942,9 @@ func (s *DockerSuite) TestRunCidFileCleanupIfEmpty(c *check.C) { |
1942 | 1942 |
tmpCidFile := path.Join(tmpDir, "cid") |
1943 | 1943 |
|
1944 | 1944 |
image := "emptyfs" |
1945 |
- if testEnv.DaemonPlatform() == "windows" { |
|
1945 |
+ if testEnv.OSType == "windows" { |
|
1946 | 1946 |
// Windows can't support an emptyfs image. Just use the regular Windows image |
1947 |
- image = testEnv.MinimalBaseImage() |
|
1947 |
+ image = testEnv.PlatformDefaults.BaseImage |
|
1948 | 1948 |
} |
1949 | 1949 |
out, _, err := dockerCmdWithError("run", "--cidfile", tmpCidFile, image) |
1950 | 1950 |
if err == nil { |
... | ... |
@@ -1988,7 +1988,7 @@ func (s *DockerSuite) TestRunCidFileCheckIDLength(c *check.C) { |
1988 | 1988 |
func (s *DockerSuite) TestRunSetMacAddress(c *check.C) { |
1989 | 1989 |
mac := "12:34:56:78:9a:bc" |
1990 | 1990 |
var out string |
1991 |
- if testEnv.DaemonPlatform() == "windows" { |
|
1991 |
+ if testEnv.OSType == "windows" { |
|
1992 | 1992 |
out, _ = dockerCmd(c, "run", "-i", "--rm", fmt.Sprintf("--mac-address=%s", mac), "busybox", "sh", "-c", "ipconfig /all | grep 'Physical Address' | awk '{print $12}'") |
1993 | 1993 |
mac = strings.Replace(strings.ToUpper(mac), ":", "-", -1) // To Windows-style MACs |
1994 | 1994 |
} else { |
... | ... |
@@ -2185,7 +2185,7 @@ func (s *DockerSuite) TestVolumesNoCopyData(c *check.C) { |
2185 | 2185 |
c.Fatalf("Data was copied on volumes-from but shouldn't be:\n%q", out) |
2186 | 2186 |
} |
2187 | 2187 |
|
2188 |
- tmpDir := RandomTmpDirPath("docker_test_bind_mount_copy_data", testEnv.DaemonPlatform()) |
|
2188 |
+ tmpDir := RandomTmpDirPath("docker_test_bind_mount_copy_data", testEnv.OSType) |
|
2189 | 2189 |
if out, _, err := dockerCmdWithError("run", "-v", tmpDir+":/foo", "dataimage", "ls", "-lh", "/foo/bar"); err == nil || !strings.Contains(out, "No such file or directory") { |
2190 | 2190 |
c.Fatalf("Data was copied on bind mount but shouldn't be:\n%q", out) |
2191 | 2191 |
} |
... | ... |
@@ -2567,10 +2567,10 @@ func (s *DockerSuite) TestRunNonLocalMacAddress(c *check.C) { |
2567 | 2567 |
args := []string{"run", "--mac-address", addr} |
2568 | 2568 |
expected := addr |
2569 | 2569 |
|
2570 |
- if testEnv.DaemonPlatform() != "windows" { |
|
2570 |
+ if testEnv.OSType != "windows" { |
|
2571 | 2571 |
args = append(args, "busybox", "ifconfig") |
2572 | 2572 |
} else { |
2573 |
- args = append(args, testEnv.MinimalBaseImage(), "ipconfig", "/all") |
|
2573 |
+ args = append(args, testEnv.PlatformDefaults.BaseImage, "ipconfig", "/all") |
|
2574 | 2574 |
expected = strings.Replace(strings.ToUpper(addr), ":", "-", -1) |
2575 | 2575 |
} |
2576 | 2576 |
|
... | ... |
@@ -2663,7 +2663,7 @@ func (s *DockerSuite) TestRunSetDefaultRestartPolicy(c *check.C) { |
2663 | 2663 |
func (s *DockerSuite) TestRunRestartMaxRetries(c *check.C) { |
2664 | 2664 |
out, _ := dockerCmd(c, "run", "-d", "--restart=on-failure:3", "busybox", "false") |
2665 | 2665 |
timeout := 10 * time.Second |
2666 |
- if testEnv.DaemonPlatform() == "windows" { |
|
2666 |
+ if testEnv.OSType == "windows" { |
|
2667 | 2667 |
timeout = 120 * time.Second |
2668 | 2668 |
} |
2669 | 2669 |
|
... | ... |
@@ -3031,7 +3031,7 @@ func (s *DockerSuite) TestVolumeFromMixedRWOptions(c *check.C) { |
3031 | 3031 |
dockerCmd(c, "run", "--volumes-from", "parent:ro", "--name", "test-volumes-1", "busybox", "true") |
3032 | 3032 |
dockerCmd(c, "run", "--volumes-from", "parent:rw", "--name", "test-volumes-2", "busybox", "true") |
3033 | 3033 |
|
3034 |
- if testEnv.DaemonPlatform() != "windows" { |
|
3034 |
+ if testEnv.OSType != "windows" { |
|
3035 | 3035 |
mRO, err := inspectMountPoint("test-volumes-1", prefix+slash+"test") |
3036 | 3036 |
c.Assert(err, checker.IsNil, check.Commentf("failed to inspect mount point")) |
3037 | 3037 |
if mRO.RW { |
... | ... |
@@ -3491,8 +3491,8 @@ func (s *DockerSuite) TestRunLoopbackOnlyExistsWhenNetworkingDisabled(c *check.C |
3491 | 3491 |
|
3492 | 3492 |
// Issue #4681 |
3493 | 3493 |
func (s *DockerSuite) TestRunLoopbackWhenNetworkDisabled(c *check.C) { |
3494 |
- if testEnv.DaemonPlatform() == "windows" { |
|
3495 |
- dockerCmd(c, "run", "--net=none", testEnv.MinimalBaseImage(), "ping", "-n", "1", "127.0.0.1") |
|
3494 |
+ if testEnv.OSType == "windows" { |
|
3495 |
+ dockerCmd(c, "run", "--net=none", testEnv.PlatformDefaults.BaseImage, "ping", "-n", "1", "127.0.0.1") |
|
3496 | 3496 |
} else { |
3497 | 3497 |
dockerCmd(c, "run", "--net=none", "busybox", "ping", "-c", "1", "127.0.0.1") |
3498 | 3498 |
} |
... | ... |
@@ -3758,7 +3758,7 @@ func (s *DockerSuite) TestRunNonExistingCmd(c *check.C) { |
3758 | 3758 |
// as that's when the check is made (and yes, by its design...) |
3759 | 3759 |
func (s *DockerSuite) TestCmdCannotBeInvoked(c *check.C) { |
3760 | 3760 |
expected := 126 |
3761 |
- if testEnv.DaemonPlatform() == "windows" { |
|
3761 |
+ if testEnv.OSType == "windows" { |
|
3762 | 3762 |
expected = 127 |
3763 | 3763 |
} |
3764 | 3764 |
name := "testCmdCannotBeInvoked" |
... | ... |
@@ -4241,7 +4241,7 @@ func (s *DockerSuite) TestRunCredentialSpecFailures(c *check.C) { |
4241 | 4241 |
func (s *DockerSuite) TestRunCredentialSpecWellFormed(c *check.C) { |
4242 | 4242 |
testRequires(c, DaemonIsWindows, SameHostDaemon) |
4243 | 4243 |
validCS := readFile(`fixtures\credentialspecs\valid.json`, c) |
4244 |
- writeFile(filepath.Join(testEnv.DockerBasePath(), `credentialspecs\valid.json`), validCS, c) |
|
4244 |
+ writeFile(filepath.Join(testEnv.DaemonInfo.DockerRootDir, `credentialspecs\valid.json`), validCS, c) |
|
4245 | 4245 |
dockerCmd(c, "run", `--security-opt=credentialspec=file://valid.json`, "busybox", "true") |
4246 | 4246 |
} |
4247 | 4247 |
|
... | ... |
@@ -4262,7 +4262,7 @@ func (s *DockerSuite) TestRunServicingContainer(c *check.C) { |
4262 | 4262 |
c.Skip("Disabled on post-RS3 builds") |
4263 | 4263 |
} |
4264 | 4264 |
|
4265 |
- out := cli.DockerCmd(c, "run", "-d", testEnv.MinimalBaseImage(), "cmd", "/c", "mkdir c:\\programdata\\Microsoft\\Windows\\ContainerUpdates\\000_000_d99f45d0-ffc8-4af7-bd9c-ea6a62e035c9_200 && sc control cexecsvc 255").Combined() |
|
4265 |
+ out := cli.DockerCmd(c, "run", "-d", testEnv.PlatformDefaults.BaseImage, "cmd", "/c", "mkdir c:\\programdata\\Microsoft\\Windows\\ContainerUpdates\\000_000_d99f45d0-ffc8-4af7-bd9c-ea6a62e035c9_200 && sc control cexecsvc 255").Combined() |
|
4266 | 4266 |
containerID := strings.TrimSpace(out) |
4267 | 4267 |
cli.WaitExited(c, containerID, 60*time.Second) |
4268 | 4268 |
|
... | ... |
@@ -13,7 +13,7 @@ func (s *DockerSuite) TestTopMultipleArgs(c *check.C) { |
13 | 13 |
cleanedContainerID := strings.TrimSpace(out) |
14 | 14 |
|
15 | 15 |
var expected icmd.Expected |
16 |
- switch testEnv.DaemonPlatform() { |
|
16 |
+ switch testEnv.OSType { |
|
17 | 17 |
case "windows": |
18 | 18 |
expected = icmd.Expected{ExitCode: 1, Err: "Windows does not support arguments to top"} |
19 | 19 |
default: |
... | ... |
@@ -34,7 +34,7 @@ func (s *DockerSuite) TestTopNonPrivileged(c *check.C) { |
34 | 34 |
// Windows will list the name of the launched executable which in this case is busybox.exe, without the parameters. |
35 | 35 |
// Linux will display the command executed in the container |
36 | 36 |
var lookingFor string |
37 |
- if testEnv.DaemonPlatform() == "windows" { |
|
37 |
+ if testEnv.OSType == "windows" { |
|
38 | 38 |
lookingFor = "busybox.exe" |
39 | 39 |
} else { |
40 | 40 |
lookingFor = "top" |
... | ... |
@@ -13,7 +13,7 @@ import ( |
13 | 13 |
func (s *DockerSuite) TestUpdateRestartPolicy(c *check.C) { |
14 | 14 |
out := cli.DockerCmd(c, "run", "-d", "--restart=on-failure:3", "busybox", "sh", "-c", "sleep 1 && false").Combined() |
15 | 15 |
timeout := 60 * time.Second |
16 |
- if testEnv.DaemonPlatform() == "windows" { |
|
16 |
+ if testEnv.OSType == "windows" { |
|
17 | 17 |
timeout = 180 * time.Second |
18 | 18 |
} |
19 | 19 |
|
... | ... |
@@ -36,7 +36,7 @@ func (s *DockerSuite) TestDeprecatedContainerAPIStartVolumeBinds(c *check.C) { |
36 | 36 |
// TODO Windows CI: Investigate further why this fails on Windows to Windows CI. |
37 | 37 |
testRequires(c, DaemonIsLinux) |
38 | 38 |
path := "/foo" |
39 |
- if testEnv.DaemonPlatform() == "windows" { |
|
39 |
+ if testEnv.OSType == "windows" { |
|
40 | 40 |
path = `c:\foo` |
41 | 41 |
} |
42 | 42 |
name := "testing" |
... | ... |
@@ -49,7 +49,7 @@ func (s *DockerSuite) TestDeprecatedContainerAPIStartVolumeBinds(c *check.C) { |
49 | 49 |
c.Assert(err, checker.IsNil) |
50 | 50 |
c.Assert(res.StatusCode, checker.Equals, http.StatusCreated) |
51 | 51 |
|
52 |
- bindPath := RandomTmpDirPath("test", testEnv.DaemonPlatform()) |
|
52 |
+ bindPath := RandomTmpDirPath("test", testEnv.OSType) |
|
53 | 53 |
config = map[string]interface{}{ |
54 | 54 |
"Binds": []string{bindPath + ":" + path}, |
55 | 55 |
} |
... | ... |
@@ -76,8 +76,8 @@ func (s *DockerSuite) TestDeprecatedContainerAPIStartDupVolumeBinds(c *check.C) |
76 | 76 |
c.Assert(err, checker.IsNil) |
77 | 77 |
c.Assert(res.StatusCode, checker.Equals, http.StatusCreated) |
78 | 78 |
|
79 |
- bindPath1 := RandomTmpDirPath("test1", testEnv.DaemonPlatform()) |
|
80 |
- bindPath2 := RandomTmpDirPath("test2", testEnv.DaemonPlatform()) |
|
79 |
+ bindPath1 := RandomTmpDirPath("test1", testEnv.OSType) |
|
80 |
+ bindPath2 := RandomTmpDirPath("test2", testEnv.OSType) |
|
81 | 81 |
|
82 | 82 |
config = map[string]interface{}{ |
83 | 83 |
"Binds": []string{bindPath1 + ":/tmp", bindPath2 + ":/tmp"}, |
... | ... |
@@ -41,7 +41,7 @@ func newDockerHubPullSuite() *DockerHubPullSuite { |
41 | 41 |
func (s *DockerHubPullSuite) SetUpSuite(c *check.C) { |
42 | 42 |
testRequires(c, DaemonIsLinux, SameHostDaemon) |
43 | 43 |
s.d = daemon.New(c, dockerBinary, dockerdBinary, daemon.Config{ |
44 |
- Experimental: testEnv.ExperimentalDaemon(), |
|
44 |
+ Experimental: testEnv.DaemonInfo.ExperimentalBuild, |
|
45 | 45 |
}) |
46 | 46 |
s.d.Start(c) |
47 | 47 |
} |
... | ... |
@@ -399,7 +399,7 @@ func runSleepingContainerInImage(c *check.C, image string, extraArgs ...string) |
399 | 399 |
// minimalBaseImage returns the name of the minimal base image for the current |
400 | 400 |
// daemon platform. |
401 | 401 |
func minimalBaseImage() string { |
402 |
- return testEnv.MinimalBaseImage() |
|
402 |
+ return testEnv.PlatformDefaults.BaseImage |
|
403 | 403 |
} |
404 | 404 |
|
405 | 405 |
func getGoroutineNumber() (int, error) { |
... | ... |
@@ -48,32 +48,3 @@ func New() (*Execution, error) { |
48 | 48 |
dockerBinary: dockerBinary, |
49 | 49 |
}, nil |
50 | 50 |
} |
51 |
- |
|
52 |
-// DockerBasePath is the base path of the docker folder (by default it is -/var/run/docker) |
|
53 |
-// TODO: remove |
|
54 |
-// Deprecated: use Execution.DaemonInfo.DockerRootDir |
|
55 |
-func (e *Execution) DockerBasePath() string { |
|
56 |
- return e.DaemonInfo.DockerRootDir |
|
57 |
-} |
|
58 |
- |
|
59 |
-// ExperimentalDaemon tell whether the main daemon has |
|
60 |
-// experimental features enabled or not |
|
61 |
-// Deprecated: use DaemonInfo.ExperimentalBuild |
|
62 |
-func (e *Execution) ExperimentalDaemon() bool { |
|
63 |
- return e.DaemonInfo.ExperimentalBuild |
|
64 |
-} |
|
65 |
- |
|
66 |
-// DaemonPlatform is held globally so that tests can make intelligent |
|
67 |
-// decisions on how to configure themselves according to the platform |
|
68 |
-// of the daemon. This is initialized in docker_utils by sending |
|
69 |
-// a version call to the daemon and examining the response header. |
|
70 |
-// Deprecated: use Execution.OSType |
|
71 |
-func (e *Execution) DaemonPlatform() string { |
|
72 |
- return e.OSType |
|
73 |
-} |
|
74 |
- |
|
75 |
-// MinimalBaseImage is the image used for minimal builds (it depends on the platform) |
|
76 |
-// Deprecated: use Execution.PlatformDefaults.BaseImage |
|
77 |
-func (e *Execution) MinimalBaseImage() string { |
|
78 |
- return e.PlatformDefaults.BaseImage |
|
79 |
-} |
... | ... |
@@ -38,7 +38,7 @@ func ensureSyscallTest(c *check.C) { |
38 | 38 |
|
39 | 39 |
// if no match, must build in docker, which is significantly slower |
40 | 40 |
// (slower mostly because of the vfs graphdriver) |
41 |
- if testEnv.DaemonPlatform() != runtime.GOOS { |
|
41 |
+ if testEnv.OSType != runtime.GOOS { |
|
42 | 42 |
ensureSyscallTestBuild(c) |
43 | 43 |
return |
44 | 44 |
} |
... | ... |
@@ -93,7 +93,7 @@ func ensureSyscallTestBuild(c *check.C) { |
93 | 93 |
|
94 | 94 |
func ensureNNPTest(c *check.C) { |
95 | 95 |
defer testEnv.ProtectImage(c, "nnp-test:latest") |
96 |
- if testEnv.DaemonPlatform() != runtime.GOOS { |
|
96 |
+ if testEnv.OSType != runtime.GOOS { |
|
97 | 97 |
ensureNNPTestBuild(c) |
98 | 98 |
return |
99 | 99 |
} |
... | ... |
@@ -4,7 +4,7 @@ package main |
4 | 4 |
// the command is for a sleeping container based on the daemon platform. |
5 | 5 |
// The Windows busybox image does not have a `top` command. |
6 | 6 |
func sleepCommandForDaemonPlatform() []string { |
7 |
- if testEnv.DaemonPlatform() == "windows" { |
|
7 |
+ if testEnv.OSType == "windows" { |
|
8 | 8 |
return []string{"sleep", "240"} |
9 | 9 |
} |
10 | 10 |
return []string{"top"} |