integration

package
v1.3.12 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2021 License: Apache-2.0 Imports: 27 Imported by: 27

Documentation

Overview

Package integration provides test-only code for performing integrated tests of Trillian functionality.

Index

Constants

This section is empty.

Variables

View Source
var (

	// SequencerInterval is the time between runs of the sequencer.
	SequencerInterval = 500 * time.Millisecond
)

Functions

func NewRegistryForTests

func NewRegistryForTests(ctx context.Context) (extension.Registry, func(context.Context), error)

NewRegistryForTests returns an extension.Registry for integration tests. Callers should call the returned cleanup function when they're finished with the registry and its contents.

Types

type LogEnv

type LogEnv struct {
	LogOperation log.Operation
	Sequencer    *log.OperationManager

	ClientConn *grpc.ClientConn // TODO(gbelvin): Deprecate.

	Address string
	Log     trillian.TrillianLogClient
	Admin   trillian.TrillianAdminClient
	DB      *sql.DB
	// contains filtered or unexported fields
}

LogEnv is a test environment that contains both a log server and a connection to it.

func NewLogEnv deprecated

func NewLogEnv(ctx context.Context, numSequencers int, _ string) (*LogEnv, error)

NewLogEnv creates a fresh DB, log server, and client. The numSequencers parameter indicates how many sequencers to run in parallel; if numSequencers is zero a manually-controlled test sequencer is used.

Deprecated: Use NewLogEnvWithGRPCOptions instead

TODO(Martin2112): Remove this constructor, it is only used by tests and can be replaced by one of the others.

func NewLogEnvWithGRPCOptions added in v1.0.5

func NewLogEnvWithGRPCOptions(ctx context.Context, numSequencers int, serverOpts []grpc.ServerOption, clientOpts []grpc.DialOption) (*LogEnv, error)

NewLogEnvWithGRPCOptions creates a fresh DB, log server, and client. The numSequencers parameter indicates how many sequencers to run in parallel; if numSequencers is zero a manually-controlled test sequencer is used. Additional grpc.ServerOption and grpc.DialOption values can be provided.

func NewLogEnvWithRegistry

func NewLogEnvWithRegistry(ctx context.Context, numSequencers int, registry extension.Registry) (*LogEnv, error)

NewLogEnvWithRegistry uses the passed in Registry to create a log server, and client. The numSequencers parameter indicates how many sequencers to run in parallel; if numSequencers is zero a manually-controlled test sequencer is used.

func NewLogEnvWithRegistryAndGRPCOptions added in v1.0.5

func NewLogEnvWithRegistryAndGRPCOptions(ctx context.Context, numSequencers int, registry extension.Registry, serverOpts []grpc.ServerOption, clientOpts []grpc.DialOption) (*LogEnv, error)

NewLogEnvWithRegistryAndGRPCOptions works the same way as NewLogEnv, but allows callers to also set additional grpc.ServerOption and grpc.DialOption values.

func (*LogEnv) Close

func (env *LogEnv) Close()

Close shuts down the server.

type MapEnv

type MapEnv struct {

	// Objects that need Close(), in order of creation.
	DB *sql.DB

	// Trillian API clients.
	Map   trillian.TrillianMapClient
	Write trillian.TrillianMapWriteClient
	Admin trillian.TrillianAdminClient
	// contains filtered or unexported fields
}

MapEnv is a map server and connected client.

func NewMapEnv

func NewMapEnv(ctx context.Context, singleTX bool) (*MapEnv, error)

NewMapEnv creates a fresh DB, map server, and client.

func NewMapEnvFromConn

func NewMapEnvFromConn(addr string) (*MapEnv, error)

NewMapEnvFromConn connects to a map server.

func NewMapEnvWithRegistry

func NewMapEnvWithRegistry(registry extension.Registry, singleTX bool) (*MapEnv, error)

NewMapEnvWithRegistry uses the passed in Registry to create a map server and client. If singleTX is set, the map will attempt to use a single transaction when updating the map data.

func (*MapEnv) Close

func (env *MapEnv) Close()

Close shuts down the server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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