integration

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 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 TestAgentSink

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

TestAgentSink is an instrumented infra-agent sink for testing e2e reception and processing.

func NewTestAgentSink

func NewTestAgentSink() *TestAgentSink

NewTestAgentSink returns an instrumented infra-agent sink for testing.

func (*TestAgentSink) Events

func (tas *TestAgentSink) Events() []sdkEvent.Event

Events returns the list of events the mock has captured.

func (*TestAgentSink) ForgetEvents

func (tas *TestAgentSink) ForgetEvents()

ForgetEvents erases all the recorded events.

func (*TestAgentSink) HandleEvent

func (tas *TestAgentSink) HandleEvent(kubeEvent common.KubeEvent) error

HandleEvent sends a notification to the event received channel and then forwards it to the underlying sink.

func (*TestAgentSink) Has

func (tas *TestAgentSink) Has(testEvent *sdkEvent.Event) bool

Has relaxedly checks whether the mocked agent has received an event.

func (*TestAgentSink) ServeHTTP

func (tas *TestAgentSink) ServeHTTP(rw http.ResponseWriter, r *http.Request)

ServeHTTP handles a request that would be for the infra-agent and stores the unmarshalled event.

func (*TestAgentSink) Wait

func (tas *TestAgentSink) Wait(betweenEvents, max time.Duration) bool

Wait blocks until betweenEvents time has passed since the last received event, or up to max time has passed since the call. Returns false if we had to exhaust max.

Jump to

Keyboard shortcuts

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