test

package
v2.5.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustFlushRedis

func MustFlushRedis(p *redis.Pool)

MustFlushRedis flushes the Redis storage.

func MustResetDB

func MustResetDB(db *common.DBLogger)

MustResetDB re-applies all database migrations.

func NewNetworkServerPool

func NewNetworkServerPool(client *NetworkServerClient) nsclient.Pool

NewNetworkServerPool creates a network-server client pool which always returns the given client on Get.

Types

type Config

type Config struct {
	PostgresDSN  string
	RedisURL     string
	MQTTServer   string
	MQTTUsername string
	MQTTPassword string
}

Config contains the test configuration.

func GetConfig

func GetConfig() *Config

GetConfig returns the test configuration.

type NetworkServerClient

type NetworkServerClient struct {
	CreateServiceProfileChan     chan ns.CreateServiceProfileRequest
	CreateServiceProfileResponse ns.CreateServiceProfileResponse

	GetServiceProfileChan     chan ns.GetServiceProfileRequest
	GetServiceProfileResponse ns.GetServiceProfileResponse

	UpdateServiceProfileChan     chan ns.UpdateServiceProfileRequest
	UpdateServiceProfileResponse empty.Empty

	DeleteServiceProfileChan     chan ns.DeleteServiceProfileRequest
	DeleteServiceProfileResponse empty.Empty

	CreateRoutingProfileChan     chan ns.CreateRoutingProfileRequest
	CreateRoutingProfileResponse ns.CreateRoutingProfileResponse

	GetRoutingProfileChan     chan ns.GetRoutingProfileRequest
	GetRoutingProfileResponse ns.GetRoutingProfileResponse

	UpdateRoutingProfileChan     chan ns.UpdateRoutingProfileRequest
	UpdateRoutingProfileResponse empty.Empty

	DeleteRoutingProfileChan     chan ns.DeleteRoutingProfileRequest
	DeleteRoutingProfileResponse empty.Empty

	CreateDeviceProfileChan     chan ns.CreateDeviceProfileRequest
	CreateDeviceProfileResponse ns.CreateDeviceProfileResponse

	GetDeviceProfileChan     chan ns.GetDeviceProfileRequest
	GetDeviceProfileResponse ns.GetDeviceProfileResponse

	UpdateDeviceProfileChan     chan ns.UpdateDeviceProfileRequest
	UpdateDeviceProfileResponse empty.Empty

	DeleteDeviceProfileChan     chan ns.DeleteDeviceProfileRequest
	DeleteDeviceProfileResponse empty.Empty

	CreateDeviceChan     chan ns.CreateDeviceRequest
	CreateDeviceResponse empty.Empty

	GetDeviceChan     chan ns.GetDeviceRequest
	GetDeviceResponse ns.GetDeviceResponse

	UpdateDeviceChan     chan ns.UpdateDeviceRequest
	UpdateDeviceResponse empty.Empty

	DeleteDeviceChan     chan ns.DeleteDeviceRequest
	DeleteDeviceResponse empty.Empty

	ActivateDeviceChan     chan ns.ActivateDeviceRequest
	ActivateDeviceResponse empty.Empty

	DeactivateDeviceChan     chan ns.DeactivateDeviceRequest
	DeactivateDeviceResponse empty.Empty

	GetDeviceActivationChan     chan ns.GetDeviceActivationRequest
	GetDeviceActivationResponse ns.GetDeviceActivationResponse

	GetRandomDevAddrChan     chan empty.Empty
	GetRandomDevAddrResponse ns.GetRandomDevAddrResponse

	CreateMACCommandQueueItemChan     chan ns.CreateMACCommandQueueItemRequest
	CreateMACCommandQueueItemResponse empty.Empty

	SendProprietaryPayloadChan     chan ns.SendProprietaryPayloadRequest
	SendProprietaryPayloadResponse empty.Empty

	CreateGatewayChan     chan ns.CreateGatewayRequest
	CreateGatewayResponse empty.Empty

	GetGatewayChan     chan ns.GetGatewayRequest
	GetGatewayResponse ns.GetGatewayResponse

	UpdateGatewayChan     chan ns.UpdateGatewayRequest
	UpdateGatewayResponse empty.Empty

	DeleteGatewayChan     chan ns.DeleteGatewayRequest
	DeleteGatewayResponse empty.Empty

	GetGatewayStatsChan     chan ns.GetGatewayStatsRequest
	GetGatewayStatsResponse ns.GetGatewayStatsResponse

	CreateGatewayProfileChan     chan ns.CreateGatewayProfileRequest
	CreateGatewayProfileResponse ns.CreateGatewayProfileResponse

	GetGatewayProfileChan     chan ns.GetGatewayProfileRequest
	GetGatewayProfileResponse ns.GetGatewayProfileResponse

	UpdateGatewayProfileChan     chan ns.UpdateGatewayProfileRequest
	UpdateGatewayProfileResponse empty.Empty

	DeleteGatewayProfileChan     chan ns.DeleteGatewayProfileRequest
	DeleteGatewayProfileResponse empty.Empty

	CreateDeviceQueueItemChan     chan ns.CreateDeviceQueueItemRequest
	CreateDeviceQueueItemResponse empty.Empty

	FlushDeviceQueueForDevEUIChan     chan ns.FlushDeviceQueueForDevEUIRequest
	FlushDeviceQueueForDevEUIResponse empty.Empty

	GetDeviceQueueItemsForDevEUIChan     chan ns.GetDeviceQueueItemsForDevEUIRequest
	GetDeviceQueueItemsForDevEUIResponse ns.GetDeviceQueueItemsForDevEUIResponse

	GetNextDownlinkFCntForDevEUIChan     chan ns.GetNextDownlinkFCntForDevEUIRequest
	GetNextDownlinkFCntForDevEUIResponse ns.GetNextDownlinkFCntForDevEUIResponse

	CreateMulticastGroupChan     chan ns.CreateMulticastGroupRequest
	CreateMulticastGroupResponse ns.CreateMulticastGroupResponse

	GetMulticastGroupChan     chan ns.GetMulticastGroupRequest
	GetMulticastGroupResponse ns.GetMulticastGroupResponse

	UpdateMulticastGroupChan     chan ns.UpdateMulticastGroupRequest
	UpdateMulticastGroupResponse empty.Empty

	DeleteMulticastGroupChan     chan ns.DeleteMulticastGroupRequest
	DeleteMulticastGroupResponse empty.Empty

	AddDeviceToMulticastGroupChan     chan ns.AddDeviceToMulticastGroupRequest
	AddDeviceToMulticastGroupResponse empty.Empty

	RemoveDeviceFromMulticastGroupChan     chan ns.RemoveDeviceFromMulticastGroupRequest
	RemoveDeviceFromMulticastGroupResponse empty.Empty

	EnqueueMulticastQueueItemChan     chan ns.EnqueueMulticastQueueItemRequest
	EnqueueMulticastQueueItemResponse empty.Empty

	FlushMulticastQueueForMulticastGroupChan     chan ns.FlushMulticastQueueForMulticastGroupRequest
	FlushMulticastQueueForMulticastGroupResponse empty.Empty

	GetMulticastQueueItemsForMulticastGroupChan     chan ns.GetMulticastQueueItemsForMulticastGroupRequest
	GetMulticastQueueItemsForMulticastGroupResponse ns.GetMulticastQueueItemsForMulticastGroupResponse

	GetVersionResponse ns.GetVersionResponse
}

NetworkServerClient is a test network-server client.

func NewNetworkServerClient

func NewNetworkServerClient() *NetworkServerClient

NewNetworkServerClient creates a new NetworkServerClient.

func (*NetworkServerClient) ActivateDevice

func (n *NetworkServerClient) ActivateDevice(ctx context.Context, in *ns.ActivateDeviceRequest, opts ...grpc.CallOption) (*empty.Empty, error)

ActivateDevice method.

func (NetworkServerClient) AddDeviceToMulticastGroup

func (n NetworkServerClient) AddDeviceToMulticastGroup(ctx context.Context, in *ns.AddDeviceToMulticastGroupRequest, opts ...grpc.CallOption) (*empty.Empty, error)

AddDeviceToMulticastGroup method.

func (*NetworkServerClient) CreateDevice

func (n *NetworkServerClient) CreateDevice(ctx context.Context, in *ns.CreateDeviceRequest, opts ...grpc.CallOption) (*empty.Empty, error)

CreateDevice method.

func (*NetworkServerClient) CreateDeviceProfile

CreateDeviceProfile method.

func (NetworkServerClient) CreateDeviceQueueItem

func (n NetworkServerClient) CreateDeviceQueueItem(ctx context.Context, in *ns.CreateDeviceQueueItemRequest, opts ...grpc.CallOption) (*empty.Empty, error)

CreateDeviceQueueItem method.

func (*NetworkServerClient) CreateGateway

func (n *NetworkServerClient) CreateGateway(ctx context.Context, in *ns.CreateGatewayRequest, opts ...grpc.CallOption) (*empty.Empty, error)

CreateGateway method.

func (*NetworkServerClient) CreateGatewayProfile

CreateGatewayProfile method.

func (*NetworkServerClient) CreateMACCommandQueueItem

func (n *NetworkServerClient) CreateMACCommandQueueItem(ctx context.Context, in *ns.CreateMACCommandQueueItemRequest, opts ...grpc.CallOption) (*empty.Empty, error)

CreateMACCommandQueueItem method.

func (NetworkServerClient) CreateMulticastGroup

CreateMulticastGroup method.

func (*NetworkServerClient) CreateRoutingProfile

CreateRoutingProfile method.

func (*NetworkServerClient) CreateServiceProfile

CreateServiceProfile method.

func (*NetworkServerClient) DeactivateDevice

func (n *NetworkServerClient) DeactivateDevice(ctx context.Context, in *ns.DeactivateDeviceRequest, opts ...grpc.CallOption) (*empty.Empty, error)

DeactivateDevice method.

func (*NetworkServerClient) DeleteDevice

func (n *NetworkServerClient) DeleteDevice(ctx context.Context, in *ns.DeleteDeviceRequest, opts ...grpc.CallOption) (*empty.Empty, error)

DeleteDevice method.

func (*NetworkServerClient) DeleteDeviceProfile

func (n *NetworkServerClient) DeleteDeviceProfile(ctx context.Context, in *ns.DeleteDeviceProfileRequest, opts ...grpc.CallOption) (*empty.Empty, error)

DeleteDeviceProfile method.

func (*NetworkServerClient) DeleteGateway

func (n *NetworkServerClient) DeleteGateway(ctx context.Context, in *ns.DeleteGatewayRequest, opts ...grpc.CallOption) (*empty.Empty, error)

DeleteGateway method.

func (*NetworkServerClient) DeleteGatewayProfile

func (n *NetworkServerClient) DeleteGatewayProfile(ctx context.Context, in *ns.DeleteGatewayProfileRequest, opts ...grpc.CallOption) (*empty.Empty, error)

DeleteGatewayProfile method.

func (NetworkServerClient) DeleteMulticastGroup

func (n NetworkServerClient) DeleteMulticastGroup(ctx context.Context, in *ns.DeleteMulticastGroupRequest, opts ...grpc.CallOption) (*empty.Empty, error)

DeleteMulticastGroup method.

func (*NetworkServerClient) DeleteRoutingProfile

func (n *NetworkServerClient) DeleteRoutingProfile(ctx context.Context, in *ns.DeleteRoutingProfileRequest, opts ...grpc.CallOption) (*empty.Empty, error)

DeleteRoutingProfile method.

func (*NetworkServerClient) DeleteServiceProfile

func (n *NetworkServerClient) DeleteServiceProfile(ctx context.Context, in *ns.DeleteServiceProfileRequest, opts ...grpc.CallOption) (*empty.Empty, error)

DeleteServiceProfile method.

func (NetworkServerClient) EnqueueMulticastQueueItem

func (n NetworkServerClient) EnqueueMulticastQueueItem(ctx context.Context, in *ns.EnqueueMulticastQueueItemRequest, opts ...grpc.CallOption) (*empty.Empty, error)

EnqueueMulticastQueueItem method.

func (NetworkServerClient) FlushDeviceQueueForDevEUI

func (n NetworkServerClient) FlushDeviceQueueForDevEUI(ctx context.Context, in *ns.FlushDeviceQueueForDevEUIRequest, opts ...grpc.CallOption) (*empty.Empty, error)

FlushDeviceQueueForDevEUI method.

func (NetworkServerClient) FlushMulticastQueueForMulticastGroup

func (n NetworkServerClient) FlushMulticastQueueForMulticastGroup(ctx context.Context, in *ns.FlushMulticastQueueForMulticastGroupRequest, opts ...grpc.CallOption) (*empty.Empty, error)

FlushMulticastQueueForMulticastGroup method.

func (*NetworkServerClient) GetDevice

GetDevice method.

func (*NetworkServerClient) GetDeviceActivation

GetDeviceActivation method.

func (*NetworkServerClient) GetDeviceProfile

GetDeviceProfile method.

func (NetworkServerClient) GetDeviceQueueItemsForDevEUI

GetDeviceQueueItemsForDevEUI method.

func (*NetworkServerClient) GetGateway

GetGateway method.

func (*NetworkServerClient) GetGatewayProfile

GetGatewayProfile method.

func (*NetworkServerClient) GetGatewayStats

GetGatewayStats method.

func (NetworkServerClient) GetMulticastGroup

GetMulticastGroup method.

func (NetworkServerClient) GetMulticastQueueItemsForMulticastGroup

GetMulticastQueueItemsForMulticastGroup method.

func (NetworkServerClient) GetNextDownlinkFCntForDevEUI

GetNextDownlinkFCntForDevEUI method.

func (*NetworkServerClient) GetRandomDevAddr

func (n *NetworkServerClient) GetRandomDevAddr(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ns.GetRandomDevAddrResponse, error)

GetRandomDevAddr method.

func (*NetworkServerClient) GetRoutingProfile

GetRoutingProfile method.

func (*NetworkServerClient) GetServiceProfile

GetServiceProfile method.

func (NetworkServerClient) GetVersion

GetVersion method.

func (NetworkServerClient) RemoveDeviceFromMulticastGroup

func (n NetworkServerClient) RemoveDeviceFromMulticastGroup(ctx context.Context, in *ns.RemoveDeviceFromMulticastGroupRequest, opts ...grpc.CallOption) (*empty.Empty, error)

RemoveDeviceFromMulticastGroup method.

func (*NetworkServerClient) SendProprietaryPayload

func (n *NetworkServerClient) SendProprietaryPayload(ctx context.Context, in *ns.SendProprietaryPayloadRequest, opts ...grpc.CallOption) (*empty.Empty, error)

SendProprietaryPayload method.

func (NetworkServerClient) StreamFrameLogsForDevice

StreamFrameLogsForDevice method.

func (NetworkServerClient) StreamFrameLogsForGateway

StreamFrameLogsForGateway method.

func (*NetworkServerClient) UpdateDevice

func (n *NetworkServerClient) UpdateDevice(ctx context.Context, in *ns.UpdateDeviceRequest, opts ...grpc.CallOption) (*empty.Empty, error)

UpdateDevice method.

func (*NetworkServerClient) UpdateDeviceProfile

func (n *NetworkServerClient) UpdateDeviceProfile(ctx context.Context, in *ns.UpdateDeviceProfileRequest, opts ...grpc.CallOption) (*empty.Empty, error)

UpdateDeviceProfile method.

func (*NetworkServerClient) UpdateGateway

func (n *NetworkServerClient) UpdateGateway(ctx context.Context, in *ns.UpdateGatewayRequest, opts ...grpc.CallOption) (*empty.Empty, error)

UpdateGateway method.

func (*NetworkServerClient) UpdateGatewayProfile

func (n *NetworkServerClient) UpdateGatewayProfile(ctx context.Context, in *ns.UpdateGatewayProfileRequest, opts ...grpc.CallOption) (*empty.Empty, error)

UpdateGatewayProfile method.

func (NetworkServerClient) UpdateMulticastGroup

func (n NetworkServerClient) UpdateMulticastGroup(ctx context.Context, in *ns.UpdateMulticastGroupRequest, opts ...grpc.CallOption) (*empty.Empty, error)

UpdateMulticastGroup method.

func (*NetworkServerClient) UpdateRoutingProfile

func (n *NetworkServerClient) UpdateRoutingProfile(ctx context.Context, in *ns.UpdateRoutingProfileRequest, opts ...grpc.CallOption) (*empty.Empty, error)

UpdateRoutingProfile method.

func (*NetworkServerClient) UpdateServiceProfile

func (n *NetworkServerClient) UpdateServiceProfile(ctx context.Context, in *ns.UpdateServiceProfileRequest, opts ...grpc.CallOption) (*empty.Empty, error)

UpdateServiceProfile method.

type NetworkServerPool

type NetworkServerPool struct {
	Client      ns.NetworkServerServiceClient
	GetHostname string
}

NetworkServerPool is a network-server pool for testing.

func (*NetworkServerPool) Get

func (p *NetworkServerPool) Get(hostname string, caCert, tlsCert, tlsKey []byte) (ns.NetworkServerServiceClient, error)

Get returns the Client.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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