testutils

package
v0.0.0-...-e1345f7 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2015 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTarget

func AddTarget(role string, r *tuf.Repo) (name string, meta data.FileMeta, content []byte, err error)

AddTarget generates a fake target and adds it to a repo.

func EmptyRepo

func EmptyRepo() (*keys.KeyDB, *tuf.Repo, signed.CryptoService)

EmptyRepo creates an in memory key database, crypto service and initializes a repo with no targets or delegations.

func FlushDB

func FlushDB(db *sql.DB)

FlushDB deletes a sqliteDB

func GetSqliteDB

func GetSqliteDB() *sql.DB

GetSqliteDB creates and initializes a sqlite db

func RandomByteSlice

func RandomByteSlice(maxSize int) []byte

RandomByteSlice generates some random data to be used for testing only

func SampleMeta

func SampleMeta() data.FileMeta

SampleMeta returns a static, fake (and invalid) FileMeta object

func Serialize

func Serialize(sRoot, sTargets, sSnapshot, sTimestamp *data.Signed) (root, targets, snapshot, timestamp []byte, err error)

Serialize takes the Signed objects for the 4 top level roles and serializes them all to JSON

func Sign

func Sign(repo *tuf.Repo) (root, targets, snapshot, timestamp *data.Signed, err error)

Sign signs all top level roles in a repo in the appropriate order

Types

This section is empty.

Jump to

Keyboard shortcuts

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