test

package
v0.0.0-...-9e6195f Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2020 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const AUTH_HOST = "localhost:7005"
View Source
const AUTH_HTTP_HOST = "localhost:7006"
View Source
const GRPC_HOST = "localhost:9086"
View Source
const GW_HOST = "localhost:55684"
View Source
const RESOURCE_AGGREGATE_HOST = "localhost:9083"
View Source
const RESOURCE_DIRECTORY_HOST = "localhost:9082"
View Source
const TEST_TIMEOUT = time.Second * 15

Variables

View Source
var (
	TestDeviceName string

	TestDevsimResources        []schema.ResourceLink
	TestDevsimBackendResources []schema.ResourceLink
)

Functions

func ClearDB

func ClearDB(ctx context.Context, t *testing.T)

func ConvertSchemaToPb

func ConvertSchemaToPb(deviceID string, s []schema.ResourceLink) []pb.ResourceLink

func DecodeCbor

func DecodeCbor(t *testing.T, data []byte) interface{}

func EncodeToCbor

func EncodeToCbor(t *testing.T, v interface{}) []byte

func FindDeviceByName

func FindDeviceByName(ctx context.Context, name string) (deviceID string, _ error)
func GetAllBackendResourceLinks() []schema.ResourceLink

func GetRootCertificateAuthorities

func GetRootCertificateAuthorities(t *testing.T) []*x509.Certificate

func GetRootCertificatePool

func GetRootCertificatePool(t *testing.T) *x509.CertPool

func MustFindDeviceByName

func MustFindDeviceByName(name string) (deviceID string)

func MustGetHostname

func MustGetHostname() string

func NewGrpcGateway

func NewGrpcGateway(t *testing.T, config refImpl.Config) func()

func OnboardDevSim

func OnboardDevSim(ctx context.Context, t *testing.T, c pb.GrpcGatewayClient, deviceID string, gwHost string, expectedResources []schema.ResourceLink) func()

func ResourceLinksToExpectedPublishEvents

func ResourceLinksToExpectedPublishEvents(deviceID string, links []schema.ResourceLink) map[string]*pb.Event

func SetUp

func SetUp(ctx context.Context, t *testing.T) (TearDown func())

func SortResources

func SortResources(s []pb.ResourceLink) []pb.ResourceLink

Types

type SortResourcesByHref

type SortResourcesByHref []pb.ResourceLink

func (SortResourcesByHref) Len

func (a SortResourcesByHref) Len() int

func (SortResourcesByHref) Less

func (a SortResourcesByHref) Less(i, j int) bool

func (SortResourcesByHref) Swap

func (a SortResourcesByHref) Swap(i, j int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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