iotest

package
v3.32.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Overview

Package iotest implements tests for Gateway Server frontends.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Frontend

func Frontend(t *testing.T, frontend FrontendConfig)

Frontend tests a frontend.

Types

type FrontendConfig

type FrontendConfig struct {
	// SupportsStatus indicates that the frontend sends gateway status messages.
	SupportsStatus bool
	// DropsCRCFailure indicates that the frontend drops frames with CRC failure.
	DropsCRCFailure bool
	// DropsInvalidLoRaWAN indicates that the frontend drops frames that are invalid LoRaWAN.
	DropsInvalidLoRaWAN bool
	// DetectsDisconnect indicates that the frontend detects gateway disconnections.
	DetectsDisconnect bool
	// AuthenticatesWithEUI indicates that the gateway uses the EUI to authenticate, instead of the ID and key.
	AuthenticatesWithEUI bool
	// IsAuthenticated indicates whether the gateway connection provides authentication.
	// This is typically true for all frontends except UDP which is inherently unauthenticated.
	IsAuthenticated bool
	// DeduplicatesUplinks indicates that the frontend deduplicates uplinks that are received at once by using the IO
	// middleware's UniqueUplinkMessagesByRSSI.
	DeduplicatesUplinks bool
	// UsesGatewayToken indicates that the frontend uses gateway tokens for authentication instead of an API key.
	UsesGatewayToken bool
	// SkipsTxAcknowledgmentOnFailure indicates that the frontend does not send a Tx acknowledgment on failure.
	SkipsTxAcknowledgmentOnFailure bool
	// CustomRxMetadataAssertion is a custom assertion for RxMetadata.
	CustomRxMetadataAssertion func(t *testing.T, actual, expected *ttnpb.RxMetadata)
	// CustomComponentConfig applies custom configuration for the component before it gets started.
	// This is typically used for configuring security credentials.
	CustomComponentConfig func(config *component.Config)
	// CustomGatewayServerConfig applies custom configuration for the Gateway Server before it gets started.
	// This is typically used for configuring frontend listeners.
	CustomGatewayServerConfig func(gsConfig *gatewayserver.Config)
	// Link links the gateway.
	// If UsesGatewayToken is true, the key is empty.
	Link func(
		ctx context.Context,
		t *testing.T,
		gs *gatewayserver.GatewayServer,
		ids *ttnpb.GatewayIdentifiers,
		key string,
		upCh <-chan *ttnpb.GatewayUp,
		downCh chan<- *ttnpb.GatewayDown,
	) error
}

FrontendConfig is a test bench configuration.

Jump to

Keyboard shortcuts

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