mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #29861 from Microsoft/jjh/tidywinkv
Tidy kernel version in tests
This commit is contained in:
commit
03c17ab66a
2 changed files with 12 additions and 13 deletions
|
@ -11,7 +11,6 @@ import (
|
||||||
"github.com/docker/docker/api/types"
|
"github.com/docker/docker/api/types"
|
||||||
"github.com/docker/docker/api/types/container"
|
"github.com/docker/docker/api/types/container"
|
||||||
"github.com/docker/docker/integration-cli/checker"
|
"github.com/docker/docker/integration-cli/checker"
|
||||||
"github.com/docker/docker/integration-cli/environment"
|
|
||||||
icmd "github.com/docker/docker/pkg/testutil/cmd"
|
icmd "github.com/docker/docker/pkg/testutil/cmd"
|
||||||
"github.com/go-check/check"
|
"github.com/go-check/check"
|
||||||
)
|
)
|
||||||
|
@ -212,10 +211,6 @@ func (s *DockerSuite) TestInspectBindMountPoint(c *check.C) {
|
||||||
prefix, slash := getPrefixAndSlashFromDaemonPlatform()
|
prefix, slash := getPrefixAndSlashFromDaemonPlatform()
|
||||||
if daemonPlatform == "windows" {
|
if daemonPlatform == "windows" {
|
||||||
modifier = ""
|
modifier = ""
|
||||||
// TODO Windows: Temporary check - remove once TP5 support is dropped
|
|
||||||
if environment.WindowsKernelVersion(testEnv.DaemonKernelVersion()) < 14350 {
|
|
||||||
c.Skip("Needs later Windows build for RO volumes")
|
|
||||||
}
|
|
||||||
// Linux creates the host directory if it doesn't exist. Windows does not.
|
// Linux creates the host directory if it doesn't exist. Windows does not.
|
||||||
os.Mkdir(`c:\data`, os.ModeDir)
|
os.Mkdir(`c:\data`, os.ModeDir)
|
||||||
}
|
}
|
||||||
|
|
|
@ -169,16 +169,20 @@ func (e *Execution) MinimalBaseImage() string {
|
||||||
return e.baseImage
|
return e.baseImage
|
||||||
}
|
}
|
||||||
|
|
||||||
// DaemonKernelVersion is the kernel version of the daemon
|
// DaemonKernelVersion is the kernel version of the daemon as a string, as returned
|
||||||
|
// by an INFO call to the daemon.
|
||||||
func (e *Execution) DaemonKernelVersion() string {
|
func (e *Execution) DaemonKernelVersion() string {
|
||||||
return e.daemonKernelVersion
|
return e.daemonKernelVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
// WindowsKernelVersion is used on Windows to distinguish between different
|
// DaemonKernelVersionNumeric is the kernel version of the daemon as an integer.
|
||||||
// versions. This is necessary to enable certain tests based on whether
|
// Mostly useful on Windows where DaemonKernelVersion holds the full string such
|
||||||
// the platform supports it. For example, Windows Server 2016 TP3 did
|
// as `10.0 14393 (14393.447.amd64fre.rs1_release_inmarket.161102-0100)`, but
|
||||||
// not support volumes, but TP4 did.
|
// integration tests really only need the `14393` piece to make decisions.
|
||||||
func WindowsKernelVersion(kernelVersion string) int {
|
func (e *Execution) DaemonKernelVersionNumeric() int {
|
||||||
winKV, _ := strconv.Atoi(strings.Split(kernelVersion, " ")[1])
|
if e.daemonPlatform != "windows" {
|
||||||
return winKV
|
return -1
|
||||||
|
}
|
||||||
|
v, _ := strconv.Atoi(strings.Split(e.daemonKernelVersion, " ")[1])
|
||||||
|
return v
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue