Documentation ¶
Overview ¶
Package spec implements a reusable specification test for MQTT brokers.
Index ¶
- func AuthenticationTest(t *testing.T, config *Config)
- func CleanStoredSubscriptionsTest(t *testing.T, config *Config, topic string)
- func CleanWillTest(t *testing.T, config *Config, topic string)
- func ClearRetainedMessageTest(t *testing.T, config *Config, topic string)
- func DirectClearRetainedMessageTest(t *testing.T, config *Config, topic string)
- func DirectRetainedMessageTest(t *testing.T, config *Config, topic string)
- func DuplicateSubscriptionTest(t *testing.T, config *Config, topic string)
- func IsolatedSubscriptionTest(t *testing.T, config *Config, topic string)
- func KeepAliveTest(t *testing.T, config *Config)
- func KeepAliveTimeoutTest(t *testing.T, config *Config)
- func MultipleSubscriptionTest(t *testing.T, config *Config, topic string)
- func OfflineSubscriptionRetainedTest(t *testing.T, config *Config, topic string, sub, pub packet.QOS, await bool)
- func OfflineSubscriptionTest(t *testing.T, config *Config, topic string, sub, pub packet.QOS, await bool)
- func OverlappingSubscriptionsTest(t *testing.T, config *Config, pub, sub string)
- func PublishResendQOS1Test(t *testing.T, config *Config, topic string)
- func PublishResendQOS2Test(t *testing.T, config *Config, topic string)
- func PublishSubscribeTest(t *testing.T, config *Config, pub, sub string, ...)
- func PubrelResendQOS2Test(t *testing.T, config *Config, topic string)
- func RemoveStoredSubscriptionTest(t *testing.T, config *Config, topic string)
- func RetainedMessageReplaceTest(t *testing.T, config *Config, topic string)
- func RetainedMessageResubscriptionTest(t *testing.T, config *Config, topic string)
- func RetainedMessageTest(t *testing.T, config *Config, out, in string, sub, pub packet.QOS)
- func RetainedWillTest(t *testing.T, config *Config, topic string)
- func RootSlashDistinctionTest(t *testing.T, config *Config, topic string)
- func Run(t *testing.T, config *Config)
- func ServiceRetryTest(t *testing.T, config *Config, topic string, qos packet.QOS)
- func StoredSubscriptionsTest(t *testing.T, config *Config, topic string, qos packet.QOS)
- func SubscriptionUpgradeTest(t *testing.T, config *Config, topic string, from, to packet.QOS)
- func UnexpectedPubrelTest(t *testing.T, config *Config)
- func UniqueClientIDCleanTest(t *testing.T, config *Config)
- func UniqueClientIDUncleanTest(t *testing.T, config *Config)
- func UnsubscribeNotExistingSubscriptionTest(t *testing.T, config *Config, topic string)
- func UnsubscribeOverlappingSubscriptions(t *testing.T, config *Config, topic string)
- func UnsubscribeTest(t *testing.T, config *Config, topic string, qos packet.QOS)
- func WillTest(t *testing.T, config *Config, topic string, sub, pub packet.QOS)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthenticationTest ¶
AuthenticationTest tests the broker for valid and invalid authentication.
func CleanStoredSubscriptionsTest ¶
CleanStoredSubscriptionsTest tests the broker for properly clearing stored subscriptions.
func CleanWillTest ¶
CleanWillTest tests the broker for properly handling will messages on a clean disconnect.
func ClearRetainedMessageTest ¶
ClearRetainedMessageTest tests the broker for clearing retained messages.
func DirectClearRetainedMessageTest ¶
DirectClearRetainedMessageTest tests the broker for properly dispatching a messages intended to clear a retained message.
func DirectRetainedMessageTest ¶
DirectRetainedMessageTest tests the broker for properly handling subscriptions with retained messages.
func DuplicateSubscriptionTest ¶
DuplicateSubscriptionTest tests the broker for properly handling duplicate subscriptions.
func IsolatedSubscriptionTest ¶
IsolatedSubscriptionTest tests the broker for properly isolating subscriptions.
func KeepAliveTest ¶
KeepAliveTest tests the broker for proper keep alive support.
func KeepAliveTimeoutTest ¶
KeepAliveTimeoutTest tests the broker for proper keep alive timeout detection support.
func MultipleSubscriptionTest ¶
MultipleSubscriptionTest tests the broker for properly handling multiple subscriptions.
func OfflineSubscriptionRetainedTest ¶
func OfflineSubscriptionRetainedTest(t *testing.T, config *Config, topic string, sub, pub packet.QOS, 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 packet.QOS, await bool)
OfflineSubscriptionTest tests the broker for properly handling offline subscriptions.
func OverlappingSubscriptionsTest ¶
OverlappingSubscriptionsTest tests the broker for properly handling overlapping subscriptions.
func PublishResendQOS1Test ¶
PublishResendQOS1Test tests the broker for properly retrying QOS1 publish packets.
func PublishResendQOS2Test ¶
PublishResendQOS2Test tests the broker for properly retrying QOS2 Publish packets.
func PublishSubscribeTest ¶
func PublishSubscribeTest(t *testing.T, config *Config, pub, sub string, subQOS, pubQOS, recQOS packet.QOS)
PublishSubscribeTest tests the broker for basic pub sub support.
func PubrelResendQOS2Test ¶
PubrelResendQOS2Test tests the broker for properly retrying QOS2 Pubrel packets.
func RemoveStoredSubscriptionTest ¶
RemoveStoredSubscriptionTest tests the broker for properly removing stored subscriptions.
func RetainedMessageReplaceTest ¶
RetainedMessageReplaceTest tests the broker for replacing existing retained messages.
func RetainedMessageResubscriptionTest ¶
RetainedMessageResubscriptionTest tests the broker for properly dispatching retained messages on resubscription.
func RetainedMessageTest ¶
RetainedMessageTest tests the broker for properly handling retained messages.
func RetainedWillTest ¶
RetainedWillTest tests the broker for support of retained will messages.
func RootSlashDistinctionTest ¶
RootSlashDistinctionTest tests the broker for supporting the root slash distinction.
func ServiceRetryTest ¶ added in v0.14.4
ServiceRetryTest tests the broker for properly retrying messages using two services.
func StoredSubscriptionsTest ¶
StoredSubscriptionsTest tests the broker for properly handling stored subscriptions.
func SubscriptionUpgradeTest ¶
SubscriptionUpgradeTest tests the broker for properly upgrading subscriptions,
func UnexpectedPubrelTest ¶ added in v0.10.1
UnexpectedPubrelTest tests the broker for proper handling of unexpected pubrel packets.
func UniqueClientIDCleanTest ¶ added in v0.6.0
UniqueClientIDCleanTest tests the broker for enforcing unique client ids.
func UniqueClientIDUncleanTest ¶ added in v0.6.0
UniqueClientIDUncleanTest tests the broker for enforcing unique client ids.
func UnsubscribeNotExistingSubscriptionTest ¶
UnsubscribeNotExistingSubscriptionTest tests the broker for allowing unsubscribing not existing topics.
func UnsubscribeOverlappingSubscriptions ¶
UnsubscribeOverlappingSubscriptions tests the broker for properly unsubscribing overlapping topics.
func UnsubscribeTest ¶
UnsubscribeTest tests the broker for unsubscribe support.
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.