testutils

package
v0.10.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertEmptyState

func AssertEmptyState(t *testing.T, s plan.Resource, r plan.Runner)

Other utilities

func ConnectSSH

func ConnectSSH(t *testing.T, r *FootlooseRunner) *ssh.Client

Types

type FootlooseRunner

type FootlooseRunner struct {
	Name    string
	SSHPort uint16
	Image   string
	// contains filtered or unexported fields
}

func (*FootlooseRunner) Close

func (r *FootlooseRunner) Close()

func (*FootlooseRunner) RunCommand

func (r *FootlooseRunner) RunCommand(ctx context.Context, command string, stdin io.Reader) (string, error)

func (*FootlooseRunner) Start

func (r *FootlooseRunner) Start() error

func (*FootlooseRunner) WrapInTestRunner

func (r *FootlooseRunner) WrapInTestRunner(t *testing.T) *TestRunner

type Operation

type Operation struct {
	Kind   string
	Arg    string
	Output string // for operations that output something on stdouterr, we keep it there.
}

type PortAllocator

type PortAllocator struct {
	Next uint16
	// contains filtered or unexported fields
}

func (*PortAllocator) Allocate

func (pa *PortAllocator) Allocate() uint16

type TestRunner

type TestRunner struct {
	T      *testing.T
	Runner plan.Runner
	// contains filtered or unexported fields
}

func MakeFootlooseTestRunner

func MakeFootlooseTestRunner(t *testing.T, image string, sshPort uint16) (*TestRunner, func())

func (*TestRunner) Operation

func (r *TestRunner) Operation(i int) Operation

func (*TestRunner) Operations

func (r *TestRunner) Operations() []Operation

func (*TestRunner) ResetOperations

func (r *TestRunner) ResetOperations()

func (*TestRunner) RunCommand

func (r *TestRunner) RunCommand(ctx context.Context, cmd string, stdin io.Reader) (stdouterr string, err error)

RunCommand implements plan.Runner.

Jump to

Keyboard shortcuts

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