Browse code

Tidy kernel version in tests

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

John Howard authored on 2017/01/04 05:47:25
Showing 2 changed files
... ...
@@ -11,7 +11,6 @@ import (
11 11
 	"github.com/docker/docker/api/types"
12 12
 	"github.com/docker/docker/api/types/container"
13 13
 	"github.com/docker/docker/integration-cli/checker"
14
-	"github.com/docker/docker/integration-cli/environment"
15 14
 	icmd "github.com/docker/docker/pkg/testutil/cmd"
16 15
 	"github.com/go-check/check"
17 16
 )
... ...
@@ -212,10 +211,6 @@ func (s *DockerSuite) TestInspectBindMountPoint(c *check.C) {
212 212
 	prefix, slash := getPrefixAndSlashFromDaemonPlatform()
213 213
 	if daemonPlatform == "windows" {
214 214
 		modifier = ""
215
-		// TODO Windows: Temporary check - remove once TP5 support is dropped
216
-		if environment.WindowsKernelVersion(testEnv.DaemonKernelVersion()) < 14350 {
217
-			c.Skip("Needs later Windows build for RO volumes")
218
-		}
219 215
 		// Linux creates the host directory if it doesn't exist. Windows does not.
220 216
 		os.Mkdir(`c:\data`, os.ModeDir)
221 217
 	}
... ...
@@ -169,16 +169,20 @@ func (e *Execution) MinimalBaseImage() string {
169 169
 	return e.baseImage
170 170
 }
171 171
 
172
-// DaemonKernelVersion is the kernel version of the daemon
172
+// DaemonKernelVersion is the kernel version of the daemon as a string, as returned
173
+// by an INFO call to the daemon.
173 174
 func (e *Execution) DaemonKernelVersion() string {
174 175
 	return e.daemonKernelVersion
175 176
 }
176 177
 
177
-// WindowsKernelVersion is used on Windows to distinguish between different
178
-// versions. This is necessary to enable certain tests based on whether
179
-// the platform supports it. For example, Windows Server 2016 TP3 did
180
-// not support volumes, but TP4 did.
181
-func WindowsKernelVersion(kernelVersion string) int {
182
-	winKV, _ := strconv.Atoi(strings.Split(kernelVersion, " ")[1])
183
-	return winKV
178
+// DaemonKernelVersionNumeric is the kernel version of the daemon as an integer.
179
+// Mostly useful on Windows where DaemonKernelVersion holds the full string such
180
+// as `10.0 14393 (14393.447.amd64fre.rs1_release_inmarket.161102-0100)`, but
181
+// integration tests really only need the `14393` piece to make decisions.
182
+func (e *Execution) DaemonKernelVersionNumeric() int {
183
+	if e.daemonPlatform != "windows" {
184
+		return -1
185
+	}
186
+	v, _ := strconv.Atoi(strings.Split(e.daemonKernelVersion, " ")[1])
187
+	return v
184 188
 }