vdetesting

package module
v0.0.0-...-16c23b1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2015 License: GPL-2.0 Imports: 15 Imported by: 0

README

Vde Testing

A testing Api for the vde framework, this is still in beta and need lots of infastructural changes

Documentation

https://godoc.org/github.com/kurojishi/vdetesting

#Related Project VDE VDE3

Documentation

Overview

Package vdetesting provides the framework for testing

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BandwidthTest

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

BandwidthTest is a Test that check the bandwidth of a connection

func NewBandwidthTest

func NewBandwidthTest(kind string, iface string, address string, port int, pid int) (*BandwidthTest, error)

NewBandwidthTest Return a new BandwidthTest

func (*BandwidthTest) AddStat

func (t *BandwidthTest) AddStat(stat Stat)

AddStat Add a new Statistic

func (*BandwidthTest) Address

func (t *BandwidthTest) Address() net.Addr

Address return the IP address of the test

func (*BandwidthTest) IFace

func (t *BandwidthTest) IFace() *net.Interface

IFace Return the Interface

func (*BandwidthTest) Name

func (t *BandwidthTest) Name() string

Name return the name of this test

func (*BandwidthTest) Port

func (t *BandwidthTest) Port() Port

Port return the port this test will be performed on

func (*BandwidthTest) StartClient

func (t *BandwidthTest) StartClient()

StartClient start the TestClient side of this Test

func (*BandwidthTest) StartServer

func (t *BandwidthTest) StartServer()

StartServer start the server side of Bandwidthtest

type LatencyTest

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

LatencyTest is a server side only Test that use ping to test latency

func NewLatencyTest

func NewLatencyTest(iface string, address string) (*LatencyTest, error)

NewLatencyTest Return a new LatencyTest

func (*LatencyTest) Address

func (t *LatencyTest) Address() net.Addr

Address return the IP address of the test

func (*LatencyTest) IFace

func (t *LatencyTest) IFace() *net.Interface

IFace Return the Interface

func (*LatencyTest) Name

func (t *LatencyTest) Name() string

Name return the name of this test

func (*LatencyTest) StartServer

func (t *LatencyTest) StartServer()

StartServer use ping to control latency

type Port

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

Port is a Network Port that Contains the port number and the methods to use them

func (*Port) Int

func (p *Port) Int() int

Int return the Integer for the Port

func (*Port) NextPort

func (p *Port) NextPort(i int) Port

NextPort return you the next port in order

func (*Port) String

func (p *Port) String() string

type ProfilingStat

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

ProfilingStat implement Stat And it's used to fetch profiling data from /proc

func NewProfilingStat

func NewProfilingStat(pid int, logfile string) ProfilingStat

NewProfilingStat create new stat for profiling a process using /proc

func (*ProfilingStat) SetWaitGroup

func (stat *ProfilingStat) SetWaitGroup(wg *sync.WaitGroup) error

SetWaitGroup add a wait group to the Stat a wait group is used by the stat manager to correctly close and sync all the stats before returing control to the test return error if there is already a waitgroup setup

func (*ProfilingStat) Start

func (stat *ProfilingStat) Start()

Start start ProfilingStat

func (*ProfilingStat) Stop

func (stat *ProfilingStat) Stop()

Stop send the signal to to the goroutine to stop

type Stat

type Stat interface {
	Start()
	Stop()
	SetWaitGroup(wg *sync.WaitGroup) error
}

Stat let you gather statistic regarding any kind of test

type StatManager

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

StatManager is a struct that should be added to everytest it manage all the Stats inside them

func NewStatManager

func NewStatManager() StatManager

NewStatManager Create a NewStatManager, should be used inside tests

func (*StatManager) Add

func (manager *StatManager) Add(s Stat) error

Add new statistic fetcher to the manager

func (*StatManager) Start

func (manager *StatManager) Start() error

Start start all the statistics

func (*StatManager) Stop

func (manager *StatManager) Stop() error

Stop stop all the statistics and wait for them to finish

type StressTest

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

StressTest is used for profiling and it's main use is to check how vde works under heavy loads

func NewStressTest

func NewStressTest(kind string, iface string, address string, port int, pid int) (*StressTest, error)

NewStressTest Return a new StressTest

func (*StressTest) AddStat

func (t *StressTest) AddStat(stat Stat)

AddStat Add a new Statistic

func (*StressTest) Address

func (t *StressTest) Address() net.Addr

Address return the IP address of the test

func (*StressTest) IFace

func (t *StressTest) IFace() *net.Interface

IFace Return the Interface

func (*StressTest) Name

func (t *StressTest) Name() string

Name return the name of this test

func (*StressTest) Port

func (t *StressTest) Port() Port

Port return the port this test will be performed on

func (*StressTest) StartClient

func (t *StressTest) StartClient()

StartClient is a composition of sendData

func (*StressTest) StartServer

func (t *StressTest) StartServer()

StartServer lauch a test to see what the vde_switch will do on very intensive traffic

type TCPStat

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

TCPStat is a stat implementation for getting tcp statistic

func NewTCPStat

func NewTCPStat(iface *net.Interface, port Port, logfile string) TCPStat

NewTCPStat create new tcp stat

func (*TCPStat) SetWaitGroup

func (s *TCPStat) SetWaitGroup(wg *sync.WaitGroup) error

SetWaitGroup add a wait group to the Stat a wait group is used by the stat manager to correctly close and sync all the stats before returing control to the test return error if there is already a waitgroup setup

func (*TCPStat) Start

func (s *TCPStat) Start()

Start returns all the statistics from a series of streams on a specific interface iface is the network interface to sniff and snaplen is the window size

func (*TCPStat) Stop

func (s *TCPStat) Stop()

Stop send the signal to the stat manager to stop polling stats

type Test

type Test interface {
	StartClient()
	TestServer
}

Test is a generic test it need a client method and a server method and it test one single aspect and save the results to a single logfile

type TestRunner

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

TestRunner manage the sequence of tests to run and start and stop them

func NewTestRunner

func NewTestRunner() TestRunner

NewTestRunner return a new shiny test runner

func (*TestRunner) AddTest

func (runner *TestRunner) AddTest(test Test)

AddTest add a test to the quee

func (*TestRunner) StartClient

func (runner *TestRunner) StartClient()

StartClient start in sequence all the quequed server side Tests

func (*TestRunner) StartServer

func (runner *TestRunner) StartServer()

StartServer start in sequence all the quequed server side Tests

type TestServer

type TestServer interface {
	StartServer()
	AddStat(s Stat)

	IFace() *net.Interface
	Name() string
	Address() net.Addr
	// contains filtered or unexported methods
}

TestServer is the server side part of a test it should receive data and log all the statistic we need

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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