package fs

import "github.com/docker/libcontainer/cgroups/fs"

Utility for testing cgroup operations.

Creates a mock of the cgroup filesystem for the duration of the test.

Index

Variables

var (
	ErrNotSupportStat = errors.New("stats are not supported for subsystem")
	ErrNotValidFormat = errors.New("line is not a valid key value format")
)

Functions

func Apply

func Apply(c *cgroups.Cgroup, pid int) (cgroups.ActiveCgroup, error)

func Freeze

func Freeze(c *cgroups.Cgroup, state cgroups.FreezerState) error

Freeze toggles the container's freezer cgroup depending on the state provided

func GetPids

func GetPids(c *cgroups.Cgroup) ([]int, error)

func GetStats

func GetStats(c *cgroups.Cgroup) (*cgroups.Stats, error)

func NewCgroupTestUtil

func NewCgroupTestUtil(subsystem string, t *testing.T) *cgroupTestUtil

Creates a new test util for the specified subsystem

func NotifyOnOOM

func NotifyOnOOM(c *cgroups.Cgroup) (<-chan struct{}, error)

NotifyOnOOM sends signals on the returned channel when the cgroup reaches its memory limit. The channel is closed when the cgroup is removed.

Source Files

apply_raw.go blkio.go cpu.go cpuacct.go cpuset.go devices.go freezer.go memory.go notify_linux.go perf_event.go stats_test_util.go test_util.go utils.go

Version
v1.1.0
Published
Jun 26, 2014
Platform
linux/amd64
Imports
16 packages
Last checked
5 minutes ago

Tools for package owners.