docker: Index | Files

package daemon

import ""


Package Files

daemon.go daemon_swarm.go

func WaitInspectWithArgs Uses

func WaitInspectWithArgs(dockerBinary, name, expr, expected string, timeout time.Duration, arg ...string) error

WaitInspectWithArgs waits for the specified expression to be equals to the specified expected string in the given time. Deprecated: use cli.WaitCmd instead

type Daemon Uses

type Daemon struct {
    // contains filtered or unexported fields

Daemon represents a Docker daemon for the testing framework.

func New Uses

func New(t testing.TB, dockerBinary string, dockerdBinary string, ops ...daemon.Option) *Daemon

New returns a Daemon instance to be used for testing. This will create a directory such as d123456789 in the folder specified by $DOCKER_INTEGRATION_DAEMON_DEST or $DEST. The daemon will not automatically start.

func (*Daemon) CheckActiveContainerCount Uses

func (d *Daemon) CheckActiveContainerCount(t *testing.T) (interface{}, string)

CheckActiveContainerCount returns the number of active containers FIXME(vdemeester) should re-use ActivateContainers in some way

func (*Daemon) CheckControlAvailable Uses

func (d *Daemon) CheckControlAvailable(c *testing.T) (interface{}, string)

CheckControlAvailable returns the current swarm control available

func (*Daemon) CheckLeader Uses

func (d *Daemon) CheckLeader(c *testing.T) (interface{}, string)

CheckLeader returns whether there is a leader on the swarm or not

func (*Daemon) CheckLocalNodeState Uses

func (d *Daemon) CheckLocalNodeState(c *testing.T) (interface{}, string)

CheckLocalNodeState returns the current swarm node state

func (*Daemon) CheckNodeReadyCount Uses

func (d *Daemon) CheckNodeReadyCount(c *testing.T) (interface{}, string)

CheckNodeReadyCount returns the number of ready node on the swarm

func (*Daemon) CheckPluginImage Uses

func (d *Daemon) CheckPluginImage(plugin string) func(c *testing.T) (interface{}, string)

CheckPluginImage returns the runtime state of the plugin

func (*Daemon) CheckPluginRunning Uses

func (d *Daemon) CheckPluginRunning(plugin string) func(c *testing.T) (interface{}, string)

CheckPluginRunning returns the runtime state of the plugin

func (*Daemon) CheckRunningTaskImages Uses

func (d *Daemon) CheckRunningTaskImages(c *testing.T) (interface{}, string)

CheckRunningTaskImages returns the times each image is running as a task.

func (*Daemon) CheckRunningTaskNetworks Uses

func (d *Daemon) CheckRunningTaskNetworks(c *testing.T) (interface{}, string)

CheckRunningTaskNetworks returns the number of times each network is referenced from a task.

func (*Daemon) CheckServiceRunningTasks Uses

func (d *Daemon) CheckServiceRunningTasks(service string) func(*testing.T) (interface{}, string)

CheckServiceRunningTasks returns the number of running tasks for the specified service

func (*Daemon) CheckServiceTasks Uses

func (d *Daemon) CheckServiceTasks(service string) func(*testing.T) (interface{}, string)

CheckServiceTasks returns the number of tasks for the specified service

func (*Daemon) CheckServiceTasksInState Uses

func (d *Daemon) CheckServiceTasksInState(service string, state swarm.TaskState, message string) func(*testing.T) (interface{}, string)

CheckServiceTasksInState returns the number of tasks with a matching state, and optional message substring.

func (*Daemon) CheckServiceTasksInStateWithError Uses

func (d *Daemon) CheckServiceTasksInStateWithError(service string, state swarm.TaskState, errorMessage string) func(*testing.T) (interface{}, string)

CheckServiceTasksInStateWithError returns the number of tasks with a matching state, and optional message substring.

func (*Daemon) CheckServiceUpdateState Uses

func (d *Daemon) CheckServiceUpdateState(service string) func(*testing.T) (interface{}, string)

CheckServiceUpdateState returns the current update state for the specified service

func (*Daemon) Cmd Uses

func (d *Daemon) Cmd(args ...string) (string, error)

Cmd executes a docker CLI command against this daemon. Example: d.Cmd("version") will run docker -H unix://path/to/unix.sock version

func (*Daemon) CmdRetryOutOfSequence Uses

func (d *Daemon) CmdRetryOutOfSequence(args ...string) (string, error)

CmdRetryOutOfSequence tries the specified command against the current daemon up to 10 times, retrying if it encounters an "update out of sequence" error.

func (*Daemon) Command Uses

func (d *Daemon) Command(args ...string) icmd.Cmd

Command creates a docker CLI command against this daemon, to be executed later. Example: d.Command("version") creates a command to run "docker -H unix://path/to/unix.sock version"

func (*Daemon) GetIDByName Uses

func (d *Daemon) GetIDByName(name string) (string, error)

GetIDByName returns the ID of an object (container, volume, …) given its name

func (*Daemon) InspectField Uses

func (d *Daemon) InspectField(name, filter string) (string, error)

InspectField returns the field filter by 'filter'

func (*Daemon) PrependHostArg Uses

func (d *Daemon) PrependHostArg(args []string) []string

PrependHostArg prepend the specified arguments by the daemon host flags

func (*Daemon) WaitRun Uses

func (d *Daemon) WaitRun(contID string) error

WaitRun waits for a container to be running for 10s

Package daemon imports 13 packages (graph) and is imported by 35 packages. Updated 2020-02-19. Refresh now. Tools for package owners.