acceptance

package
v4.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package acceptance provides infrascturctures for acceptance testing networks implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	*sim.TickingComponent

	AgentPorts []sim.Port
	MsgsToSend []sim.Msg
	// contains filtered or unexported fields
}

Agent can send and receive request.

func NewAgent

func NewAgent(
	engine sim.Engine,
	freq sim.Freq,
	name string,
	numPorts int,
	test *Test,
) *Agent

NewAgent creates a new agent.

func (*Agent) Ports

func (a *Agent) Ports() []sim.Port

Ports returns the ports of the agent.

func (*Agent) Tick

func (a *Agent) Tick() bool

Tick tries to receive requests and send requests out.

type Test

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

Test is a test case.

func NewTest

func NewTest() *Test

NewTest creates a new test.

func (*Test) GenerateMsgs

func (t *Test) GenerateMsgs(n uint64)

GenerateMsgs generates n message from a random source port to a random destination port.

func (*Test) MustHaveReceivedAllMsgs

func (t *Test) MustHaveReceivedAllMsgs()

MustHaveReceivedAllMsgs asserts that all the messages sent are received.

func (*Test) RegisterAgent

func (t *Test) RegisterAgent(agent *Agent)

RegisterAgent adds an agent to the Test

func (*Test) ReportBandwidthAchieved

func (t *Test) ReportBandwidthAchieved(now sim.VTimeInSec)

ReportBandwidthAchieved dumps the bandwidth observed by each agents.

Jump to

Keyboard shortcuts

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