github.com/noxiouz/docker@v0.7.3-0.20160629055221-3d231c78e8c5/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 pidsLimit = testRequirement{ 37 func() bool { 38 return SysInfo.PidsLimit 39 }, 40 "Test requires pids limit enabled.", 41 } 42 kernelMemorySupport = testRequirement{ 43 func() bool { 44 return SysInfo.KernelMemory 45 }, 46 "Test requires an environment that supports cgroup kernel memory.", 47 } 48 memoryLimitSupport = testRequirement{ 49 func() bool { 50 return SysInfo.MemoryLimit 51 }, 52 "Test requires an environment that supports cgroup memory limit.", 53 } 54 memoryReservationSupport = testRequirement{ 55 func() bool { 56 return SysInfo.MemoryReservation 57 }, 58 "Test requires an environment that supports cgroup memory reservation.", 59 } 60 swapMemorySupport = testRequirement{ 61 func() bool { 62 return SysInfo.SwapLimit 63 }, 64 "Test requires an environment that supports cgroup swap memory limit.", 65 } 66 memorySwappinessSupport = testRequirement{ 67 func() bool { 68 return SysInfo.MemorySwappiness 69 }, 70 "Test requires an environment that supports cgroup memory swappiness.", 71 } 72 blkioWeight = testRequirement{ 73 func() bool { 74 return SysInfo.BlkioWeight 75 }, 76 "Test requires an environment that supports blkio weight.", 77 } 78 cgroupCpuset = testRequirement{ 79 func() bool { 80 return SysInfo.Cpuset 81 }, 82 "Test requires an environment that supports cgroup cpuset.", 83 } 84 seccompEnabled = testRequirement{ 85 func() bool { 86 return supportsSeccomp && SysInfo.Seccomp 87 }, 88 "Test requires that seccomp support be enabled in the daemon.", 89 } 90 bridgeNfIptables = testRequirement{ 91 func() bool { 92 return !SysInfo.BridgeNFCallIPTablesDisabled 93 }, 94 "Test requires that bridge-nf-call-iptables support be enabled in the daemon.", 95 } 96 bridgeNfIP6tables = testRequirement{ 97 func() bool { 98 return !SysInfo.BridgeNFCallIP6TablesDisabled 99 }, 100 "Test requires that bridge-nf-call-ip6tables support be enabled in the daemon.", 101 } 102 ) 103 104 func init() { 105 SysInfo = sysinfo.New(true) 106 }