Documentation ¶
Overview ¶
Package test contains a collection of test helpers.
Index ¶
- Variables
- func GenerateMultiaddr(t *testing.T) multiaddr.Multiaddr
- func GenerateMultiaddrs(t *testing.T) []multiaddr.Multiaddr
- func GeneratePeerID(t *testing.T) peer.ID
- func GeneratePeerMultiaddr(t *testing.T, peerID peer.ID) multiaddr.Multiaddr
- func GeneratePeerMultiaddrs(t *testing.T, peerID peer.ID) []multiaddr.Multiaddr
- func GeneratePrivateKey(t *testing.T) crypto.PrivKey
- func GetPeerIDFromKey(t *testing.T, sk crypto.PrivKey) peer.ID
- func NewEvent() *logging.EventInProgress
- func NewSpan() *monitoring.Span
- func WaitUntil(t *testing.T, duration time.Duration, interval time.Duration, ...)
- func WaitUntilConnected(t *testing.T, host ihost.Host, peerID peer.ID)
- func WaitUntilDisconnected(t *testing.T, host ihost.Host, peerID peer.ID)
- func WaitUntilStreamClosed(t *testing.T, stream inet.Stream)
- type Stream
Constants ¶
This section is empty.
Variables ¶
var TestLogger = logging.Logger("test")
TestLogger can be used in tests to generate events.
Functions ¶
func GenerateMultiaddr ¶
GenerateMultiaddr generates a valid multiaddr.
func GenerateMultiaddrs ¶
GenerateMultiaddrs generates semantically valid multiaddrs.
func GeneratePeerID ¶
GeneratePeerID generates a valid peerID.
func GeneratePeerMultiaddr ¶
GeneratePeerMultiaddr generates a semantically valid multiaddr for the given peer.
func GeneratePeerMultiaddrs ¶
GeneratePeerMultiaddrs generates semantically valid multiaddrs for the given peer.
func GeneratePrivateKey ¶
GeneratePrivateKey generates a valid private key.
func GetPeerIDFromKey ¶
GetPeerIDFromKey returns the peer ID associated to a key.
func WaitUntil ¶
func WaitUntil(t *testing.T, duration time.Duration, interval time.Duration, cond func() error, message string)
WaitUntil waits for duration for the condition function not to return an error to return or fails after the delay has elapsed.
func WaitUntilConnected ¶
WaitUntilConnected waits until the given host is connected to the given peer.
func WaitUntilDisconnected ¶
WaitUntilDisconnected waits until the given host is disconnected from the given peer.
Types ¶
type Stream ¶
Stream wraps an existing stream to provide additional testing information.
func WrapStream ¶
WrapStream wraps an existing stream to provide additional testing information.
func (*Stream) CloseChan ¶
func (s *Stream) CloseChan() <-chan struct{}
CloseChan returns the channel used to notify of close events.
Directories ¶
Path | Synopsis |
---|---|
Package benchmark defines integration benchmarks for Indigo Node.
|
Package benchmark defines integration benchmarks for Indigo Node. |
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
Package session defines types for doing system tests.
|
Package session defines types for doing system tests. |
Package system defines system tests for Indigo Node.
|
Package system defines system tests for Indigo Node. |