testutils

package
v1.25.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2017 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckTcp4Port

func CheckTcp4Port(port int) (bool, error)

func GetDefaultGWv4

func GetDefaultGWv4() (string, error)

func GetDefaultGWv6

func GetDefaultGWv6() (string, error)

func GetGW

func GetGW(iface string, family int) (string, error)

func GetGWv4

func GetGWv4(iface string) (string, error)

func GetGWv6

func GetGWv6(iface string) (string, error)

func GetIPs

func GetIPs(ifaceWanted string, familyWanted int) ([]string, error)

func GetIPsv4

func GetIPsv4(iface string) ([]string, error)

func GetIPsv6

func GetIPsv6(iface string) ([]string, error)

func GetIfaceCount added in v0.10.0

func GetIfaceCount() (int, error)

func GetNextFreePort4

func GetNextFreePort4() (int, error)

func GetNextFreePort4Banned added in v1.0.0

func GetNextFreePort4Banned(bannedPorts map[int]struct{}) (int, error)

func GetNonLoIfaceIPv4

func GetNonLoIfaceIPv4() (string, error)

func GetNonLoIfaceWithAddrs

func GetNonLoIfaceWithAddrs(ipFamily int) (iface net.Interface, addrs []string, err error)

func GetUnprivilegedUidGid added in v1.24.0

func GetUnprivilegedUidGid() (int, int)

func GetValueFromEnvOrPanic added in v0.11.0

func GetValueFromEnvOrPanic(envVar string) string

func HTTPGet added in v0.16.0

func HTTPGet(addr string) (string, error)

func HTTPServe added in v0.16.0

func HTTPServe(addr string, timeout int) error

func WaitOrTimeout added in v1.3.0

func WaitOrTimeout(t *testing.T, timeout time.Duration, notify chan struct{})

Types

type GoroutineAssistant

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

func NewGoroutineAssistant

func NewGoroutineAssistant(t *testing.T) *GoroutineAssistant

func (*GoroutineAssistant) Add

func (a *GoroutineAssistant) Add(n int)

func (*GoroutineAssistant) Done

func (a *GoroutineAssistant) Done()

func (*GoroutineAssistant) Fatalf

func (a *GoroutineAssistant) Fatalf(s string, args ...interface{})

func (*GoroutineAssistant) SpawnOrFail added in v0.10.0

func (a *GoroutineAssistant) SpawnOrFail(cmd string) *gexpect.ExpectSubprocess

func (*GoroutineAssistant) Wait

func (a *GoroutineAssistant) Wait()

func (*GoroutineAssistant) WaitOrFail added in v0.10.0

func (a *GoroutineAssistant) WaitOrFail(child *gexpect.ExpectSubprocess)

type RktRunCtx added in v0.11.0

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

func NewRktRunCtx added in v0.11.0

func NewRktRunCtx() *RktRunCtx

func (*RktRunCtx) Cleanup added in v0.11.0

func (ctx *RktRunCtx) Cleanup()

func (*RktRunCtx) Cmd added in v0.11.0

func (ctx *RktRunCtx) Cmd() string

func (*RktRunCtx) CmdNoConfig added in v0.11.0

func (ctx *RktRunCtx) CmdNoConfig() string

TODO(jonboulle): clean this up

func (*RktRunCtx) DataDir added in v0.11.0

func (ctx *RktRunCtx) DataDir() string

func (*RktRunCtx) ExecCmd added in v1.23.0

func (ctx *RktRunCtx) ExecCmd(arg ...string) *exec.Cmd

func (*RktRunCtx) GetUidGidRktBinOwnerNotRoot added in v1.24.0

func (ctx *RktRunCtx) GetUidGidRktBinOwnerNotRoot() (int, int)

func (*RktRunCtx) LaunchMDS added in v0.11.0

func (ctx *RktRunCtx) LaunchMDS() error

func (*RktRunCtx) LocalDir added in v0.11.0

func (ctx *RktRunCtx) LocalDir() string

func (*RktRunCtx) RegisterChild added in v0.11.0

func (ctx *RktRunCtx) RegisterChild(child *gexpect.ExpectSubprocess)

func (*RktRunCtx) Reset added in v0.11.0

func (ctx *RktRunCtx) Reset()

func (*RktRunCtx) RunGC added in v0.11.0

func (ctx *RktRunCtx) RunGC()

func (*RktRunCtx) SetupDataDir added in v1.0.0

func (ctx *RktRunCtx) SetupDataDir() error

func (*RktRunCtx) SystemDir added in v0.11.0

func (ctx *RktRunCtx) SystemDir() string

func (*RktRunCtx) UserDir added in v1.7.0

func (ctx *RktRunCtx) UserDir() string

type Test added in v1.5.0

type Test interface {
	Execute(*testing.T)
}

Test is the interface that wraps a test. It is meant to be used for parametrized test fixtures.

Execute executes the test.

type TestFunc added in v1.5.0

type TestFunc func(*testing.T)

TestFunc is a functional adapter to allow ordinary functions as test wrappers.

func (TestFunc) Execute added in v1.5.0

func (f TestFunc) Execute(t *testing.T)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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