test

package
v0.1.3-rc3 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAllCerts added in v0.1.3

func CreateAllCerts(t *testing.T) (string, string, string, func())

CreateAllCerts returns paths to: - ca - user cert - user key and the cleanup function to defer

func CreateCACert added in v0.1.3

func CreateCACert(t *testing.T) (string, func())

CreateCACert returns paths to CA cert and the cleanup function to defer

func CreateMockAgg

func CreateMockAgg(name, recordKey, by, agg, op string, totalValue float64, totalCount int, rrv []float64, recentOpValue float64, recentCount int) config.GenericMap

func DeserializeJSONToMap

func DeserializeJSONToMap(t *testing.T, in string) config.GenericMap

func DumpToTemp added in v0.1.3

func DumpToTemp(content string) (string, error, func())

func FakeLokiHandler

func FakeLokiHandler(flowsData chan<- map[string]interface{}) http.HandlerFunc

FakeLokiHandler is a fake loki HTTP service that decodes the snappy/protobuf messages and forwards them for later assertions

func GetExtractMockEntry

func GetExtractMockEntry() config.GenericMap

func GetIngestMockEntry

func GetIngestMockEntry(missingKey bool) config.GenericMap

func InitConfig

func InitConfig(t *testing.T, conf string) (*viper.Viper, *config.ConfigFileStruct)

func RunCommand

func RunCommand(command string) string

func UDPPort

func UDPPort() (int, error)

UDPPort asks the kernel for a free open port that is ready to use.

func WaitFromChannel added in v0.1.3

func WaitFromChannel(in chan []config.GenericMap, timeout time.Duration) ([]config.GenericMap, error)

Types

type IPFIXClient

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

IPFIXClient for IPFIX tests

func NewIPFIXClient

func NewIPFIXClient(port int) (*IPFIXClient, error)

NewIPFIXClient returns an IPFIXClient that sends data to the given port

func (*IPFIXClient) SendFlow

func (ke *IPFIXClient) SendFlow(timestamp uint32, srcIP string) error

SendFlow containing the information passed as an argument

func (*IPFIXClient) SendTemplate

func (ke *IPFIXClient) SendTemplate() error

SendTemplate must be executed before sending any flow

Directories

Path Synopsis
e2e

Jump to

Keyboard shortcuts

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