testing

package
v0.0.0-...-e6674d3 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package testing aims to provide simple "helper" methods to ease the use of docker in (integration) tests using the testing built-in package.

It does support a subset of options compared to actual client api, as it is more focused on needs for integration tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Project

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

Project holds docker related project attributes, like docker client, labels to put on the containers, and so on.

func NewProject

func NewProject(client client.APIClient) *Project

NewProject creates a project with the given client and the default attributes.

func NewProjectFromEnv

func NewProjectFromEnv(t *testing.T) *Project

NewProjectFromEnv creates a project with a client that is build from environment variables.

func (*Project) Clean

func (p *Project) Clean(t *testing.T, keep bool)

Clean stops and removes (by default, controllable with the keep) kermit containers

func (*Project) Create

func (p *Project) Create(t *testing.T, image string) types.ContainerJSON

Create lets you create a container with the specified image, and default configuration.

func (*Project) CreateWithConfig

func (p *Project) CreateWithConfig(t *testing.T, image string, containerConfig docker.ContainerConfig) types.ContainerJSON

CreateWithConfig lets you create a container with the specified image, and some custom simple configuration.

func (*Project) Inspect

func (p *Project) Inspect(t *testing.T, containerID string) types.ContainerJSON

Inspect returns the container informations

func (*Project) IsPaused

func (p *Project) IsPaused(t *testing.T, containerID string) bool

IsPaused checks if the container is running or not

func (*Project) IsRunning

func (p *Project) IsRunning(t *testing.T, containerID string) bool

IsRunning checks if the container is running or not

func (*Project) IsStopped

func (p *Project) IsStopped(t *testing.T, containerID string) bool

IsStopped checks if the container is running or not

func (*Project) List

func (p *Project) List(t *testing.T) []types.Container

List lists the containers managed by kermit

func (*Project) Pull

func (p *Project) Pull(t *testing.T, ref string)

Pull pulls the given reference (image)

func (*Project) Remove

func (p *Project) Remove(t *testing.T, containerID string)

Remove removes the container

func (*Project) Start

func (p *Project) Start(t *testing.T, image string) types.ContainerJSON

Start lets you create and start a container with the specified image, and default configuration.

func (*Project) StartWithConfig

func (p *Project) StartWithConfig(t *testing.T, image string, containerConfig docker.ContainerConfig) types.ContainerJSON

StartWithConfig lets you create and start a container with the specified image, and some custom simple configuration.

func (*Project) Stop

func (p *Project) Stop(t *testing.T, containerID string)

Stop stops the container with a default timeout.

func (*Project) StopWithTimeout

func (p *Project) StopWithTimeout(t *testing.T, containerID string, timeout int)

StopWithTimeout stops the container with the specified timeout.

Jump to

Keyboard shortcuts

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