-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mosq): Add target tests with localhost broker-client
- Loading branch information
1 parent
3acb6c9
commit ccd9514
Showing
2 changed files
with
64 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD | ||
# SPDX-License-Identifier: Unlicense OR CC0-1.0 | ||
|
||
def test_mosq_local(dut): | ||
""" | ||
steps: | ||
1. Start mosquitto broker | ||
2. Start mqtt client | ||
3. Checks that the client connected to broker | ||
4. checks that the client received published data | ||
""" | ||
# We expect the client to connect from IPv4 localhost address | ||
dut.expect('New client connected from 127.0.0.1') | ||
# We expect the client to get "connected" event and receive the published data | ||
dut.expect('MQTT_EVENT_CONNECTED') | ||
dut.expect('MQTT_EVENT_DATA') | ||
dut.expect('TOPIC=/topic/qos0') | ||
dut.expect('DATA=data') |