Skip to content

Commit

Permalink
Fix Windows build
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Crone <[email protected]>
  • Loading branch information
chris-crone committed Sep 14, 2017
1 parent 61b13ba commit 81f69a5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
13 changes: 0 additions & 13 deletions integration-cli/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"path/filepath"
"strings"

"github.com/docker/docker/pkg/parsers/kernel"
"github.com/docker/docker/pkg/stringutils"
"github.com/go-check/check"
"github.com/gotestyourself/gotestyourself/icmd"
Expand Down Expand Up @@ -182,15 +181,3 @@ func RemoveOutputForExistingElements(output string, existing []string) string {
res := RemoveLinesForExistingElements(strings.Split(output, "\n"), existing)
return strings.Join(res, "\n")
}

// GetKernelVersion gets the current kernel version.
func GetKernelVersion() *kernel.VersionInfo {
v, _ := kernel.ParseRelease(testEnv.DaemonInfo.KernelVersion)
return v
}

// CheckKernelVersion checks if current kernel is newer than (or equal to)
// the given version.
func CheckKernelVersion(k, major, minor int) bool {
return kernel.CompareKernelVersion(*GetKernelVersion(), kernel.VersionInfo{Kernel: k, Major: major, Minor: minor}) > 0
}
19 changes: 19 additions & 0 deletions integration-cli/utils_unix_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// +build linux freebsd solaris openbsd

package main

import (
"github.com/docker/docker/pkg/parsers/kernel"
)

// GetKernelVersion gets the current kernel version.
func GetKernelVersion() *kernel.VersionInfo {
v, _ := kernel.ParseRelease(testEnv.DaemonInfo.KernelVersion)
return v
}

// CheckKernelVersion checks if current kernel is newer than (or equal to)
// the given version.
func CheckKernelVersion(k, major, minor int) bool {
return kernel.CompareKernelVersion(*GetKernelVersion(), kernel.VersionInfo{Kernel: k, Major: major, Minor: minor}) > 0
}

0 comments on commit 81f69a5

Please sign in to comment.