testhelpers

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2019 License: Apache-2.0 Imports: 27 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 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 AssertJSONEq added in v0.4.0

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

func AssertMatch

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

func AssertNil

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

func AssertSameInstance added in v0.5.0

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

Assert the simplistic pointer (or literal value) equality

func AssertStringContains added in v0.3.0

func AssertStringContains(t *testing.T, str string, expected string)

func AssertUIDGID added in v0.5.0

func AssertUIDGID(t *testing.T, path string, uid, gid int)

func ComputeSHA256ForFile

func ComputeSHA256ForFile(t *testing.T, path string) string

func ComputeSHA256ForPath

func ComputeSHA256ForPath(t *testing.T, path string, uid int, guid int) string

func CreateSingleFileTar

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

func DockerCli

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

func Eventually

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

func HTTPGetE added in v0.5.0

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

func RandomLayer added in v0.2.0

func RandomLayer(t *testing.T, tmpDir string) (path string, sha string, contents []byte)

func RecursiveCopy

func RecursiveCopy(t *testing.T, src, dst string)

func Run

func Run(t *testing.T, cmd *exec.Cmd) string

func RunE

func RunE(cmd *exec.Cmd) (string, error)

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