Browse Source

Fix Windows build

Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Christopher Crone 7 năm trước cách đây
mục cha
commit
81f69a5931
2 tập tin đã thay đổi với 19 bổ sung13 xóa
  1. 0 13
      integration-cli/utils_test.go
  2. 19 0
      integration-cli/utils_unix_test.go

+ 0 - 13
integration-cli/utils_test.go

@@ -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"
@@ -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 - 0
integration-cli/utils_unix_test.go

@@ -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
+}