integration

package
v0.1.2-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2018 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package integration exports a set of unit tests that can be run by impl/integration or any other specific instantiation of KeyTransparency.

Index

Constants

This section is empty.

Variables

View Source
var AllTests = []NamedTestFn{

	{Name: "TestEmptyGetAndUpdate", Fn: TestEmptyGetAndUpdate},
	{Name: "TestListHistory", Fn: TestListHistory},
	{Name: "TestBatchUpdate", Fn: TestBatchUpdate},
	{Name: "TestBatchCreate", Fn: TestBatchCreate},

	{Name: "TestMonitor", Fn: TestMonitor},
}

AllTests contains all the integration tests. Be sure to extend this when additional tests are added. This is done so that tests can be run in different environments in a portable way.

Functions

func TestBatchCreate

func TestBatchCreate(ctx context.Context, env *Env, t *testing.T)

TestBatchCreate verifies that the batch functions are working correctly.

func TestBatchUpdate

func TestBatchUpdate(ctx context.Context, env *Env, t *testing.T)

TestBatchUpdate verifies that the batch functions are working correctly.

func TestEmptyGetAndUpdate

func TestEmptyGetAndUpdate(ctx context.Context, env *Env, t *testing.T)

TestEmptyGetAndUpdate verifies set/get semantics.

func TestListHistory

func TestListHistory(ctx context.Context, env *Env, t *testing.T)

TestListHistory verifies that repeated history values get collapsed properly.

func TestMonitor

func TestMonitor(ctx context.Context, env *Env, t *testing.T)

TestMonitor verifies that the monitor correctly verifies transitions between revisions.

Types

type CallOptions

type CallOptions func(userID string) []grpc.CallOption

CallOptions returns grpc.CallOptions for the requested user.

type Env

type Env struct {
	Client    *client.Client
	Cli       pb.KeyTransparencyClient
	Sequencer spb.KeyTransparencySequencerClient
	Directory *pb.Directory
	Timeout   time.Duration
	CallOpts  CallOptions
}

Env holds a complete testing environment for end-to-end tests.

type NamedTestFn

type NamedTestFn struct {
	Name string
	Fn   func(context.Context, *Env, *testing.T)
}

NamedTestFn is a binding between a readable test name (used for a Go subtest) and a function that performs the test, given a test environment.

Jump to

Keyboard shortcuts

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