mirror of
https://github.com/clearlinux/docker.git
synced 2026-10-04 15:58:39 +00:00
Do not require cgroups capabilities on windows to run the integration tests.
Signed-off-by: David Calavera <david.calavera@gmail.com>
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
// +build !windows
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"path"
|
||||
|
||||
"github.com/docker/libcontainer/cgroups"
|
||||
)
|
||||
|
||||
var (
|
||||
CpuCfsPeriod = TestRequirement{
|
||||
func() bool {
|
||||
cgroupCpuMountpoint, err := cgroups.FindCgroupMountpoint("cpu")
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
if _, err := ioutil.ReadFile(path.Join(cgroupCpuMountpoint, "cpu.cfs_period_us")); err != nil {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
"Test requires an environment that supports cgroup cfs period.",
|
||||
}
|
||||
CpuCfsQuota = TestRequirement{
|
||||
func() bool {
|
||||
cgroupCpuMountpoint, err := cgroups.FindCgroupMountpoint("cpu")
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
if _, err := ioutil.ReadFile(path.Join(cgroupCpuMountpoint, "cpu.cfs_quota_us")); err != nil {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
"Test requires an environment that supports cgroup cfs quota.",
|
||||
}
|
||||
)
|
||||
Reference in New Issue
Block a user