ifacetestenv

package
v0.0.0-...-c2e30b8 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2021 License: NIST-PD-fallback Imports: 14 Imported by: 0

Documentation

Overview

Package ifacetestenv provides a test fixture for a face type.

The calling test case must initialize the EAL, and create two faces that are connected together. The fixture sends L3 packets on one face, and expects to receive them on the other face.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckLocatorMarshal

func CheckLocatorMarshal(t *testing.T, loc iface.Locator)

CheckLocatorMarshal checks JSON marshaling of the Locator.

Types

type Fixture

type Fixture struct {
	SkipLocatorCheck bool    // don't CheckLocatorMarshal
	PayloadLen       int     // Data payload length
	DataFrames       int     // expected number of LpPackets per Data packet
	TxIterations     int     // number of TX iterations
	TxLossTolerance  float64 // permitted TX packet loss (counter discrepancy)
	RxLossTolerance  float64 // permitted RX packet loss

	NRxInterests int
	NRxData      int
	NRxNacks     int
	// contains filtered or unexported fields
}

Fixture runs a test that sends and receives packets between a pair of connected faces.

func NewFixture

func NewFixture(t *testing.T) (fixture *Fixture)

NewFixture creates a Fixture.

func (*Fixture) CheckCounters

func (fixture *Fixture) CheckCounters()

CheckCounters checks the counters are within acceptable range.

func (*Fixture) Close

func (fixture *Fixture) Close() error

Close releases resources. This automatically closes all faces and clears LCore allocation.

func (*Fixture) RunTest

func (fixture *Fixture) RunTest(txFace, rxFace iface.Face)

RunTest executes the test.

Jump to

Keyboard shortcuts

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