Version: v0.3.0 Latest Latest

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

Go to latest
Published: Jul 3, 2020 License: Apache-2.0 Imports: 28 Imported by: 0



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



This section is empty.


View Source
var AllTests = []NamedTestFn{

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

	{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.


func TestBatchCreate

func TestBatchCreate(ctx context.Context, env *Env, t *testing.T) []*tpb.Action

TestBatchCreate verifies that the batch functions are working correctly.

func TestBatchGetUser

func TestBatchGetUser(ctx context.Context, env *Env, t *testing.T) []*tpb.Action

TestBatchGetUser tests fetching multiple users in a single request.

func TestBatchListUserRevisions

func TestBatchListUserRevisions(ctx context.Context, env *Env, t *testing.T) []*tpb.Action

TestBatchListUserRevisions verifies that BatchListUserRevisions() in keyserver works properly.

func TestBatchUpdate

func TestBatchUpdate(ctx context.Context, env *Env, t *testing.T) []*tpb.Action

TestBatchUpdate verifies that the batch functions are working correctly.

func TestEmptyGetAndUpdate

func TestEmptyGetAndUpdate(ctx context.Context, env *Env, t *testing.T) []*tpb.Action

TestEmptyGetAndUpdate verifies set/get semantics.

func TestListHistory

func TestListHistory(ctx context.Context, env *Env, t *testing.T) []*tpb.Action

TestListHistory verifies that repeated history values get collapsed properly.

func TestMonitor

func TestMonitor(ctx context.Context, env *Env, t *testing.T) []*tpb.Action

TestMonitor verifies that the monitor correctly verifies transitions between revisions.


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) []*tpb.Action

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.


Path Synopsis

Jump to

Keyboard shortcuts

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