framework

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DockerExecutableName is the OS dependent Docker CLI binary name
	DockerExecutableName = "docker"
)

Functions

func CopyFile

func CopyFile(sourceFile string, destinationFile string) error

CopyFile copies a file from a path to a path setting permissions to 0777

func GoldenFile

func GoldenFile(name string) string

GoldenFile golden file specific to platform

func ParseContainerInspect

func ParseContainerInspect(stdout string) (*containers.Container, error)

ParseContainerInspect parses the output of a `docker inspect` command for a container

func SetupExistingCLI

func SetupExistingCLI() (string, func(), error)

SetupExistingCLI copies the existing CLI in a temporary directory so that the new CLI can be configured to use it

Types

type E2eCLI

type E2eCLI struct {
	BinDir    string
	ConfigDir string
}

E2eCLI is used to wrap the CLI for end to end testing

func NewE2eCLI

func NewE2eCLI(t *testing.T, binDir string) *E2eCLI

NewE2eCLI returns a configured TestE2eCLI

func NewParallelE2eCLI

func NewParallelE2eCLI(t *testing.T, binDir string) *E2eCLI

NewParallelE2eCLI returns a configured TestE2eCLI with t.Parallel() set

func (*E2eCLI) NewCmd

func (c *E2eCLI) NewCmd(command string, args ...string) icmd.Cmd

NewCmd creates a cmd object configured with the test environment set

func (*E2eCLI) NewDockerCmd

func (c *E2eCLI) NewDockerCmd(args ...string) icmd.Cmd

NewDockerCmd creates a docker cmd without running it

func (*E2eCLI) RunDockerCmd

func (c *E2eCLI) RunDockerCmd(args ...string) *icmd.Result

RunDockerCmd runs a docker command and returns a result

type TestCLI

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

TestCLI is a helper struct for CLI tests.

func NewTestCLI

func NewTestCLI(t *testing.T) *TestCLI

NewTestCLI returns a CLI testing helper.

func (*TestCLI) Context

func (c *TestCLI) Context() context.Context

Context returns a configured context

func (*TestCLI) GetStdOut

func (c *TestCLI) GetStdOut() string

GetStdOut returns the output of the command

Jump to

Keyboard shortcuts

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