Package daemon launches dockerd for testing purposes.
SockRoot holds the path of the default docker integration daemon socket
ScanLogsMatchAll returns a function that can be used to scan the daemon logs until *all* the passed in strings are matched
ScanLogsMatchCount returns a function that can be used to scan the daemon logs until the passed in matcher function matches `count` times
ScanLogsMatchString returns a function that can be used to scan the daemon logs for the passed in string (`contains`).
func SignalDaemonDump(pid int)
SignalDaemonDump sends a signal to the daemon to write a dump file
ConfigConstructor defines a swarm config constructor
Daemon represents a Docker daemon for the testing framework
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.
NewDaemon returns a Daemon instance to be used for testing. The daemon will not automatically start. The daemon will modify and create files under workingDir.
ActiveContainers returns the list of ids of the currently running containers
BinaryPath returns the binary and its arguments.
CgroupNamespace returns the cgroup namespace the daemon is running in
Cleanup cleans the daemon files : exec root (network namespaces, ...), swarmkit files
ContainersNamespace returns the containerd namespace used for containers.
CreateConfig creates a config given the specified spec
CreateSecret creates a secret given the specified spec
CreateService creates a swarm service given the specified service constructor
DeleteConfig removes the swarm config identified by the specified id
DeleteSecret removes the swarm secret identified by the specified id
func (*Daemon) DumpStackAndQuit ¶func (d *Daemon) DumpStackAndQuit()
DumpStackAndQuit sends SIGQUIT to the daemon, which triggers it to dump its stack to its log file and exit This is used primarily for gathering debug information on test timeout
FindContainerIP returns the ip of the specified container
FirewallReloadedAt fetches the daemon's Info and, if it contains a firewall reload time, returns that time.
GetConfig returns a swarm config identified by the specified id
GetNode returns a swarm node identified by the specified id
GetSecret returns a swarm secret identified by the specified id
GetService returns the swarm service corresponding to the specified id
GetServiceTasks returns the swarm tasks for the specified service
GetSwarm returns the current swarm object
GetTask returns the swarm task identified by the specified id
ID returns the generated id of the daemon
Info returns the info struct for this daemon
Interrupt stops the daemon by sending it an Interrupt signal
JoinTokens returns the current swarm join tokens
Kill will send a SIGKILL to the daemon
ListConfigs returns the list of the current swarm configs
ListNodes returns the list of the current swarm nodes
ListSecrets returns the list of the current swarm secrets
ListServices returns the list of the current swarm services
LoadBusybox image into the daemon
LogFileName returns the path the daemon's log file
NewClient creates new client based on daemon's socket path
NewClientT creates new client based on daemon's socket path
NodeID returns the swarm mode node ID
Pid returns the pid of the daemon
PluginIsNotPresent provides a poller to check if the specified plugin is not present
PluginIsNotRunning provides a poller to check if the specified plugin is not running
PluginIsRunning provides a poller to check if the specified plugin is running
PluginReferenceIs provides a poller to check if the specified plugin has the specified reference
PollCheckLogs is a poll.Check that checks the daemon logs using the passed in match function.
ReadLogFile returns the content of the daemon log file
ReloadConfig asks the daemon to reload its configuration
RemoveNode removes the specified node
RemoveService removes the specified service
Restart will restart the daemon by first stopping it and the starting it. If an error occurs while starting the daemon, the test will fail.
RestartNode restarts a daemon to be used as a swarm node
RestartWithError will restart the daemon by first stopping it and then starting it.
RootDir returns the root directory of the daemon.
RotateTokens update the swarm to rotate tokens
ScanLogs scans the daemon logs and passes each line to the match function.
ScanLogsT uses `ScanLogs` to match the daemon logs using the passed in match function. If there is an error or the match fails, the test will fail.
SetEnvVar updates the set of extra env variables for the daemon, to take effect on the next start/restart.
Signal sends the specified signal to the daemon if running
Sock returns the socket path of the daemon
Start starts the daemon and return once it is ready to receive requests.
func (*Daemon) StartAndSwarmInit ¶StartAndSwarmInit starts the daemon (with busybox) and init the swarm
func (*Daemon) StartAndSwarmJoin ¶StartAndSwarmJoin starts the daemon (with busybox) and join the specified swarm as worker or manager
StartNode (re)starts the daemon
StartNodeWithBusybox starts daemon to be used as a swarm node, and loads the busybox image
StartWithBusybox will first start the daemon with Daemon.Start() then save the busybox image from the main daemon and load it into this Daemon instance.
StartWithError starts the daemon and return once it is ready to receive requests. It returns an error in case it couldn't start.
StartWithLogFile will start the daemon and attach its streams to a given file.
Stop will send a SIGINT every second and wait for the daemon to stop. If it times out, a SIGKILL is sent. Stop will not delete the daemon directory. If a purged daemon is needed, instantiate a new one with NewDaemon. If an error occurs while starting the daemon, the test will fail.
StopWithError will send a SIGINT every second and wait for the daemon to stop. If it timeouts, a SIGKILL is sent. Stop will not delete the daemon directory. If a purged daemon is needed, instantiate a new one with NewDaemon.
StorageDriver returns the configured storage driver of the daemon
SwarmInfo returns the swarm information of the daemon
SwarmInit initializes a new swarm cluster.
SwarmInitWithError initializes a new swarm cluster and returns an error.
SwarmJoin joins a daemon to an existing cluster.
SwarmLeave forces daemon to leave current cluster.
The passed in testing.TB is only used to validate that the client was successfully created Some tests rely on error checking the result of the actual unlock, so allow the error to be returned.
SwarmListenAddr returns the listen-addr used for the daemon
SwarmUnlock tries to unlock a locked swarm
The passed in testing.TB is only used to validate that the client was successfully created Some tests rely on error checking the result of the actual unlock, so allow the error to be returned.
TailLogs tails N lines from the daemon logs
TailLogsT attempts to tail N lines from the daemon logs. If there is an error the error is only logged, it does not cause an error with the test.
TamperWithContainerConfig modifies the on-disk config of a container.
UpdateConfig updates the swarm config identified by the specified id Currently, only label update is supported.
UpdateNode updates a swarm node with the specified node constructor
UpdateSecret updates the swarm secret identified by the specified id Currently, only label update is supported.
UpdateService updates a swarm service with the specified service constructor
UpdateSwarm updates the current swarm object with the specified spec constructors
LogT is the subset of the testing.TB interface used by the daemon.
NodeConstructor defines a swarm node constructor
Option is used to configure a daemon.
WithContainerdSocket sets the --containerd option on the daemon. Use an empty string to remove the option.
If unset the --containerd option will be used with a default value.
WithDefaultCgroupNamespaceMode sets the default cgroup namespace mode for the daemon
WithDockerdBinary sets the dockerd binary to the specified one
WithEnvVars sets additional environment variables for the daemon
WithEnvironment sets options from testutil/environment.Execution struct
func WithExperimental() Option
WithExperimental sets the daemon in experimental mode
WithInit sets the daemon init
WithOOMScoreAdjust sets OOM score for the daemon
WithResolvConf allows a test to provide content for a resolv.conf file to be used as the basis for resolv.conf in the container, instead of the host's /etc/resolv.conf.
WithRootlessUser sets the daemon to be rootless
WithStorageDriver sets store driver option
WithSwarmDataPathPort sets the swarm datapath port to use for swarm mode
func WithSwarmDefaultAddrPool(defaultAddrPool []string) Option
WithSwarmDefaultAddrPool sets the swarm default address pool to use for swarm mode
func WithSwarmDefaultAddrPoolSubnetSize(subnetSize uint32) Option
WithSwarmDefaultAddrPoolSubnetSize sets the subnet length mask of swarm default address pool to use for swarm mode
WithSwarmIptables enabled/disables iptables for swarm nodes
WithSwarmListenAddr sets the swarm listen addr to use for swarm mode
WithSwarmPort sets the swarm port to use for swarm mode
WithTestLogger causes the daemon to log certain actions to the provided test.
SecretConstructor defines a swarm secret constructor
ServiceConstructor defines a swarm service constructor function
SpecConstructor defines a swarm spec constructor
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4