testutil

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Nerdctl = Target("nerdctl")
	Docker  = Target("docker")
)
View Source
const (
	AlpineImage                 = "mirror.gcr.io/library/alpine:3.13"
	NginxAlpineImage            = "mirror.gcr.io/library/nginx:1.19-alpine"
	NginxAlpineIndexHTMLSnippet = "<title>Welcome to nginx!</title>"
	RegistryImage               = "mirror.gcr.io/library/registry:2"
)

use GCR mirror to avoid hitting Docker Hub rate limit

View Source
const Namespace = "nerdctl-test"

Variables

This section is empty.

Functions

func DockerIncompatible added in v0.7.0

func DockerIncompatible(t testing.TB)

func GetDaemonIsKillable added in v0.6.1

func GetDaemonIsKillable() bool

func GetTarget

func GetTarget() string

func M

func M(m *testing.M)

func RequiresBuild added in v0.7.0

func RequiresBuild(t testing.TB)

Types

type Base

type Base struct {
	T                testing.TB
	Target           Target
	DaemonIsKillable bool
	Binary           string
	Args             []string
}

func NewBase

func NewBase(t *testing.T) *Base

func (*Base) Cmd

func (b *Base) Cmd(args ...string) *Cmd

func (*Base) CmdWithHelper added in v0.7.1

func (b *Base) CmdWithHelper(helper []string, args ...string) *Cmd

func (*Base) EnsureDaemonActive added in v0.6.1

func (b *Base) EnsureDaemonActive()

func (*Base) KillDaemon added in v0.6.1

func (b *Base) KillDaemon()

type Cmd

type Cmd struct {
	icmd.Cmd
	*Base
}

func (*Cmd) Assert

func (c *Cmd) Assert(expected icmd.Expected)

func (*Cmd) AssertFail added in v0.6.0

func (c *Cmd) AssertFail()

func (*Cmd) AssertNoOut added in v0.7.1

func (c *Cmd) AssertNoOut(s string)

func (*Cmd) AssertOK

func (c *Cmd) AssertOK()

func (*Cmd) AssertOut

func (c *Cmd) AssertOut(s string)

func (*Cmd) AssertOutWithFunc

func (c *Cmd) AssertOutWithFunc(fn func(stdout string) error)

func (*Cmd) Run

func (c *Cmd) Run() *icmd.Result

type Target

type Target = string

Jump to

Keyboard shortcuts

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