integration

package
v0.0.0-...-f1c747c Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2017 License: Apache-2.0 Imports: 22 Imported by: 0

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 = 100 * time.Millisecond
)

Functions

func GetTestDB

func GetTestDB(testID string) (*sql.DB, error)

GetTestDB drops and recreates the test database. Returns a database connection to the test database.

func NewRegistryForTests

func NewRegistryForTests(testID string) (extension.Registry, error)

NewRegistryForTests returns an extension.Registry for integration tests. A new database will be recreated, as per GetTestDB.

Types

type LogEnv

type LogEnv struct {
	LogOperation server.LogOperation
	Sequencer    *server.LogOperationManager

	ClientConn *grpc.ClientConn
	DB         *sql.DB
	// PublicKey is the public key that verifies responses from this server.
	PublicKey crypto.PublicKey
	// contains filtered or unexported fields
}

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

func NewLogEnv

func NewLogEnv(ctx context.Context, numSequencers int, testID 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. testID should be unique to each unittest package so as to allow parallel tests.

func NewLogEnvWithRegistry

func NewLogEnvWithRegistry(ctx context.Context, numSequencers int, testID string, 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. testID should be unique to each unittest package so as to allow parallel tests.

func (*LogEnv) Close

func (env *LogEnv) Close()

Close shuts down the server.

func (*LogEnv) CreateLog

func (env *LogEnv) CreateLog() (int64, error)

CreateLog creates a log and signs the first empty tree head.

Jump to

Keyboard shortcuts

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