environment

package
v0.0.0-...-54f6463 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultDockerBinary is the name of the docker binary
	DefaultDockerBinary = "docker"
)

Variables

This section is empty.

Functions

func DaemonHost

func DaemonHost() string

DaemonHost return the daemon host string for this test execution

Types

type Execution

type Execution struct {
	// contains filtered or unexported fields
}

Execution holds informations about the test execution environment.

func New

func New() (*Execution, error)

New creates a new Execution struct

func (*Execution) Clean

func (e *Execution) Clean(t testingT, dockerBinary string)

Clean the environment, preserving protected objects (images, containers, ...) and removing everything else. It's meant to run after any tests so that they don't depend on each others.

func (*Execution) ContainerStoragePath

func (e *Execution) ContainerStoragePath() string

ContainerStoragePath is the path where the container are stored for the testing daemon

func (*Execution) DaemonKernelVersion

func (e *Execution) DaemonKernelVersion() string

DaemonKernelVersion is the kernel version of the daemon as a string, as returned by an INFO call to the daemon.

func (*Execution) DaemonKernelVersionNumeric

func (e *Execution) DaemonKernelVersionNumeric() int

DaemonKernelVersionNumeric is the kernel version of the daemon as an integer. Mostly useful on Windows where DaemonKernelVersion holds the full string such as `10.0 14393 (14393.447.amd64fre.rs1_release_inmarket.161102-0100)`, but integration tests really only need the `14393` piece to make decisions.

func (*Execution) DaemonPID

func (e *Execution) DaemonPID() int

DaemonPID is the pid of the main test daemon

func (*Execution) DaemonPlatform

func (e *Execution) DaemonPlatform() string

DaemonPlatform is held globally so that tests can make intelligent decisions on how to configure themselves according to the platform of the daemon. This is initialized in docker_utils by sending a version call to the daemon and examining the response header.

func (*Execution) DaemonStorageDriver

func (e *Execution) DaemonStorageDriver() string

DaemonStorageDriver is held globally so that tests can know the storage driver of the daemon. This is initialized in docker_utils by sending a version call to the daemon and examining the response header.

func (*Execution) DockerBasePath

func (e *Execution) DockerBasePath() string

DockerBasePath is the base path of the docker folder (by default it is -/var/run/docker)

func (*Execution) DockerBinary

func (e *Execution) DockerBinary() string

DockerBinary returns the docker binary for this testing environment

func (*Execution) ExperimentalDaemon

func (e *Execution) ExperimentalDaemon() bool

ExperimentalDaemon tell whether the main daemon has experimental features enabled or not

func (*Execution) Isolation

func (e *Execution) Isolation() container.Isolation

Isolation is the isolation mode of the daemon under test

func (*Execution) LocalDaemon

func (e *Execution) LocalDaemon() bool

LocalDaemon is true if the daemon under test is on the same host as the CLI.

func (*Execution) MinimalBaseImage

func (e *Execution) MinimalBaseImage() string

MinimalBaseImage is the image used for minimal builds (it depends on the platform)

func (*Execution) ProtectImage

func (e *Execution) ProtectImage(t testingT, images ...string)

ProtectImage adds the specified image(s) to be protected in case of clean

func (*Execution) VolumesConfigPath

func (e *Execution) VolumesConfigPath() string

VolumesConfigPath is the path of the volume configuration for the testing daemon

Jump to

Keyboard shortcuts

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