spec

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package spec implements a reusable specification test for MQTT brokers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticationTest

func AuthenticationTest(t *testing.T, config *Config)

AuthenticationTest tests the broker for valid and invalid authentication.

func CleanStoredSubscriptionsTest

func CleanStoredSubscriptionsTest(t *testing.T, config *Config, topic string)

CleanStoredSubscriptionsTest tests the broker for properly clearing stored subscriptions.

func CleanWillTest

func CleanWillTest(t *testing.T, config *Config, topic string)

CleanWillTest tests the broker for properly handling will messages on a clean disconnect.

func ClearRetainedMessageTest

func ClearRetainedMessageTest(t *testing.T, config *Config, topic string)

ClearRetainedMessageTest tests the broker for clearing retained messages.

func DirectClearRetainedMessageTest

func DirectClearRetainedMessageTest(t *testing.T, config *Config, topic string)

DirectClearRetainedMessageTest tests the broker for properly dispatching a messages intended to clear a retained message.

func DirectRetainedMessageTest

func DirectRetainedMessageTest(t *testing.T, config *Config, topic string)

DirectRetainedMessageTest tests the broker for properly handling subscriptions with retained messages.

func DuplicateSubscriptionTest

func DuplicateSubscriptionTest(t *testing.T, config *Config, topic string)

DuplicateSubscriptionTest tests the broker for properly handling duplicate subscriptions.

func IsolatedSubscriptionTest

func IsolatedSubscriptionTest(t *testing.T, config *Config, topic string)

IsolatedSubscriptionTest tests the broker for properly isolating subscriptions.

func KeepAliveTest

func KeepAliveTest(t *testing.T, config *Config)

KeepAliveTest tests the broker for proper keep alive support.

func KeepAliveTimeoutTest

func KeepAliveTimeoutTest(t *testing.T, config *Config)

KeepAliveTimeoutTest tests the broker for proper keep alive timeout detection support.

func MultipleSubscriptionTest

func MultipleSubscriptionTest(t *testing.T, config *Config, topic string)

MultipleSubscriptionTest tests the broker for properly handling multiple subscriptions.

func OfflineSubscriptionRetainedTest

func OfflineSubscriptionRetainedTest(t *testing.T, config *Config, topic string, sub, pub uint8, await bool)

OfflineSubscriptionRetainedTest tests the broker for properly handling retained messages and offline subscriptions.

func OfflineSubscriptionTest

func OfflineSubscriptionTest(t *testing.T, config *Config, topic string, sub, pub uint8, await bool)

OfflineSubscriptionTest tests the broker for properly handling offline subscriptions.

func OverlappingSubscriptionsTest

func OverlappingSubscriptionsTest(t *testing.T, config *Config, pub, sub string)

OverlappingSubscriptionsTest tests the broker for properly handling overlapping subscriptions.

func PublishResendQOS1Test

func PublishResendQOS1Test(t *testing.T, config *Config, topic string)

PublishResendQOS1Test tests the broker for properly retrying QOS1 publish packets.

func PublishResendQOS2Test

func PublishResendQOS2Test(t *testing.T, config *Config, topic string)

PublishResendQOS2Test tests the broker for properly retrying QOS2 Publish packets.

func PublishSubscribeTest

func PublishSubscribeTest(t *testing.T, config *Config, pub, sub string, subQOS, pubQOS uint8)

PublishSubscribeTest tests the broker for basic pub sub support.

func PubrelResendQOS2Test

func PubrelResendQOS2Test(t *testing.T, config *Config, topic string)

PubrelResendQOS2Test tests the broker for properly retrying QOS2 Pubrel packets.

func RemoveStoredSubscriptionTest

func RemoveStoredSubscriptionTest(t *testing.T, config *Config, topic string)

RemoveStoredSubscriptionTest tests the broker for properly removing stored subscriptions.

func RetainedMessageReplaceTest

func RetainedMessageReplaceTest(t *testing.T, config *Config, topic string)

RetainedMessageReplaceTest tests the broker for replacing existing retained messages.

func RetainedMessageResubscriptionTest

func RetainedMessageResubscriptionTest(t *testing.T, config *Config, topic string)

RetainedMessageResubscriptionTest tests the broker for properly dispatching retained messages on resubscription.

func RetainedMessageTest

func RetainedMessageTest(t *testing.T, config *Config, out, in string, sub, pub uint8)

RetainedMessageTest tests the broker for properly handling retained messages.

func RetainedWillTest

func RetainedWillTest(t *testing.T, config *Config, topic string)

RetainedWillTest tests the broker for support of retained will messages.

func RootSlashDistinctionTest

func RootSlashDistinctionTest(t *testing.T, config *Config, topic string)

RootSlashDistinctionTest tests the broker for supporting the root slash distinction.

func Run

func Run(t *testing.T, config *Config)

Run will fully test a to support all specified features in the matrix.

func StoredSubscriptionsTest

func StoredSubscriptionsTest(t *testing.T, config *Config, topic string, qos uint8)

StoredSubscriptionsTest tests the broker for properly handling stored subscriptions.

func SubscriptionUpgradeTest

func SubscriptionUpgradeTest(t *testing.T, config *Config, topic string, from, to uint8)

SubscriptionUpgradeTest tests the broker for properly upgrading subscriptions,

func UniqueClientIDCleanTest added in v0.6.0

func UniqueClientIDCleanTest(t *testing.T, config *Config)

UniqueClientIDCleanTest tests the broker for enforcing unique client ids.

func UniqueClientIDUncleanTest added in v0.6.0

func UniqueClientIDUncleanTest(t *testing.T, config *Config)

UniqueClientIDUncleanTest tests the broker for enforcing unique client ids.

func UnsubscribeNotExistingSubscriptionTest

func UnsubscribeNotExistingSubscriptionTest(t *testing.T, config *Config, topic string)

UnsubscribeNotExistingSubscriptionTest tests the broker for allowing unsubscribing not existing topics.

func UnsubscribeOverlappingSubscriptions

func UnsubscribeOverlappingSubscriptions(t *testing.T, config *Config, topic string)

UnsubscribeOverlappingSubscriptions tests the broker for properly unsubscribing overlapping topics.

func UnsubscribeTest

func UnsubscribeTest(t *testing.T, config *Config, topic string, qos uint8)

UnsubscribeTest tests the broker for unsubscribe support.

func WillTest

func WillTest(t *testing.T, config *Config, topic string, sub, pub uint8)

WillTest tests the broker for supporting will messages.

Types

type Config

type Config struct {
	URL     string
	DenyURL string

	RetainedMessages     bool
	StoredPackets        bool
	StoredSubscriptions  bool
	OfflineSubscriptions bool
	Authentication       bool
	UniqueClientIDs      bool
	RootSlashDistinction bool

	// ProcessWait defines the time some tests should wait and let the broker
	// finish processing (e.g. properly terminating a connection)
	ProcessWait time.Duration

	// MessageRetainWait defines the time retain test should wait to be sure
	// the published messages has been retained.
	MessageRetainWait time.Duration

	// NoMessageWait defines the time some tests should wait for eventually
	// receiving a wrongly sent message or an error.
	NoMessageWait time.Duration
	// contains filtered or unexported fields
}

A Config defines which features should be tested.

func AllFeatures

func AllFeatures() *Config

AllFeatures returns a config that enables all features.

Jump to

Keyboard shortcuts

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