revcachetest

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TimeOut = 5 * time.Second
)

Functions

func MustParseRevInfo

func MustParseRevInfo(t *testing.T, sr *path_mgmt.SignedRevInfo)

func TestRevCache

func TestRevCache(t *testing.T, revCache TestableRevCache)

TestRevCache should be used to test any implementation of the RevCache interface.

setup should return a RevCache in a clean state, i.e. no entries in the cache. cleanup can be used to release any resources that have been allocated during setup.

Types

type TestableRevCache

type TestableRevCache interface {
	revcache.RevCache
	// InsertExpired should insert the given expired revocation.
	// The testing parameter should be used to fail in case of an error.
	// The method is used to test if expired revocations are not returned.
	InsertExpired(t *testing.T, ctx context.Context, rev *path_mgmt.SignedRevInfo)
	// Prepare should reset the internal state so that the cache is empty and is ready to be tested.
	Prepare(t *testing.T, ctx context.Context)
}

TestableRevCache extends the RevCache interface with methods that are needed for testing.

Jump to

Keyboard shortcuts

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