dockertest

package
v0.14.10 Latest Latest
Warning

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

Go to latest
Published: May 9, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MockCogConfig string = "" /* 193-byte string literal not displayed */
View Source
var MockOpenAPISchema string = "{}"
View Source
var PushError error = nil

Functions

func ImageRef added in v0.14.8

func ImageRef(t *testing.T, label string) string

ImageRef returns an reference based on the unique test name and label. If the label is empty, it will default to "test-" followed by the current unix epoch time.

func ImageRefWithRegistry added in v0.14.8

func ImageRefWithRegistry(t *testing.T, registryAddr string, label string) string

Types

type HelperClient added in v0.14.8

type HelperClient struct {
	Client *client.Client
}

func NewHelperClient added in v0.14.8

func NewHelperClient(t testing.TB) *HelperClient

NewHelperClient returns a Docker client for testing. It skips the test if Docker is not available.

func (*HelperClient) CleanupImage added in v0.14.8

func (c *HelperClient) CleanupImage(t testing.TB, imageRef string)

func (*HelperClient) CleanupImages added in v0.14.8

func (c *HelperClient) CleanupImages(t testing.TB)

func (*HelperClient) Close added in v0.14.8

func (c *HelperClient) Close() error

func (*HelperClient) DeleteImage added in v0.14.8

func (c *HelperClient) DeleteImage(t testing.TB, imageRef string) error

func (*HelperClient) ImageExists added in v0.14.8

func (c *HelperClient) ImageExists(t testing.TB, imageRef string) bool

func (*HelperClient) InspectContainer added in v0.14.8

func (c *HelperClient) InspectContainer(t testing.TB, containerID string) *container.InspectResponse

func (*HelperClient) InspectImage added in v0.14.8

func (c *HelperClient) InspectImage(t testing.TB, imageRef string) *image.InspectResponse

func (*HelperClient) LoadImageFixture added in v0.14.8

func (c *HelperClient) LoadImageFixture(t testing.TB, name string, tag string)

func (*HelperClient) MustDeleteImage added in v0.14.8

func (c *HelperClient) MustDeleteImage(t testing.TB, imageRef string)

func (*HelperClient) MustPullImage added in v0.14.8

func (c *HelperClient) MustPullImage(t testing.TB, ref string)

func (*HelperClient) MustPushImage added in v0.14.8

func (c *HelperClient) MustPushImage(t testing.TB, ref string)

func (*HelperClient) PullImage added in v0.14.8

func (c *HelperClient) PullImage(t testing.TB, ref string) error

func (*HelperClient) PushImage added in v0.14.8

func (c *HelperClient) PushImage(t testing.TB, ref string) error

func (*HelperClient) RunContainer added in v0.14.8

func (c *HelperClient) RunContainer(t testing.TB, imageName string) string

func (*HelperClient) StopContainer added in v0.14.8

func (c *HelperClient) StopContainer(t testing.TB, containerID string)

type MockCommand

type MockCommand struct{}

func NewMockCommand

func NewMockCommand() *MockCommand

func (*MockCommand) ContainerInspect added in v0.14.8

func (c *MockCommand) ContainerInspect(ctx context.Context, id string) (*container.InspectResponse, error)

func (*MockCommand) ContainerLogs added in v0.14.8

func (c *MockCommand) ContainerLogs(ctx context.Context, containerID string, w io.Writer) error

func (*MockCommand) ContainerStop added in v0.14.8

func (c *MockCommand) ContainerStop(ctx context.Context, containerID string) error

func (*MockCommand) CreateAptTarFile

func (c *MockCommand) CreateAptTarFile(ctx context.Context, tmpDir string, aptTarFile string, packages ...string) (string, error)

func (*MockCommand) CreateTarFile

func (c *MockCommand) CreateTarFile(ctx context.Context, image string, tmpDir string, tarFile string, folder string) (string, error)

func (*MockCommand) ImageBuild added in v0.14.9

func (c *MockCommand) ImageBuild(ctx context.Context, options command.ImageBuildOptions) error

func (*MockCommand) ImageExists added in v0.14.8

func (c *MockCommand) ImageExists(ctx context.Context, ref string) (bool, error)

func (*MockCommand) Inspect

func (c *MockCommand) Inspect(ctx context.Context, ref string) (*image.InspectResponse, error)

func (*MockCommand) LoadUserInformation

func (c *MockCommand) LoadUserInformation(ctx context.Context, registryHost string) (*command.UserInfo, error)

func (*MockCommand) Pull

func (c *MockCommand) Pull(ctx context.Context, image string, force bool) (*image.InspectResponse, error)

func (*MockCommand) Push

func (c *MockCommand) Push(ctx context.Context, image string) error

Jump to

Keyboard shortcuts

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