verifier

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executable

type Executable func(tc TestContext) error

func ACK

func ACK(node *envoy_core.Node, resourceType model.ResourceType) Executable

func CloseStream

func CloseStream() Executable

func DiscoveryRequest

func DiscoveryRequest(node *envoy_core.Node, resourceType model.ResourceType) Executable

func DiscoveryResponse

func DiscoveryResponse(rs model.ResourceList, nonce, version string) Executable

func ExpectNoResponseDuring

func ExpectNoResponseDuring(timeout time.Duration) Executable

func NACK

func NACK(node *envoy_core.Node, resourceType model.ResourceType) Executable

func WaitRequest

func WaitRequest(timeout time.Duration, testFunc func(rs *envoy_sd.DiscoveryRequest)) Executable

func WaitResponse

func WaitResponse(timeout time.Duration, testFunc func(rs []model.Resource)) Executable

type TestContext

type TestContext interface {
	Store() store.ResourceStore
	ServerStream() *test_grpc.MockServerStream
	ClientStream() *test_grpc.MockClientStream
	Stop() chan struct{}
	SaveLastResponse(typ string, response *envoy_sd.DiscoveryResponse)
	LastResponse(typeURL string) *envoy_sd.DiscoveryResponse
	SaveLastACKedResponse(typ string, response *envoy_sd.DiscoveryResponse)
	LastACKedResponse(typ string) *envoy_sd.DiscoveryResponse
	WaitGroup() *sync.WaitGroup
}

type TestContextImpl

type TestContextImpl struct {
	ResourceStore      store.ResourceStore
	MockStream         *test_grpc.MockServerStream
	MockClientStream   *test_grpc.MockClientStream
	StopCh             chan struct{}
	Wg                 *sync.WaitGroup
	Responses          map[string]*envoy_sd.DiscoveryResponse
	LastACKedResponses map[string]*envoy_sd.DiscoveryResponse
}

func (*TestContextImpl) ClientStream

func (t *TestContextImpl) ClientStream() *test_grpc.MockClientStream

func (*TestContextImpl) LastACKedResponse

func (t *TestContextImpl) LastACKedResponse(typ string) *envoy_sd.DiscoveryResponse

func (*TestContextImpl) LastResponse

func (t *TestContextImpl) LastResponse(typ string) *envoy_sd.DiscoveryResponse

func (*TestContextImpl) SaveLastACKedResponse

func (t *TestContextImpl) SaveLastACKedResponse(typ string, response *envoy_sd.DiscoveryResponse)

func (*TestContextImpl) SaveLastResponse

func (t *TestContextImpl) SaveLastResponse(typ string, response *envoy_sd.DiscoveryResponse)

func (*TestContextImpl) ServerStream

func (t *TestContextImpl) ServerStream() *test_grpc.MockServerStream

func (*TestContextImpl) Stop

func (t *TestContextImpl) Stop() chan struct{}

func (*TestContextImpl) Store

func (t *TestContextImpl) Store() store.ResourceStore

func (*TestContextImpl) WaitGroup

func (t *TestContextImpl) WaitGroup() *sync.WaitGroup

type Verifier

type Verifier interface {
	Exec(Executable) Verifier
	Verify(TestContext) error
}

func New

func New() Verifier

Jump to

Keyboard shortcuts

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