Browse code

Windows: Remove check for volume support

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

John Howard authored on 2015/11/14 06:02:30
Showing 4 changed files
... ...
@@ -14,7 +14,6 @@ func (s *DockerSuite) TestVolumesApiList(c *check.C) {
14 14
 	prefix := ""
15 15
 	if daemonPlatform == "windows" {
16 16
 		prefix = "c:"
17
-		testRequires(c, WindowsDaemonSupportsVolumes)
18 17
 	}
19 18
 	dockerCmd(c, "run", "-d", "-v", prefix+"/foo", "busybox")
20 19
 
... ...
@@ -29,9 +28,6 @@ func (s *DockerSuite) TestVolumesApiList(c *check.C) {
29 29
 }
30 30
 
31 31
 func (s *DockerSuite) TestVolumesApiCreate(c *check.C) {
32
-	if daemonPlatform == "windows" {
33
-		testRequires(c, WindowsDaemonSupportsVolumes)
34
-	}
35 32
 	config := types.VolumeCreateRequest{
36 33
 		Name: "test",
37 34
 	}
... ...
@@ -49,7 +45,6 @@ func (s *DockerSuite) TestVolumesApiCreate(c *check.C) {
49 49
 func (s *DockerSuite) TestVolumesApiRemove(c *check.C) {
50 50
 	prefix := ""
51 51
 	if daemonPlatform == "windows" {
52
-		testRequires(c, WindowsDaemonSupportsVolumes)
53 52
 		prefix = "c:"
54 53
 	}
55 54
 	dockerCmd(c, "run", "-d", "-v", prefix+"/foo", "--name=test", "busybox")
... ...
@@ -75,9 +70,6 @@ func (s *DockerSuite) TestVolumesApiRemove(c *check.C) {
75 75
 }
76 76
 
77 77
 func (s *DockerSuite) TestVolumesApiInspect(c *check.C) {
78
-	if daemonPlatform == "windows" {
79
-		testRequires(c, WindowsDaemonSupportsVolumes)
80
-	}
81 78
 	config := types.VolumeCreateRequest{
82 79
 		Name: "test",
83 80
 	}
... ...
@@ -228,7 +228,6 @@ func (s *DockerSuite) TestRunWithVolumesFromExited(c *check.C) {
228 228
 
229 229
 	// Create a file in a volume
230 230
 	if daemonPlatform == "windows" {
231
-		testRequires(c, WindowsDaemonSupportsVolumes)
232 231
 		out, exitCode = dockerCmd(c, "run", "--name", "test-data", "--volume", `c:\some\dir`, WindowsBaseImage, `cmd /c echo hello > c:\some\dir\file`)
233 232
 	} else {
234 233
 		out, exitCode = dockerCmd(c, "run", "--name", "test-data", "--volume", "/some/dir", "busybox", "touch", "/some/dir/file")
... ...
@@ -256,12 +255,7 @@ func (s *DockerSuite) TestRunCreateVolumesInSymlinkDir(c *check.C) {
256 256
 		containerPath string
257 257
 		cmd           string
258 258
 	)
259
-	if daemonPlatform == "windows" {
260
-		testRequires(c, SameHostDaemon, WindowsDaemonSupportsVolumes)
261
-	} else {
262
-		testRequires(c, SameHostDaemon)
263
-	}
264
-
259
+	testRequires(c, SameHostDaemon)
265 260
 	name := "test-volume-symlink"
266 261
 
267 262
 	dir, err := ioutil.TempDir("", name)
... ...
@@ -310,7 +304,6 @@ func (s *DockerSuite) TestRunVolumesFromInReadonlyModeFails(c *check.C) {
310 310
 		fileInVol string
311 311
 	)
312 312
 	if daemonPlatform == "windows" {
313
-		testRequires(c, WindowsDaemonSupportsVolumes)
314 313
 		volumeDir = `c:/test` // Forward-slash as using busybox
315 314
 		fileInVol = `c:/test/file`
316 315
 	} else {
... ...
@@ -332,7 +325,6 @@ func (s *DockerSuite) TestRunVolumesFromInReadWriteMode(c *check.C) {
332 332
 		fileInVol string
333 333
 	)
334 334
 	if daemonPlatform == "windows" {
335
-		testRequires(c, WindowsDaemonSupportsVolumes)
336 335
 		volumeDir = `c:/test` // Forward-slash as using busybox
337 336
 		fileInVol = `c:/test/file`
338 337
 	} else {
... ...
@@ -378,7 +370,7 @@ func (s *DockerSuite) TestRunNoDupVolumes(c *check.C) {
378 378
 	someplace := ":/someplace"
379 379
 	if daemonPlatform == "windows" {
380 380
 		// Windows requires that the source directory exists before calling HCS
381
-		testRequires(c, SameHostDaemon, WindowsDaemonSupportsVolumes)
381
+		testRequires(c, SameHostDaemon)
382 382
 		someplace = `:c:\someplace`
383 383
 		if err := os.MkdirAll(path1, 0755); err != nil {
384 384
 			c.Fatalf("Failed to create %s: %q", path1, err)
... ...
@@ -405,7 +397,6 @@ func (s *DockerSuite) TestRunNoDupVolumes(c *check.C) {
405 405
 func (s *DockerSuite) TestRunApplyVolumesFromBeforeVolumes(c *check.C) {
406 406
 	prefix := ""
407 407
 	if daemonPlatform == "windows" {
408
-		testRequires(c, WindowsDaemonSupportsVolumes)
409 408
 		prefix = `c:`
410 409
 	}
411 410
 	dockerCmd(c, "run", "--name", "parent", "-v", prefix+"/test", "busybox", "touch", prefix+"/test/foo")
... ...
@@ -415,7 +406,6 @@ func (s *DockerSuite) TestRunApplyVolumesFromBeforeVolumes(c *check.C) {
415 415
 func (s *DockerSuite) TestRunMultipleVolumesFrom(c *check.C) {
416 416
 	prefix := ""
417 417
 	if daemonPlatform == "windows" {
418
-		testRequires(c, WindowsDaemonSupportsVolumes)
419 418
 		prefix = `c:`
420 419
 	}
421 420
 	dockerCmd(c, "run", "--name", "parent1", "-v", prefix+"/test", "busybox", "touch", prefix+"/test/foo")
... ...
@@ -446,7 +436,6 @@ func (s *DockerSuite) TestRunVerifyContainerID(c *check.C) {
446 446
 func (s *DockerSuite) TestRunCreateVolume(c *check.C) {
447 447
 	prefix := ""
448 448
 	if daemonPlatform == "windows" {
449
-		testRequires(c, WindowsDaemonSupportsVolumes)
450 449
 		prefix = `c:`
451 450
 	}
452 451
 	dockerCmd(c, "run", "-v", prefix+"/var/lib/data", "busybox", "true")
... ...
@@ -491,10 +480,6 @@ func (s *DockerSuite) TestRunCreateVolumeWithSymlink(c *check.C) {
491 491
 
492 492
 // Tests that a volume path that has a symlink exists in a container mounting it with `--volumes-from`.
493 493
 func (s *DockerSuite) TestRunVolumesFromSymlinkPath(c *check.C) {
494
-	if daemonPlatform == "windows" {
495
-		testRequires(c, WindowsDaemonSupportsVolumes)
496
-	}
497
-
498 494
 	name := "docker-test-volumesfromsymlinkpath"
499 495
 	prefix := ""
500 496
 	dfContents := `FROM busybox
... ...
@@ -1079,7 +1064,6 @@ func (s *DockerSuite) TestRunRootWorkdir(c *check.C) {
1079 1079
 
1080 1080
 func (s *DockerSuite) TestRunAllowBindMountingRoot(c *check.C) {
1081 1081
 	if daemonPlatform == "windows" {
1082
-		testRequires(c, WindowsDaemonSupportsVolumes)
1083 1082
 		// Windows busybox will fail with Permission Denied on items such as pagefile.sys
1084 1083
 		dockerCmd(c, "run", "-v", `c:\:c:\host`, WindowsBaseImage, "cmd", "-c", "dir", `c:\host`)
1085 1084
 	} else {
... ...
@@ -1091,7 +1075,6 @@ func (s *DockerSuite) TestRunDisallowBindMountingRootToRoot(c *check.C) {
1091 1091
 	mount := "/:/"
1092 1092
 	targetDir := "/host"
1093 1093
 	if daemonPlatform == "windows" {
1094
-		testRequires(c, WindowsDaemonSupportsVolumes)
1095 1094
 		mount = `c:\:c\`
1096 1095
 		targetDir = "c:/host" // Forward slash as using busybox
1097 1096
 	}
... ...
@@ -1797,9 +1780,7 @@ func (s *DockerSuite) TestRunEntrypoint(c *check.C) {
1797 1797
 
1798 1798
 func (s *DockerSuite) TestRunBindMounts(c *check.C) {
1799 1799
 	testRequires(c, SameHostDaemon)
1800
-	if daemonPlatform == "windows" {
1801
-		testRequires(c, WindowsDaemonSupportsVolumes)
1802
-	} else {
1800
+	if daemonPlatform == "linux" {
1803 1801
 		testRequires(c, DaemonIsLinux, NotUserNamespace)
1804 1802
 	}
1805 1803
 
... ...
@@ -2007,7 +1988,6 @@ func (s *DockerSuite) TestRunMountOrdering(c *check.C) {
2007 2007
 	testRequires(c, SameHostDaemon, DaemonIsLinux, NotUserNamespace)
2008 2008
 	prefix := ""
2009 2009
 	if daemonPlatform == "windows" {
2010
-		testRequires(c, WindowsDaemonSupportsVolumes)
2011 2010
 		prefix = "c:"
2012 2011
 	}
2013 2012
 
... ...
@@ -2056,7 +2036,6 @@ func (s *DockerSuite) TestRunReuseBindVolumeThatIsSymlink(c *check.C) {
2056 2056
 	testRequires(c, SameHostDaemon, DaemonIsLinux, NotUserNamespace)
2057 2057
 	prefix := ""
2058 2058
 	if daemonPlatform == "windows" {
2059
-		testRequires(c, WindowsDaemonSupportsVolumes)
2060 2059
 		prefix = "c:"
2061 2060
 	}
2062 2061
 
... ...
@@ -2144,7 +2123,6 @@ func (s *DockerSuite) TestRunVolumesCleanPaths(c *check.C) {
2144 2144
 	prefix := ""
2145 2145
 	slash := `/`
2146 2146
 	if daemonPlatform == "windows" {
2147
-		testRequires(c, WindowsDaemonSupportsVolumes)
2148 2147
 		prefix = "c:"
2149 2148
 		slash = `\`
2150 2149
 	}
... ...
@@ -2719,7 +2697,6 @@ func (s *DockerSuite) TestRunVolumesFromRestartAfterRemoved(c *check.C) {
2719 2719
 	prefix := ""
2720 2720
 	if daemonPlatform == "windows" {
2721 2721
 		prefix = "c:"
2722
-		testRequires(c, WindowsDaemonSupportsVolumes)
2723 2722
 	}
2724 2723
 	dockerCmd(c, "run", "-d", "--name", "voltest", "-v", prefix+"/foo", "busybox", "sleep", "60")
2725 2724
 	dockerCmd(c, "run", "-d", "--name", "restarter", "--volumes-from", "voltest", "busybox", "sleep", "60")
... ...
@@ -2950,7 +2927,6 @@ func (s *DockerSuite) TestVolumeFromMixedRWOptions(c *check.C) {
2950 2950
 	prefix := ""
2951 2951
 	slash := `/`
2952 2952
 	if daemonPlatform == "windows" {
2953
-		testRequires(c, WindowsDaemonSupportsVolumes)
2954 2953
 		prefix = "c:"
2955 2954
 		slash = `\`
2956 2955
 	}
... ...
@@ -3305,7 +3281,6 @@ func (s *DockerSuite) TestRunNamedVolume(c *check.C) {
3305 3305
 	prefix := ""
3306 3306
 	slash := `/`
3307 3307
 	if daemonPlatform == "windows" {
3308
-		testRequires(c, WindowsDaemonSupportsVolumes)
3309 3308
 		prefix = "c:"
3310 3309
 		slash = `\`
3311 3310
 	}
... ...
@@ -11,9 +11,6 @@ import (
11 11
 )
12 12
 
13 13
 func (s *DockerSuite) TestVolumeCliCreate(c *check.C) {
14
-	if daemonPlatform == "windows" {
15
-		testRequires(c, WindowsDaemonSupportsVolumes)
16
-	}
17 14
 	dockerCmd(c, "volume", "create")
18 15
 
19 16
 	_, err := runCommand(exec.Command(dockerBinary, "volume", "create", "-d", "nosuchdriver"))
... ...
@@ -25,9 +22,6 @@ func (s *DockerSuite) TestVolumeCliCreate(c *check.C) {
25 25
 }
26 26
 
27 27
 func (s *DockerSuite) TestVolumeCliCreateOptionConflict(c *check.C) {
28
-	if daemonPlatform == "windows" {
29
-		testRequires(c, WindowsDaemonSupportsVolumes)
30
-	}
31 28
 	dockerCmd(c, "volume", "create", "--name=test")
32 29
 	out, _, err := dockerCmdWithError("volume", "create", "--name", "test", "--driver", "nosuchdriver")
33 30
 	c.Assert(err, check.NotNil, check.Commentf("volume create exception name already in use with another driver"))
... ...
@@ -40,9 +34,6 @@ func (s *DockerSuite) TestVolumeCliCreateOptionConflict(c *check.C) {
40 40
 }
41 41
 
42 42
 func (s *DockerSuite) TestVolumeCliInspect(c *check.C) {
43
-	if daemonPlatform == "windows" {
44
-		testRequires(c, WindowsDaemonSupportsVolumes)
45
-	}
46 43
 	c.Assert(
47 44
 		exec.Command(dockerBinary, "volume", "inspect", "doesntexist").Run(),
48 45
 		check.Not(check.IsNil),
... ...
@@ -63,7 +54,6 @@ func (s *DockerSuite) TestVolumeCliLs(c *check.C) {
63 63
 	prefix := ""
64 64
 	if daemonPlatform == "windows" {
65 65
 		prefix = "c:"
66
-		testRequires(c, WindowsDaemonSupportsVolumes)
67 66
 	}
68 67
 	out, _ := dockerCmd(c, "volume", "create")
69 68
 	id := strings.TrimSpace(out)
... ...
@@ -84,7 +74,6 @@ func (s *DockerSuite) TestVolumeCliLsFilterDangling(c *check.C) {
84 84
 	prefix := ""
85 85
 	if daemonPlatform == "windows" {
86 86
 		prefix = "c:"
87
-		testRequires(c, WindowsDaemonSupportsVolumes)
88 87
 	}
89 88
 	dockerCmd(c, "volume", "create", "--name", "testnotinuse1")
90 89
 	dockerCmd(c, "volume", "create", "--name", "testisinuse1")
... ...
@@ -121,7 +110,6 @@ func (s *DockerSuite) TestVolumeCliRm(c *check.C) {
121 121
 	prefix := ""
122 122
 	if daemonPlatform == "windows" {
123 123
 		prefix = "c:"
124
-		testRequires(c, WindowsDaemonSupportsVolumes)
125 124
 	}
126 125
 	out, _ := dockerCmd(c, "volume", "create")
127 126
 	id := strings.TrimSpace(out)
... ...
@@ -25,18 +25,6 @@ var (
25 25
 		func() bool { return daemonPlatform == "windows" },
26 26
 		"Test requires a Windows daemon",
27 27
 	}
28
-	WindowsDaemonSupportsVolumes = testRequirement{
29
-		func() bool {
30
-			if daemonPlatform != "windows" {
31
-				return false
32
-			}
33
-			if windowsDaemonKV == 0 {
34
-				panic("windowsDaemonKV is not set")
35
-			}
36
-			return windowsDaemonKV >= 10559
37
-		},
38
-		"Test requires a Windows daemon that supports volumes",
39
-	}
40 28
 	DaemonIsLinux = testRequirement{
41 29
 		func() bool { return daemonPlatform == "linux" },
42 30
 		"Test requires a Linux daemon",