github.com/walkingsparrow/docker@v1.4.2-0.20151218153551-b708a2249bfa/integration-cli/requirements_unix.go (about) 1 // +build !windows 2 3 package main 4 5 import ( 6 "github.com/docker/docker/pkg/sysinfo" 7 ) 8 9 var ( 10 // SysInfo stores information about which features a kernel supports. 11 SysInfo *sysinfo.SysInfo 12 cpuCfsPeriod = testRequirement{ 13 func() bool { 14 return SysInfo.CPUCfsPeriod 15 }, 16 "Test requires an environment that supports cgroup cfs period.", 17 } 18 cpuCfsQuota = testRequirement{ 19 func() bool { 20 return SysInfo.CPUCfsQuota 21 }, 22 "Test requires an environment that supports cgroup cfs quota.", 23 } 24 cpuShare = testRequirement{ 25 func() bool { 26 return SysInfo.CPUShares 27 }, 28 "Test requires an environment that supports cgroup cpu shares.", 29 } 30 oomControl = testRequirement{ 31 func() bool { 32 return SysInfo.OomKillDisable 33 }, 34 "Test requires Oom control enabled.", 35 } 36 kernelMemorySupport = testRequirement{ 37 func() bool { 38 return SysInfo.KernelMemory 39 }, 40 "Test requires an environment that supports cgroup kernel memory.", 41 } 42 memoryLimitSupport = testRequirement{ 43 func() bool { 44 return SysInfo.MemoryLimit 45 }, 46 "Test requires an environment that supports cgroup memory limit.", 47 } 48 memoryReservationSupport = testRequirement{ 49 func() bool { 50 return SysInfo.MemoryReservation 51 }, 52 "Test requires an environment that supports cgroup memory reservation.", 53 } 54 swapMemorySupport = testRequirement{ 55 func() bool { 56 return SysInfo.SwapLimit 57 }, 58 "Test requires an environment that supports cgroup swap memory limit.", 59 } 60 memorySwappinessSupport = testRequirement{ 61 func() bool { 62 return SysInfo.MemorySwappiness 63 }, 64 "Test requires an environment that supports cgroup memory swappiness.", 65 } 66 blkioWeight = testRequirement{ 67 func() bool { 68 return SysInfo.BlkioWeight 69 }, 70 "Test requires an environment that supports blkio weight.", 71 } 72 cgroupCpuset = testRequirement{ 73 func() bool { 74 return SysInfo.Cpuset 75 }, 76 "Test requires an environment that supports cgroup cpuset.", 77 } 78 seccompEnabled = testRequirement{ 79 func() bool { 80 return supportsSeccomp 81 }, 82 "Test requires that seccomp support be enabled in the daemon.", 83 } 84 ) 85 86 func init() { 87 SysInfo = sysinfo.New(true) 88 }