Documentation ¶
Index ¶
- func BuildBinary(path string) (string, error)
- func CheckTravis() (bool, error)
- func GetAutoRoutePath() string
- func GetUnusedPort() int
- func ProduceCommandLine(b BinaryOptions) []string
- func SendPacket(conn net.Conn, t *testing.T, address types.NodeAddress, data []byte)
- func WaitForConnection(b AutoRouteBinary, addr string) error
- func WaitForID(b AutoRouteBinary) (string, error)
- func WaitForPacket(c net.Conn, t *testing.T, s chan types.Packet)
- func WaitForPackets(c net.Conn, t *testing.T, s chan types.Packet, amt int)
- func WaitForPacketsReceived(b AutoRouteBinary, src string, amt ...int) error
- func WaitForPacketsSent(b AutoRouteBinary, dest string, amt ...int) error
- func WaitForSocket(dev string) (net.Conn, error)
- type AutoRouteBinary
- func (b AutoRouteBinary) FetchStatus() (*statusStruct, error)
- func (b AutoRouteBinary) GetConnections() ([]string, error)
- func (b AutoRouteBinary) GetID() (string, error)
- func (b AutoRouteBinary) GetPacketsReceived() (map[string]int, error)
- func (b AutoRouteBinary) GetPacketsSent() (map[string]int, error)
- type BinaryOptions
- type LogFailer
- type WrappedBinary
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildBinary ¶
func GetAutoRoutePath ¶
func GetAutoRoutePath() string
Gets the path for the version of the autoroute binary.
func GetUnusedPort ¶
func GetUnusedPort() int
func ProduceCommandLine ¶
func ProduceCommandLine(b BinaryOptions) []string
Transforms a BinaryOptions into a valid AutoRoute command line.
func SendPacket ¶
Sends a new packet with data we specify. Args:
conn: The connection we are sending it on. t: The test interface we are using. address: The address of the node where it is going. data: The actual data.
func WaitForConnection ¶
func WaitForConnection(b AutoRouteBinary, addr string) error
func WaitForID ¶
func WaitForID(b AutoRouteBinary) (string, error)
func WaitForPacket ¶
Waits for a single packet.
func WaitForPackets ¶
Wait for a number of packets. Args:
c: Connection to read packets from. t: Testing interface being used. s: Channel down which to send incomming packets. amt: The amount of packets to read before exiting.
func WaitForPacketsReceived ¶
func WaitForPacketsReceived(b AutoRouteBinary, src string, amt ...int) error
func WaitForPacketsSent ¶
func WaitForPacketsSent(b AutoRouteBinary, dest string, amt ...int) error
Types ¶
type AutoRouteBinary ¶
type AutoRouteBinary struct { WrappedBinary // contains filtered or unexported fields }
Represents a binary execution of the autoroute binary.
func NewNodeBinary ¶
func NewNodeBinary(b BinaryOptions) AutoRouteBinary
Produces a AutoRoute Binary which can be run. Must call Start in order to make it start running. Args:
b: Options for the binary.
Returns:
The new autoroute binary.
func (AutoRouteBinary) FetchStatus ¶
func (b AutoRouteBinary) FetchStatus() (*statusStruct, error)
func (AutoRouteBinary) GetConnections ¶
func (b AutoRouteBinary) GetConnections() ([]string, error)
Returns a list of connections
func (AutoRouteBinary) GetID ¶
func (b AutoRouteBinary) GetID() (string, error)
Returns the hex encoded network ID of the binary.
func (AutoRouteBinary) GetPacketsReceived ¶
func (b AutoRouteBinary) GetPacketsReceived() (map[string]int, error)
Returns a map of address -> packets received
func (AutoRouteBinary) GetPacketsSent ¶
func (b AutoRouteBinary) GetPacketsSent() (map[string]int, error)
Returns a map of address -> packets received
type BinaryOptions ¶
type BinaryOptions struct { Listen string FakeMoney bool Connect []string Unix string Autodiscover bool AutodiscoverDevices []string Tcptun string Tcptunserve bool Keyfile string BTCHost string BTCUser string BTCPass string RouteLogPath string }
Represents various options which can be passed to the binary.
type WrappedBinary ¶
This type represents a running binary with some nice features for test integration.
func NewWrappedBinary ¶
func NewWrappedBinary(path string, args ...string) WrappedBinary
func (WrappedBinary) KillAndPrint ¶
func (b WrappedBinary) KillAndPrint(f LogFailer)
Used to print out the binary output in the event that some failure happened.