tailnettest

package
v2.10.2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Overview

Package tailnettest is a generated GoMock package.

Package tailnettest is a generated GoMock package.

Package tailnettest is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DERPIsEmbedded added in v2.9.0

func DERPIsEmbedded(cfg *derpAndSTUNCfg)

func DisableSTUN added in v2.9.0

func DisableSTUN(cfg *derpAndSTUNCfg)

func RunDERPAndSTUN

func RunDERPAndSTUN(t *testing.T, opts ...DERPAndStunOption) (*tailcfg.DERPMap, *derp.Server)

RunDERPAndSTUN creates a DERP mapping for tests.

func RunDERPOnlyWebSockets

func RunDERPOnlyWebSockets(t *testing.T) *tailcfg.DERPMap

RunDERPOnlyWebSockets creates a DERP mapping for tests that only allows WebSockets through it. Many proxies do not support upgrading DERP, so this is a good fallback.

Types

type DERPAndStunOption added in v2.9.0

type DERPAndStunOption func(cfg *derpAndSTUNCfg)

type FakeCoordinate added in v2.8.0

type FakeCoordinate struct {
	Ctx   context.Context
	ID    uuid.UUID
	Name  string
	Auth  tailnet.CoordinateeAuth
	Reqs  chan *proto.CoordinateRequest
	Resps chan *proto.CoordinateResponse
}

type FakeCoordinator added in v2.8.0

type FakeCoordinator struct {
	CoordinateCalls  chan *FakeCoordinate
	ServeClientCalls chan *FakeServeClient
}

func NewFakeCoordinator added in v2.8.0

func NewFakeCoordinator() *FakeCoordinator

func (*FakeCoordinator) Close added in v2.8.0

func (*FakeCoordinator) Close() error

func (*FakeCoordinator) Coordinate added in v2.8.0

func (*FakeCoordinator) Node added in v2.8.0

func (*FakeCoordinator) ServeAgent added in v2.8.0

func (*FakeCoordinator) ServeAgent(net.Conn, uuid.UUID, string) error

func (*FakeCoordinator) ServeClient added in v2.8.0

func (f *FakeCoordinator) ServeClient(conn net.Conn, id uuid.UUID, agent uuid.UUID) error

func (*FakeCoordinator) ServeHTTPDebug added in v2.8.0

func (*FakeCoordinator) ServeHTTPDebug(http.ResponseWriter, *http.Request)

func (*FakeCoordinator) ServeMultiAgent added in v2.8.0

func (*FakeCoordinator) ServeMultiAgent(uuid.UUID) tailnet.MultiAgentConn

type FakeServeClient added in v2.8.0

type FakeServeClient struct {
	Conn  net.Conn
	ID    uuid.UUID
	Agent uuid.UUID
	ErrCh chan error
}

type MockCoordinatee added in v2.8.0

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

MockCoordinatee is a mock of Coordinatee interface.

func NewMockCoordinatee added in v2.8.0

func NewMockCoordinatee(ctrl *gomock.Controller) *MockCoordinatee

NewMockCoordinatee creates a new mock instance.

func (*MockCoordinatee) EXPECT added in v2.8.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockCoordinatee) SetAllPeersLost added in v2.8.0

func (m *MockCoordinatee) SetAllPeersLost()

SetAllPeersLost mocks base method.

func (*MockCoordinatee) SetNodeCallback added in v2.8.0

func (m *MockCoordinatee) SetNodeCallback(arg0 func(*tailnet.Node))

SetNodeCallback mocks base method.

func (*MockCoordinatee) UpdatePeers added in v2.8.0

func (m *MockCoordinatee) UpdatePeers(arg0 []*proto.CoordinateResponse_PeerUpdate) error

UpdatePeers mocks base method.

type MockCoordinateeMockRecorder added in v2.8.0

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

MockCoordinateeMockRecorder is the mock recorder for MockCoordinatee.

func (*MockCoordinateeMockRecorder) SetAllPeersLost added in v2.8.0

func (mr *MockCoordinateeMockRecorder) SetAllPeersLost() *gomock.Call

SetAllPeersLost indicates an expected call of SetAllPeersLost.

func (*MockCoordinateeMockRecorder) SetNodeCallback added in v2.8.0

func (mr *MockCoordinateeMockRecorder) SetNodeCallback(arg0 any) *gomock.Call

SetNodeCallback indicates an expected call of SetNodeCallback.

func (*MockCoordinateeMockRecorder) UpdatePeers added in v2.8.0

func (mr *MockCoordinateeMockRecorder) UpdatePeers(arg0 any) *gomock.Call

UpdatePeers indicates an expected call of UpdatePeers.

type MockCoordinator added in v2.7.1

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

MockCoordinator is a mock of Coordinator interface.

func NewMockCoordinator added in v2.7.1

func NewMockCoordinator(ctrl *gomock.Controller) *MockCoordinator

NewMockCoordinator creates a new mock instance.

func (*MockCoordinator) Close added in v2.7.1

func (m *MockCoordinator) Close() error

Close mocks base method.

func (*MockCoordinator) Coordinate added in v2.7.1

func (m *MockCoordinator) Coordinate(arg0 context.Context, arg1 uuid.UUID, arg2 string, arg3 tailnet.CoordinateeAuth) (chan<- *proto.CoordinateRequest, <-chan *proto.CoordinateResponse)

Coordinate mocks base method.

func (*MockCoordinator) EXPECT added in v2.7.1

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockCoordinator) Node added in v2.7.1

func (m *MockCoordinator) Node(arg0 uuid.UUID) *tailnet.Node

Node mocks base method.

func (*MockCoordinator) ServeAgent added in v2.7.1

func (m *MockCoordinator) ServeAgent(arg0 net.Conn, arg1 uuid.UUID, arg2 string) error

ServeAgent mocks base method.

func (*MockCoordinator) ServeClient added in v2.7.1

func (m *MockCoordinator) ServeClient(arg0 net.Conn, arg1, arg2 uuid.UUID) error

ServeClient mocks base method.

func (*MockCoordinator) ServeHTTPDebug added in v2.7.1

func (m *MockCoordinator) ServeHTTPDebug(arg0 http.ResponseWriter, arg1 *http.Request)

ServeHTTPDebug mocks base method.

func (*MockCoordinator) ServeMultiAgent added in v2.7.1

func (m *MockCoordinator) ServeMultiAgent(arg0 uuid.UUID) tailnet.MultiAgentConn

ServeMultiAgent mocks base method.

type MockCoordinatorMockRecorder added in v2.7.1

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

MockCoordinatorMockRecorder is the mock recorder for MockCoordinator.

func (*MockCoordinatorMockRecorder) Close added in v2.7.1

Close indicates an expected call of Close.

func (*MockCoordinatorMockRecorder) Coordinate added in v2.7.1

func (mr *MockCoordinatorMockRecorder) Coordinate(arg0, arg1, arg2, arg3 any) *gomock.Call

Coordinate indicates an expected call of Coordinate.

func (*MockCoordinatorMockRecorder) Node added in v2.7.1

func (mr *MockCoordinatorMockRecorder) Node(arg0 any) *gomock.Call

Node indicates an expected call of Node.

func (*MockCoordinatorMockRecorder) ServeAgent added in v2.7.1

func (mr *MockCoordinatorMockRecorder) ServeAgent(arg0, arg1, arg2 any) *gomock.Call

ServeAgent indicates an expected call of ServeAgent.

func (*MockCoordinatorMockRecorder) ServeClient added in v2.7.1

func (mr *MockCoordinatorMockRecorder) ServeClient(arg0, arg1, arg2 any) *gomock.Call

ServeClient indicates an expected call of ServeClient.

func (*MockCoordinatorMockRecorder) ServeHTTPDebug added in v2.7.1

func (mr *MockCoordinatorMockRecorder) ServeHTTPDebug(arg0, arg1 any) *gomock.Call

ServeHTTPDebug indicates an expected call of ServeHTTPDebug.

func (*MockCoordinatorMockRecorder) ServeMultiAgent added in v2.7.1

func (mr *MockCoordinatorMockRecorder) ServeMultiAgent(arg0 any) *gomock.Call

ServeMultiAgent indicates an expected call of ServeMultiAgent.

type MockMultiAgentConn

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

MockMultiAgentConn is a mock of MultiAgentConn interface.

func NewMockMultiAgentConn

func NewMockMultiAgentConn(ctrl *gomock.Controller) *MockMultiAgentConn

NewMockMultiAgentConn creates a new mock instance.

func (*MockMultiAgentConn) Close

func (m *MockMultiAgentConn) Close() error

Close mocks base method.

func (*MockMultiAgentConn) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockMultiAgentConn) IsClosed

func (m *MockMultiAgentConn) IsClosed() bool

IsClosed mocks base method.

func (*MockMultiAgentConn) NextUpdate

NextUpdate mocks base method.

func (*MockMultiAgentConn) SubscribeAgent

func (m *MockMultiAgentConn) SubscribeAgent(arg0 uuid.UUID) error

SubscribeAgent mocks base method.

func (*MockMultiAgentConn) UnsubscribeAgent

func (m *MockMultiAgentConn) UnsubscribeAgent(arg0 uuid.UUID) error

UnsubscribeAgent mocks base method.

func (*MockMultiAgentConn) UpdateSelf

func (m *MockMultiAgentConn) UpdateSelf(arg0 *proto.Node) error

UpdateSelf mocks base method.

type MockMultiAgentConnMockRecorder

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

MockMultiAgentConnMockRecorder is the mock recorder for MockMultiAgentConn.

func (*MockMultiAgentConnMockRecorder) Close

Close indicates an expected call of Close.

func (*MockMultiAgentConnMockRecorder) IsClosed

func (mr *MockMultiAgentConnMockRecorder) IsClosed() *gomock.Call

IsClosed indicates an expected call of IsClosed.

func (*MockMultiAgentConnMockRecorder) NextUpdate

func (mr *MockMultiAgentConnMockRecorder) NextUpdate(arg0 any) *gomock.Call

NextUpdate indicates an expected call of NextUpdate.

func (*MockMultiAgentConnMockRecorder) SubscribeAgent

func (mr *MockMultiAgentConnMockRecorder) SubscribeAgent(arg0 any) *gomock.Call

SubscribeAgent indicates an expected call of SubscribeAgent.

func (*MockMultiAgentConnMockRecorder) UnsubscribeAgent

func (mr *MockMultiAgentConnMockRecorder) UnsubscribeAgent(arg0 any) *gomock.Call

UnsubscribeAgent indicates an expected call of UnsubscribeAgent.

func (*MockMultiAgentConnMockRecorder) UpdateSelf

func (mr *MockMultiAgentConnMockRecorder) UpdateSelf(arg0 any) *gomock.Call

UpdateSelf indicates an expected call of UpdateSelf.

type TestMultiAgent added in v2.8.0

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

func NewTestMultiAgent added in v2.8.0

func NewTestMultiAgent(t testing.TB, coord tailnet.Coordinator) *TestMultiAgent

func (*TestMultiAgent) Close added in v2.8.0

func (m *TestMultiAgent) Close()

func (*TestMultiAgent) RequireEventuallyClosed added in v2.8.0

func (m *TestMultiAgent) RequireEventuallyClosed(ctx context.Context)

func (*TestMultiAgent) RequireEventuallyHasDERPs added in v2.8.0

func (m *TestMultiAgent) RequireEventuallyHasDERPs(ctx context.Context, expected ...int)

func (*TestMultiAgent) RequireNeverHasDERPs added in v2.8.0

func (m *TestMultiAgent) RequireNeverHasDERPs(ctx context.Context, expected ...int)

func (*TestMultiAgent) RequireSubscribeAgent added in v2.8.0

func (m *TestMultiAgent) RequireSubscribeAgent(id uuid.UUID)

func (*TestMultiAgent) RequireUnsubscribeAgent added in v2.8.0

func (m *TestMultiAgent) RequireUnsubscribeAgent(id uuid.UUID)

func (*TestMultiAgent) SendNodeWithDERP added in v2.8.0

func (m *TestMultiAgent) SendNodeWithDERP(d int32)

Jump to

Keyboard shortcuts

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