tests

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// OneShot is used for tests that do not support history.
	OneShot = iota
	// Replay should be used for tests that can be replayed:
	// checks are executed in live. In case of success, the timestamps are recorded.
	// Checks are then replayed against the history with the recorded timestamps.
	Replay
)

Variables

This section is empty.

Functions

func RunTest

func RunTest(t *testing.T, test *Test)

RunTest executes a test. It executes the following steps: - create all the captures - execute all the setup commands - checks the created captures are active - checks the topology has settled - execute all the setup functions - create all the packet injections - run all the tests in live mode - execute the cleanup functions and commands - replay the tests against the history with the recorded timestamps

Types

type CheckContext added in v0.13.0

type CheckContext struct {
	*TestContext
	// contains filtered or unexported fields
}

CheckContext describes the context (gremlin prefix, timestamps... )of one check of a test

type CheckFunction added in v0.13.0

type CheckFunction func(c *CheckContext) error

CheckFunction describes a function that actually does a check and returns an error if needed

type Cmd added in v0.20.0

type Cmd struct {
	Cmd   string
	Check bool
}

Cmd describes a command line to execute and whether it result code should be checked

type Test

type Test struct {
	// contains filtered or unexported fields
}

Test describes a test. It contains: - the list of commands and functions to be executed at startup - the list of commands and functions to be executed at cleanup - the list of captures to be created - the list of packet injections to be created - the number of retries - a list of checks

type TestCapture

type TestCapture struct {
	// contains filtered or unexported fields
}

TestCapture describes a capture to be created in tests

type TestContext

type TestContext struct {
	// contains filtered or unexported fields
}

TestContext holds the context (client, captures, injections, timestamp, ...) of a test

type TestInjection added in v0.17.0

type TestInjection struct {
	// contains filtered or unexported fields
}

TestInjection describes a packet injection to be created in tests

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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