tests

package module
v0.0.0-...-64384c2 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2019 License: BSD-3-Clause Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PacketItem

type PacketItem struct {
	gopacket.Packet
	Service   string
	Interface string
}

func (*PacketItem) IPv4DstIP

func (pi *PacketItem) IPv4DstIP() net.IP

func (*PacketItem) IPv4SrcIP

func (pi *PacketItem) IPv4SrcIP() net.IP

func (*PacketItem) Less

func (pi *PacketItem) Less(than btree.Item) bool

func (*PacketItem) UDPDstPort

func (pi *PacketItem) UDPDstPort() int

func (*PacketItem) UDPPayload

func (pi *PacketItem) UDPPayload() []byte

func (*PacketItem) UDPSrcPort

func (pi *PacketItem) UDPSrcPort() int

type Service

type Service struct {
	*dc.Service
	T *testing.T
}

func (*Service) GetIPAddresses

func (service *Service) GetIPAddresses(iface string) []string

func (*Service) ReadEchoServer

func (service *Service) ReadEchoServer(remoteIP net.IP, remotePort, localPort, timeout int) []byte

func (*Service) SetDefaultGateway

func (service *Service) SetDefaultGateway(ip string)

func (*Service) StartEchoServer

func (service *Service) StartEchoServer(message string, port, times int) exec.Cmd

func (*Service) StartEchoServerGolang

func (service *Service) StartEchoServerGolang(message string, port, times int) exec.Cmd

type Step

type Step struct {
	Service string
	SrcIP   net.IP
	SrcPort int
	DstIP   net.IP
	DstPort int
	Payload []byte
}

func (Step) String

func (s Step) String() string

type TimeItem

type TimeItem struct {
	time.Time
}

func (*TimeItem) Less

func (ti *TimeItem) Less(than btree.Item) bool

type Topology

type Topology struct {
	LAN               *dc.Network
	Internet          *dc.Network
	Router            *Service
	LANComputer       *Service
	LANComputers      []*Service
	InternetComputer  *Service
	InternetComputers []*Service
	Compose           *dc.Compose
	T                 *testing.T
	TCPDumps          []*tcpdumpConfig
	// contains filtered or unexported fields
}

func NewTopology

func NewTopology(t *testing.T, topologyConfig *TopologyConfiguration) *Topology

func (*Topology) GetInternetComputerIPAddress

func (topology *Topology) GetInternetComputerIPAddress() net.IP

func (*Topology) GetInternetComputerIPAddressIndex

func (topology *Topology) GetInternetComputerIPAddressIndex(index uint) net.IP

func (*Topology) GetLANComputerIPAddress

func (topology *Topology) GetLANComputerIPAddress() net.IP

func (*Topology) GetRouterLANIPAddress

func (topology *Topology) GetRouterLANIPAddress() net.IP

func (*Topology) GetRouterWANIPAddress

func (topology *Topology) GetRouterWANIPAddress() net.IP

func (*Topology) Packets

func (topology *Topology) Packets() []*PacketItem

func (*Topology) PrintDebug

func (topology *Topology) PrintDebug()

func (*Topology) PrintDebugIfFailed

func (topology *Topology) PrintDebugIfFailed()

func (*Topology) Start

func (topology *Topology) Start() error

func (*Topology) ValidateSteps

func (topology *Topology) ValidateSteps(steps []Step)

type TopologyConfiguration

type TopologyConfiguration struct {
	NumberOfLANComputers      uint
	NumberOfInternetComputers uint
	NumberOfRouterIPAddresses uint
	RouterConfig              string
}

Jump to

Keyboard shortcuts

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