testutil

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Nerdctl = Target("nerdctl")
	Docker  = Target("docker")
)
View Source
const (
	AlpineImage                 = "alpine:3.13"
	NginxAlpineImage            = "nginx:1.19-alpine"
	NginxAlpineIndexHTMLSnippet = "<title>Welcome to nginx!</title>"
	RegistryImage               = "registry:2"
	FedoraESGZImage             = "ghcr.io/stargz-containers/fedora:30-esgz" // eStargz
)

TODO: do not use Docker Hub nor GCR mirror: https://github.com/containerd/nerdctl/issues/146

View Source
const Namespace = "nerdctl-test"

Variables

This section is empty.

Functions

func DockerIncompatible

func DockerIncompatible(t testing.TB)

func GetDaemonIsKillable

func GetDaemonIsKillable() bool

func GetTarget

func GetTarget() string

func M

func M(m *testing.M)

func RequiresBuild

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

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

func (*Base) EnsureDaemonActive

func (b *Base) EnsureDaemonActive()

func (*Base) Info added in v0.7.3

func (b *Base) Info() dockercompat.Info

func (*Base) InspectContainer

func (b *Base) InspectContainer(name string) dockercompat.Container

func (*Base) KillDaemon

func (b *Base) KillDaemon()

type Cmd

type Cmd struct {
	icmd.Cmd
	*Base
}

func (*Cmd) Assert

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

func (*Cmd) AssertExitCode

func (c *Cmd) AssertExitCode(exitCode int)

func (*Cmd) AssertFail

func (c *Cmd) AssertFail()

func (*Cmd) AssertNoOut

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