package cli

import "github.com/docker/docker/integration-cli/cli"

Index

Functions

func Args

func Args(commandAndArgs ...string) icmd.Cmd

Args build an icmd.Cmd struct from the specified (command and) arguments.

func BuildCmd

func BuildCmd(t testing.TB, name string, cmdOperators ...CmdOperator) *icmd.Result

BuildCmd executes the specified docker build command and expect a success

func Daemon

func Daemon(d *daemon.Daemon) func(*icmd.Cmd) func()

Daemon points to the specified daemon

func Docker

func Docker(cmd icmd.Cmd, cmdOperators ...CmdOperator) *icmd.Result

Docker executes the specified docker command

func DockerCmd

func DockerCmd(t testing.TB, args ...string) *icmd.Result

DockerCmd executes the specified docker command and expect a success

func Format

func Format(format string) func(*icmd.Cmd) func()

Format sets the specified format with --format flag

func InDir

func InDir(path string) func(*icmd.Cmd) func()

InDir sets the folder in which the command should be executed

func InspectCmd

func InspectCmd(t testing.TB, name string, cmdOperators ...CmdOperator) *icmd.Result

InspectCmd executes the specified docker inspect command and expect a success

func SetTestEnvironment

func SetTestEnvironment(env *environment.Execution)

SetTestEnvironment sets a static test environment TODO: decouple this package from environment

func WaitExited

func WaitExited(t testing.TB, name string, timeout time.Duration, cmdOperators ...CmdOperator)

WaitExited will wait for the specified container to state exit, subject to a maximum time limit in seconds supplied by the caller

func WaitRun

func WaitRun(t testing.TB, name string, cmdOperators ...CmdOperator)

WaitRun will wait for the specified container to be running, maximum 5 seconds.

func WithEnvironmentVariables

func WithEnvironmentVariables(envs ...string) func(cmd *icmd.Cmd) func()

WithEnvironmentVariables sets the specified environment variables for the command to run

func WithFlags

func WithFlags(flags ...string) func(*icmd.Cmd) func()

WithFlags sets the specified flags for the command to run

func WithStdin

func WithStdin(stdin io.Reader) func(*icmd.Cmd) func()

WithStdin sets the standard input reader for the command

func WithStdout

func WithStdout(writer io.Writer) func(*icmd.Cmd) func()

WithStdout sets the standard output writer of the command

func WithTimeout

func WithTimeout(timeout time.Duration) func(cmd *icmd.Cmd) func()

WithTimeout sets the timeout for the command to run

Types

type CmdOperator

type CmdOperator func(*icmd.Cmd) func()

CmdOperator defines functions that can modify a command

Source Files

cli.go

Directories

PathSynopsis
integration-cli/cli/build
Version
v25.0.0-beta.2+incompatible
Published
Dec 12, 2023
Platform
js/wasm
Imports
9 packages
Last checked
4 minutes ago

Tools for package owners.