1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/integration-cli/utils_unix_test.go
Christopher Crone 81f69a5931 Fix Windows build
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2017-09-14 19:27:09 +02:00

19 lines
560 B
Go

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