testhelpers

package
v0.0.0-...-9ad9206 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertContains

func AssertContains(t *testing.T, slice []string, elements ...string)

func AssertDoesNotContain

func AssertDoesNotContain(t *testing.T, slice []string, elements ...string)

func AssertEq

func AssertEq(t *testing.T, actual, expected interface{})

Assert deep equality (and provide useful difference as a test failure)

func AssertError

func AssertError(t *testing.T, actual error, expected string)

func AssertMatch

func AssertMatch(t *testing.T, actual string, expected *regexp.Regexp)

func AssertNil

func AssertNil(t *testing.T, actual interface{})

func AssertNotEq

func AssertNotEq(t *testing.T, v1, v2 interface{})

func CopySingleFileFromContainer

func CopySingleFileFromContainer(dockerCli *dockercli.Client, ctrID, path string) (string, error)

func CopySingleFileFromImage

func CopySingleFileFromImage(dockerCli *dockercli.Client, repoName, path string) (string, error)

func CreateImageOnLocal

func CreateImageOnLocal(t *testing.T, dockerCli *dockercli.Client, repoName, dockerFile string, labels map[string]string)

func CreateImageOnRemote

func CreateImageOnRemote(t *testing.T, dockerCli *dockercli.Client, repoName, dockerFile string, labels map[string]string) string

func CreateSingleFileTar

func CreateSingleFileTar(path, txt string) (io.Reader, error)

func DockerCli

func DockerCli(t *testing.T) *dockercli.Client

func DockerRmi

func DockerRmi(dockerCli *dockercli.Client, repoNames ...string) error

func Eventually

func Eventually(t *testing.T, test func() bool, every time.Duration, timeout time.Duration)

func HttpGetE

func HttpGetE(url string) (string, error)

func ImageID

func ImageID(t *testing.T, repoName string) string

func PullImage

func PullImage(dockerCli *dockercli.Client, ref string) error

func RandString

func RandString(n int) string

Types

type DockerRegistry

type DockerRegistry struct {
	Port string
	Name string
}

func NewDockerRegistry

func NewDockerRegistry() *DockerRegistry

func (*DockerRegistry) Start

func (registry *DockerRegistry) Start(t *testing.T)

func (*DockerRegistry) Stop

func (registry *DockerRegistry) Stop(t *testing.T)

Jump to

Keyboard shortcuts

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