sys

package
v0.0.0-...-e623927 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2018 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupTestCerts

func SetupTestCerts(dir string) error

SetupTestCerts populates the given test LXD directory with server certificates.

Since generating certificates is CPU intensive, they will be simply symlink'ed from the test/deps/ directory.

FIXME: this function is exported because some tests use it

directly. Eventually we should rework those tests to use NewTestOS
instead.

Types

type InotifyInfo

type InotifyInfo struct {
	Fd int
	sync.RWMutex
	Targets map[string]*InotifyTargetInfo
}

InotifyInfo records the inotify information associated with a given inotify instance

type InotifyTargetInfo

type InotifyTargetInfo struct {
	Mask uint32
	Wd   int
	Path string
}

InotifyTargetInfo records the inotify information associated with a given inotify target

type OS

type OS struct {
	VarDir   string // Data directory (e.g. /var/lib/lxd/).
	CacheDir string // Cache directory (e.g. /var/cache/lxd/).
	LogDir   string // Log directory (e.g. /var/log/lxd).

	// Caches of system characteristics detected at Init() time.
	Architectures           []int           // Cache of detected system architectures
	LxcPath                 string          // Path to the $LXD_DIR/containers directory
	BackingFS               string          // Backing filesystem of $LXD_DIR/containers
	IdmapSet                *idmap.IdmapSet // Information about user/group ID mapping
	ExecPath                string          // Absolute path to the LXD executable
	RunningInUserNS         bool
	AppArmorAvailable       bool
	AppArmorStacking        bool
	AppArmorStacked         bool
	AppArmorAdmin           bool
	AppArmorConfined        bool
	CGroupBlkioController   bool
	CGroupCPUController     bool
	CGroupCPUacctController bool
	CGroupCPUsetController  bool
	CGroupDevicesController bool
	CGroupMemoryController  bool
	CGroupNetPrioController bool
	CGroupPidsController    bool
	CGroupSwapAccounting    bool
	InotifyWatch            InotifyInfo

	MockMode bool // If true some APIs will be mocked (for testing)
}

OS is a high-level facade for accessing all operating-system level functionality that LXD uses.

func DefaultOS

func DefaultOS() *OS

DefaultOS returns a fresh uninitialized OS instance with default values.

func NewTestOS

func NewTestOS(t *testing.T) (*OS, func())

NewTestOS returns a new OS instance initialized with test values.

func (*OS) Init

func (s *OS) Init() error

Init our internal data structures.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL