Documentation ¶
Overview ¶
Package test contains support code for various mangos tests.
Index ¶
- func GetTLSConfig(server bool) (*tls.Config, error)
- func MustBeFalse(t *testing.T, b bool)
- func MustBeNil(t *testing.T, v interface{})
- func MustBeTrue(t *testing.T, b bool)
- func MustFail(t *testing.T, e error)
- func MustNotBeNil(t *testing.T, v interface{})
- func MustSucceed(t *testing.T, e error)
- func NewTLSConfig(server bool) (*tls.Config, error)
- type TranTest
- func (tt *TranTest) TestAll(t *testing.T)
- func (tt *TranTest) TestConnRefused(t *testing.T)
- func (tt *TranTest) TestDialerBadScheme(t *testing.T)
- func (tt *TranTest) TestDialerGetOptionInvalid(t *testing.T)
- func (tt *TranTest) TestDialerSetOptionInvalid(t *testing.T)
- func (tt *TranTest) TestDuplicateListen(t *testing.T)
- func (tt *TranTest) TestListenAndAccept(t *testing.T)
- func (tt *TranTest) TestListenerBadScheme(t *testing.T)
- func (tt *TranTest) TestListenerGetOptionInvalid(t *testing.T)
- func (tt *TranTest) TestListenerSetOptionInvalid(t *testing.T)
- func (tt *TranTest) TestScheme(t *testing.T)
- func (tt *TranTest) TestSendRecv(t *testing.T)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTLSConfig ¶
GetTLSConfig is like NewTLSConfig, but it caches to avoid regenerating key material pointlessly.
func MustBeFalse ¶
MustBeFalse verifies that the condition is true.
func MustBeTrue ¶
MustBeTrue verifies that the condition is true.
func MustFail ¶
MustFail verifies that the error is not nil. If it is nil, the test is a fatal failure.
func MustNotBeNil ¶
MustNotBeNil verifies that the provided value is not nil
func MustSucceed ¶
MustSucceed verifies that that the supplied error is nil. If it is not nil, we call t.Fatalf() to fail the test immediately.
Types ¶
type TranTest ¶
type TranTest struct {
// contains filtered or unexported fields
}
TranTest provides a common test structure for transports, so that they can implement a battery of standard tests.
func NewTranTest ¶
NewTranTest creates a TranTest.
func (*TranTest) TestConnRefused ¶
TestConnRefused tests that attempts to dial to an address without a listener properly fail with EConnRefused.
func (*TranTest) TestDialerBadScheme ¶
TestDialerBadScheme tests to makes sure that giving a bogus scheme to create a dialer fails properly.
func (*TranTest) TestDialerGetOptionInvalid ¶
TestDialerGetOptionInvalid tests attempting to get an invalid option on a Dialer.
func (*TranTest) TestDialerSetOptionInvalid ¶
TestDialerSetOptionInvalid tests trying to set an invalid option on a Dialer.
func (*TranTest) TestDuplicateListen ¶
TestDuplicateListen checks to make sure that an attempt to listen on a second socket, when another listener is already present, properly fails with ErrAddrInUse.
func (*TranTest) TestListenAndAccept ¶
TestListenAndAccept tests that we can both listen and accept connections for the given transport.
func (*TranTest) TestListenerBadScheme ¶
TestListenerBadScheme tests to makes sure that giving a bogus scheme to create a listener fails properly.
func (*TranTest) TestListenerGetOptionInvalid ¶
TestListenerGetOptionInvalid tests trying to get an invalid option on a listener.
func (*TranTest) TestListenerSetOptionInvalid ¶
TestListenerSetOptionInvalid tests passing invalid options to a listener.
func (*TranTest) TestScheme ¶
TestScheme tests the Scheme() entry point on the transport.
func (*TranTest) TestSendRecv ¶
TestSendRecv test that the transport can send and receive. It uses the REQ/REP protocol for messages.