migtest

package
v0.12.5-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyMigration

func ApplyMigration(t *testing.T, beforeMigration, afterMigration,
	migrationFunc func(tx *bbolt.Tx) error, shouldFail bool)

ApplyMigration is a helper test function that encapsulates the general steps which are needed to properly check the result of applying migration function.

func DumpDB

func DumpDB(tx *bbolt.Tx, rootKey []byte) error

DumpDB dumps go code describing the contents of the database to stdout. This function is only intended for use during development.

Example output:

map[string]interface{}{
	hex("1234"): map[string]interface{}{
		"human-readable": hex("102030"),
		hex("1111"): hex("5783492373"),
	},
}

func MakeDB

func MakeDB(t *testing.T) *bbolt.DB

MakeDB creates a new instance of the firewall DB for testing purposes.

func RestoreDB

func RestoreDB(tx *bbolt.Tx, rootKey []byte, data map[string]interface{}) error

RestoreDB primes the database with the given data set.

func VerifyDB

func VerifyDB(tx *bbolt.Tx, rootKey []byte, data map[string]interface{}) error

VerifyDB verifies the database against the given data set.

Types

This section is empty.

Jump to

Keyboard shortcuts

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