testing

package
v0.0.0-...-057eb06 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2019 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckResult

func CheckResult(t *testing.T, result *simulations.StepResult, startedAt, finishedAt time.Time)

func NewAdapter

func NewAdapter(adapterType string, services adapters.Services) (adapter adapters.NodeAdapter, teardown func(), err error)

func SetStores

func SetStores(addrs ...network.Addr) ([]storage.ChunkStore, func(), error)

func Trigger

func Trigger(d time.Duration, quitC chan struct{}, ids ...discover.NodeID) chan discover.NodeID

func WatchDisconnections

func WatchDisconnections(id discover.NodeID, client *rpc.Client, errc chan error, quitC chan struct{}) (doneC <-chan struct{}, err error)

WatchDisconnections subscribes to admin peerEvents and sends peer event drop errors to the errc channel. Channel quitC signals the termination of the event loop. Returned doneC will be closed after the rpc subscription is unsubscribed, signaling that simulations network is safe to shutdown.

Types

type RunConfig

type RunConfig struct {
	Adapter         string
	Step            *simulations.Step
	NodeCount       int
	ConnLevel       int
	ToAddr          func(discover.NodeID) *network.BzzAddr
	Services        adapters.Services
	DefaultService  string
	EnableMsgEvents bool
}

type Simulation

type Simulation struct {
	Net    *simulations.Network
	Stores []storage.ChunkStore
	Addrs  []network.Addr
	IDs    []discover.NodeID
}

func NewSimulation

func NewSimulation(conf *RunConfig) (*Simulation, func(), error)

func (*Simulation) CallClient

func (sim *Simulation) CallClient(id discover.NodeID, f func(*rpc.Client) error) error

func (*Simulation) Run

Jump to

Keyboard shortcuts

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