Documentation ¶
Index ¶
- Constants
- Variables
- func CleanUpDpsResource(dps *ResourcePlgdDps)
- func ClearDB(t require.TestingT)
- func ForceReprovision(ctx context.Context, c pb.GrpcGatewayClient, deviceID string) error
- func LightResourceInstanceHref(id string) string
- func MakeAPIsConfig() service.APIsConfig
- func MakeAuthorizationConfig() service.AuthorizationConfig
- func MakeConfig(t require.TestingT) service.Config
- func MakeEnrollmentGroup() service.EnrollmentGroupConfig
- func MakeHTTPConfig() service.HTTPConfig
- func MakeHubConfig(hubID string, gateways ...string) service.HubConfig
- func MakeStorageConfig() service.StorageConfig
- func New(t *testing.T, cfg service.Config, opts ...service.Option) func()
- func NewEnrollmentGroup(t *testing.T, id, owner string) *pb.EnrollmentGroup
- func NewHTTPService(ctx context.Context, t *testing.T, store *storeMongo.Store) (*http.Service, func())
- func NewHub(id, owner string) *pb.Hub
- func NewMongoStore(t require.TestingT) (*storeMongo.Store, func())
- func NewWithContext(ctx context.Context, t *testing.T, cfg service.Config, opts ...service.Option) func()
- func OnboardDpsSim(ctx context.Context, t *testing.T, gc pb.GrpcGatewayClient, ...) (string, func())
- func OnboardDpsSimDevice(ctx context.Context, t *testing.T, gc pb.GrpcGatewayClient, d device.Device, ...) func()
- func RestartDockerContainer(dockerName string) error
- func SendSignalToDocker(dockerName, signal string) error
- func SendSignalToProcess(pid, signal string) error
- func SetUp(t *testing.T) (tearDown func())
- func SubscribeToAllEvents(ctx context.Context, t *testing.T, c pb.GrpcGatewayClient, ...) (pb.GrpcGateway_SubscribeToEventsClient, string)
- func SubscribeToEvents(t *testing.T, subClient pb.GrpcGateway_SubscribeToEventsClient, ...) (string, string)
- func ToJSON(v interface{}) ([]byte, error)
- func WaitForDeviceStatus(t *testing.T, client pb.GrpcGateway_SubscribeToEventsClient, ...) error
- func WaitForRegistered(t *testing.T, client pb.GrpcGateway_SubscribeToEventsClient, ...) error
- type CheckCountFn
- type CheckFinalCountsFn
- type DpsEndpoint
- type HandlerID
- type Option
- type RequestHandlerWithCounter
- func (h *RequestHandlerWithCounter) DefaultHandler(ctx context.Context, req *mux.Message, session *service.Session, ...) (*pool.Message, error)
- func (h *RequestHandlerWithCounter) ProcessACLs(ctx context.Context, req *mux.Message, session *service.Session, ...) (*pool.Message, error)
- func (h *RequestHandlerWithCounter) ProcessCloudConfiguration(ctx context.Context, req *mux.Message, session *service.Session, ...) (*pool.Message, error)
- func (h *RequestHandlerWithCounter) ProcessCredentials(ctx context.Context, req *mux.Message, session *service.Session, ...) (*pool.Message, error)
- func (h *RequestHandlerWithCounter) ProcessOwnership(ctx context.Context, req *mux.Message, session *service.Session, ...) (*pool.Message, error)
- func (h *RequestHandlerWithCounter) ProcessPlgdTime(ctx context.Context, req *mux.Message, session *service.Session, ...) (*pool.Message, error)
- func (h *RequestHandlerWithCounter) Verify(ctx context.Context) error
- type RequestHandlerWithDps
- func (h *RequestHandlerWithDps) Cfg() service.Config
- func (h *RequestHandlerWithDps) IsStarted() bool
- func (h *RequestHandlerWithDps) Logf(template string, args ...interface{})
- func (h *RequestHandlerWithDps) RestartDps(opts ...service.Option)
- func (h *RequestHandlerWithDps) StartDps(opts ...service.Option)
- func (h *RequestHandlerWithDps) StopDps()
- func (h *RequestHandlerWithDps) T() *testing.T
- type ResourcePlgdDps
- type ResourcePlgdDpsTest
- type ResourcePlgdDpsTestCloudStatusObserver
- type ResourcePlgdDpsTestIotivity
Constants ¶
View Source
const ( DPSHost = "127.0.0.1:20130" DPSHTTPHost = "127.0.0.1:20131" DPSEnrollmentGroupID = "6aa1aa8e-2b91-48ee-bfbc-a4e22d8e20d8" DPSOwner = "1" )
View Source
const ( TestResourceSwitchesHref = "/switches" ResourcePlgdDpsHref = "/plgd/dps" ResourcePlgdDpsType = "x.plgd.dps.conf" )
Variables ¶
View Source
var ( TestDockerContainerName string TestDeviceName string TestDockerObtContainerName string TestDeviceObtName string TestDeviceObtSupportsTestProperties bool TestDevsimResources []schema.ResourceLink )
Functions ¶
func CleanUpDpsResource ¶
func CleanUpDpsResource(dps *ResourcePlgdDps)
func ForceReprovision ¶
func MakeAPIsConfig ¶
func MakeAPIsConfig() service.APIsConfig
func MakeAuthorizationConfig ¶
func MakeAuthorizationConfig() service.AuthorizationConfig
func MakeEnrollmentGroup ¶
func MakeEnrollmentGroup() service.EnrollmentGroupConfig
func MakeHTTPConfig ¶
func MakeHTTPConfig() service.HTTPConfig
func MakeStorageConfig ¶
func MakeStorageConfig() service.StorageConfig
func NewEnrollmentGroup ¶
func NewEnrollmentGroup(t *testing.T, id, owner string) *pb.EnrollmentGroup
func NewHTTPService ¶
func NewMongoStore ¶
func NewMongoStore(t require.TestingT) (*storeMongo.Store, func())
func NewWithContext ¶
func NewWithContext(ctx context.Context, t *testing.T, cfg service.Config, opts ...service.Option) func()
New creates test dps-gateway.
func OnboardDpsSim ¶
func OnboardDpsSimDevice ¶
func RestartDockerContainer ¶
func SendSignalToDocker ¶
func SendSignalToProcess ¶
func SubscribeToAllEvents ¶
func SubscribeToAllEvents(ctx context.Context, t *testing.T, c pb.GrpcGatewayClient, correllationID string) (pb.GrpcGateway_SubscribeToEventsClient, string)
func SubscribeToEvents ¶
func SubscribeToEvents(t *testing.T, subClient pb.GrpcGateway_SubscribeToEventsClient, sub *pb.SubscribeToEvents) (string, string)
func WaitForDeviceStatus ¶
func WaitForDeviceStatus(t *testing.T, client pb.GrpcGateway_SubscribeToEventsClient, deviceID, subID, correlationID string, status commands.Connection_Status) error
func WaitForRegistered ¶
Types ¶
type CheckFinalCountsFn ¶
type DpsEndpoint ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option interface used for setting optional onboardConfig properties.
func WithConfigureDevice ¶
func WithConfigureDevice(configureDevice configureDpsDevice) Option
WithConfigureDevice sets a function that will be called after the device is owned, but before the device is onboarded.
func WithSdkID ¶
WithSdkID creates Option that overrides the default device ID used by the SDK client.
func WithSdkRootCA ¶
WithSdkRootCA creates Option that overrides the certificate authority used by the SDK client.
func WithValidity ¶
WithValidity creates Option that overrides the ValidFrom timestamp and CertExpiry interval used by the SDK client when generating certificates.
type RequestHandlerWithCounter ¶
type RequestHandlerWithCounter struct { RequestHandlerWithDps // contains filtered or unexported fields }
func NewRequestHandlerWithCounter ¶
func NewRequestHandlerWithCounter(t *testing.T, dpsCfg service.Config, checkCount CheckCountFn, checkFinalCounts CheckFinalCountsFn) *RequestHandlerWithCounter
func NewRequestHandlerWithExpectedCounters ¶
func NewRequestHandlerWithExpectedCounters(t *testing.T, failLimit uint64, failCode codes.Code, expectedTimeCount, expectedOwnershipCount, expectedCloudConfigurationCount, expectedCredentialsCount, expectedACLsCount uint64, ) *RequestHandlerWithCounter
we know the counter is invalid when the value is higher
func (*RequestHandlerWithCounter) DefaultHandler ¶
func (*RequestHandlerWithCounter) ProcessACLs ¶
func (*RequestHandlerWithCounter) ProcessCloudConfiguration ¶
func (*RequestHandlerWithCounter) ProcessCredentials ¶
func (*RequestHandlerWithCounter) ProcessOwnership ¶
func (*RequestHandlerWithCounter) ProcessPlgdTime ¶
type RequestHandlerWithDps ¶
type RequestHandlerWithDps struct {
// contains filtered or unexported fields
}
func MakeRequestHandlerWithDps ¶
func MakeRequestHandlerWithDps(t *testing.T, dpsCfg service.Config) RequestHandlerWithDps
func (*RequestHandlerWithDps) Cfg ¶
func (h *RequestHandlerWithDps) Cfg() service.Config
func (*RequestHandlerWithDps) IsStarted ¶
func (h *RequestHandlerWithDps) IsStarted() bool
func (*RequestHandlerWithDps) Logf ¶
func (h *RequestHandlerWithDps) Logf(template string, args ...interface{})
func (*RequestHandlerWithDps) RestartDps ¶
func (h *RequestHandlerWithDps) RestartDps(opts ...service.Option)
func (*RequestHandlerWithDps) StartDps ¶
func (h *RequestHandlerWithDps) StartDps(opts ...service.Option)
func (*RequestHandlerWithDps) StopDps ¶
func (h *RequestHandlerWithDps) StopDps()
func (*RequestHandlerWithDps) T ¶
func (h *RequestHandlerWithDps) T() *testing.T
type ResourcePlgdDps ¶
type ResourcePlgdDps struct { Endpoint *string `json:"endpoint,omitempty"` EndpointName *string `json:"endpointName,omitempty"` Endpoints []DpsEndpoint `json:"endpoints,omitempty"` LastError uint64 `json:"lastErrorCode,omitempty"` ProvisionStatus string `json:"provisionStatus,omitempty"` ForceReprovision bool `json:"forceReprovision,omitempty"` Interfaces []string `json:"if,omitempty"` ResourceTypes []string `json:"rt,omitempty"` TestProperties ResourcePlgdDpsTest `json:"test,omitempty"` }
type ResourcePlgdDpsTest ¶
type ResourcePlgdDpsTest struct { CloudStatusObserver ResourcePlgdDpsTestCloudStatusObserver `json:"cloudStatusObserver,omitempty"` Iotivity ResourcePlgdDpsTestIotivity `json:"iotivity,omitempty"` }
type ResourcePlgdDpsTestCloudStatusObserver ¶
type ResourcePlgdDpsTestCloudStatusObserver struct {
MaxCount int64 `json:"maxCount,omitempty"`
}
type ResourcePlgdDpsTestIotivity ¶
type ResourcePlgdDpsTestIotivity struct {
Retry []int64 `json:"retry,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.