Skip to content

kemilsoderberg/robotframework-mqtt5library

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MQTTLibrary for Robot Framework

PyPI version

MQTTLibrary is a Robot Framework library that provides keywords for testing on MQTT brokers. MQTT is a lightweight protocol for machine-to-machine communication, typically used for IoT messaging. This library uses the paho client library published by eclipse project.

Installation

MQTTLibrary can be installed using pip:

pip install robotframework-mqtt5library

Usage

Import the library:

*** Settings ***
Library          MQTTLibrary

Connect to the broker, publish and disconnect:

*** Test Cases ***
Publish
    Connect    ${brokerhost}    ${brokerport}    ca_cert=${ca_cert}    certfile=${certfile}    keyfile=${keyfile}
    Publish     topic=test/mqtt_test    message=test message
    [Teardown]  Disconnect

Connect to the broker, subscribe and validate that a message is received:

*** Test Cases ***
Subscribe and Validate
    Connect    ${brokerhost}    ${brokerport}    ca_cert=${ca_cert}    certfile=${certfile}    keyfile=${keyfile}
    Subscribe and Validate  topic=test/mqtt_test    qos=2   payload=test
    [Teardown]              Disconnect

Keyword documentation is available at: http://kemilsoderberg.github.io/robotframework-mqtt5library.

For general information about using test libraries with Robot Framework, see Robot Framework User Guide.

Contributing

The keywords in this library are based on some of the methods available in eclipse paho client library. If you'd like to add keywords, see instructions on creating/updating libraries for Robot Framework.

License

MQTT5Library is open source software provided under the Apache License 2.0.

About

MQTTv5 Keyword Library for Robot Framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%