maptest

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllTests = TestTable{
	{"MapRevisionZero", RunMapRevisionZero},
	{"MapRevisionInvalid", RunMapRevisionInvalid},
	{"LeafHistory", RunLeafHistory},
	{"Inclusion", RunInclusion},
	{"InclusionBatch", RunInclusionBatch},
}

AllTests is the TestTable containing all the trillian Map 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 RunInclusion

func RunInclusion(ctx context.Context, t *testing.T, tadmin trillian.TrillianAdminClient, tmap trillian.TrillianMapClient)

RunInclusion performs checks on Trillian Map inclusion proofs after setting and getting leafs, for a variety of hash strategies.

func RunInclusionBatch

func RunInclusionBatch(ctx context.Context, t *testing.T, tadmin trillian.TrillianAdminClient, tmap trillian.TrillianMapClient)

RunInclusionBatch performs checks on Trillian Map inclusion proofs, after setting and getting leafs in larger batches, checking also the SignedMapRoot revisions along the way, for a variety of hash strategies.

func RunLeafHistory

func RunLeafHistory(ctx context.Context, t *testing.T, tadmin trillian.TrillianAdminClient, tmap trillian.TrillianMapClient)

RunLeafHistory performs checks on Trillian Map leaf updates under a variety of Hash Strategies.

func RunMapRevisionInvalid added in v1.0.5

func RunMapRevisionInvalid(ctx context.Context, t *testing.T, tadmin trillian.TrillianAdminClient, tmap trillian.TrillianMapClient)

RunMapRevisionInvalid performs checks on Map APIs where revision takes illegal values.

func RunMapRevisionZero

func RunMapRevisionZero(ctx context.Context, t *testing.T, tadmin trillian.TrillianAdminClient, tmap trillian.TrillianMapClient)

RunMapRevisionZero performs checks on Trillian Map behavior for new, empty maps.

Types

type NamedTestFn

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

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

type TestTable

type TestTable []NamedTestFn

TestTable is a collection of NamedTestFns.

Jump to

Keyboard shortcuts

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