mirror of
https://github.com/espressif/esp-mqtt.git
synced 2026-06-05 21:04:46 +00:00
37a2e555c5
Adds a conformance test app based on paho test suite. This introduce the basis infrastructure and initial tests.
MQTT conformance app (HIL)
This app exposes a console API for pytest-embedded HIL tests that target MQTT conformance behavior.
Console commands
init: Create and configure MQTT clientset_uri <uri>: Override broker URI beforestartstart: Start MQTT clientstop: Stop MQTT clientdestroy: Destroy MQTT clientsubscribe <topic> <qos>: Subscribe to topicpublish <topic> <pattern> <pattern_repetitions> <qos> <retain> <enqueue>: Publish payload
Conformance mapping
Each pytest case should document the MQTT specification section it validates where practical.
The paho reference suite is integrated as git submodule at:
test/tools/paho.mqtt.testing
Running tests locally
From the repository root (or the mqtt worktree root if using worktrees):
-
Ensure the environment is active (e.g.
direnv allowat repo root so IDF and pytest-embedded are available). -
Initialize the paho.mqtt.testing submodule:
git submodule update --init --recursive test/tools/paho.mqtt.testing -
Run the conformance tests (connect a board with Ethernet, or use the same target/port as in CI):
pytest test/apps/mqtt_conformance/ -vTo run a single test or filter by keyword, add e.g.
-k test_mqtt_v311or the test path.