test

package
v1.6.0-crc0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReceiveTimeout added in v0.2.4

func ReceiveTimeout[T any](t *testing.T, ch <-chan T, timeout time.Duration) T

ReceiveTimeout returns the first received element or fails the test if nothing is received before the given timeout

Types

type ExporterFake

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

func NewExporterFake

func NewExporterFake() *ExporterFake

func (*ExporterFake) Export

func (ef *ExporterFake) Export(in <-chan []*flow.Record)

func (*ExporterFake) Get

func (ef *ExporterFake) Get(t *testing.T, timeout time.Duration) []*flow.Record

type SliceInformerFake

type SliceInformerFake []ifaces.Interface

SliceInformerFake fakes the ifaces.Informer implementation by just notifying all the interfaces in the slice

func (SliceInformerFake) Subscribe

func (sif SliceInformerFake) Subscribe(_ context.Context) (<-chan ifaces.Event, error)

type TracerFake

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

TracerFake fakes the kernel-side eBPF map structures for testing

func NewTracerFake

func NewTracerFake() *TracerFake

func (*TracerFake) AppendLookupResults

func (m *TracerFake) AppendLookupResults(results map[ebpf.BpfFlowId][]ebpf.BpfFlowMetrics)

func (*TracerFake) AppendRingBufEvent

func (m *TracerFake) AppendRingBufEvent(flow flow.RawRecord) error

func (*TracerFake) AttachTCX

func (m *TracerFake) AttachTCX(_ ifaces.Interface) error

func (*TracerFake) Close

func (m *TracerFake) Close() error

func (*TracerFake) DeleteMapsStaleEntries added in v0.3.2

func (m *TracerFake) DeleteMapsStaleEntries(_ time.Duration)

func (*TracerFake) LookupAndDeleteMap

func (m *TracerFake) LookupAndDeleteMap(_ *metrics.Metrics) map[ebpf.BpfFlowId][]ebpf.BpfFlowMetrics

func (*TracerFake) ReadRingBuf

func (m *TracerFake) ReadRingBuf() (ringbuf.Record, error)

func (*TracerFake) Register

func (m *TracerFake) Register(iface ifaces.Interface) error

Jump to

Keyboard shortcuts

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