testutils

package
v0.0.0-...-be68371 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2017 License: Apache-2.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockDispatcher

type MockDispatcher struct {
	Addr string
	// contains filtered or unexported fields
}

MockDispatcher is a fake dispatcher that one agent at a time can connect to

func NewMockDispatcher

func NewMockDispatcher(t *testing.T, secConfig *ca.SecurityConfig) (*MockDispatcher, func())

NewMockDispatcher starts and returns a mock dispatcher instance that can be connected to

func (*MockDispatcher) Assignments

Assignments keeps an open stream until canceled

func (*MockDispatcher) GetSessions

func (m *MockDispatcher) GetSessions() (*api.SessionRequest, []*api.SessionRequest)

GetSessions return all the established and closed sessions

func (*MockDispatcher) Heartbeat

Heartbeat always successfully heartbeats

func (*MockDispatcher) Session

Session allows a session to be established, and sends the node info

func (*MockDispatcher) SessionMessageChannel

func (m *MockDispatcher) SessionMessageChannel() chan<- *api.SessionMessage

SessionMessageChannel returns a writable channel to inject session messages

func (*MockDispatcher) Tasks

Tasks keeps an open stream until canceled

func (*MockDispatcher) UpdateTaskStatus

UpdateTaskStatus is not implemented

type TestController

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

TestController is dummy channel based controller for tests.

func (*TestController) Close

func (t *TestController) Close() error

Close does nothing.

func (*TestController) Prepare

func (t *TestController) Prepare(ctx context.Context) error

Prepare does nothing.

func (*TestController) Remove

func (t *TestController) Remove(ctx context.Context) error

Remove does nothing.

func (*TestController) Shutdown

func (t *TestController) Shutdown(ctx context.Context) error

Shutdown closes internal channel

func (*TestController) Start

func (t *TestController) Start(ctx context.Context) error

Start does nothing.

func (*TestController) Terminate

func (t *TestController) Terminate(ctx context.Context) error

Terminate closes internal channel if it wasn't closed before.

func (*TestController) Update

func (t *TestController) Update(ctx context.Context, task *api.Task) error

Update does nothing.

func (*TestController) Wait

func (t *TestController) Wait(ctx context.Context) error

Wait waits on internal channel.

type TestExecutor

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

TestExecutor is executor for integration tests

func (*TestExecutor) Configure

func (e *TestExecutor) Configure(ctx context.Context, node *api.Node) error

Configure does nothing.

func (*TestExecutor) Controller

func (e *TestExecutor) Controller(t *api.Task) (exec.Controller, error)

Controller returns TestController.

func (*TestExecutor) Describe

func (e *TestExecutor) Describe(ctx context.Context) (*api.NodeDescription, error)

Describe just returns empty NodeDescription.

func (*TestExecutor) SetNetworkBootstrapKeys

func (e *TestExecutor) SetNetworkBootstrapKeys([]*api.EncryptionKey) error

SetNetworkBootstrapKeys does nothing.

func (*TestExecutor) UpdateNodeDescription

func (e *TestExecutor) UpdateNodeDescription(newDesc *api.NodeDescription)

UpdateNodeDescription sets the node description on the test executor

Jump to

Keyboard shortcuts

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