mirror of
https://github.com/agessaman/meshcore-bot.git
synced 2026-08-28 05:14:12 +00:00
Add live and offline packet-parsing tests using paho-mqtt: - tests/test_mqtt_live.py: schema validation + live integration tests; subscribes to meshcore/SEA/+/packets; validates JSON against schema - tests/mqtt_test_config.ini: broker/topic/timeout config; primary LAN broker (10.0.2.123:1883); letsmesh as documented alternative - tests/fixtures/mqtt_packets.json: 8 real packets from SEA region for offline fallback Run live: pytest -m mqtt Run offline: pytest -m "not mqtt" Collect fixtures: python tests/test_mqtt_live.py --collect-fixtures
58 lines
1.8 KiB
INI
58 lines
1.8 KiB
INI
# MQTT Integration Test Configuration
|
|
# Used by tests/test_mqtt_live.py to connect to letsmesh public MQTT servers
|
|
# and subscribe to live MeshCore packet streams for parser validation.
|
|
#
|
|
# To run the live integration tests:
|
|
# pytest tests/test_mqtt_live.py -v -m mqtt
|
|
#
|
|
# Or run the packet collector script:
|
|
# python tests/test_mqtt_live.py --collect-fixtures
|
|
|
|
[MQTT_Test]
|
|
# Primary broker — LAN/local MQTT server (plain TCP, no TLS)
|
|
# This server forwards live MeshCore packets from the SEA region.
|
|
broker = 10.0.2.123
|
|
port = 1883
|
|
transport = tcp
|
|
use_tls = false
|
|
websocket_path =
|
|
|
|
# Alternative: letsmesh public analyzer (WebSocket/TLS on port 443)
|
|
# Requires JWT auth token — set username/password or use_auth_token.
|
|
# Uncomment to use letsmesh instead:
|
|
#
|
|
# broker = mqtt-us-v1.letsmesh.net
|
|
# port = 443
|
|
# transport = websockets
|
|
# use_tls = true
|
|
# websocket_path = /mqtt
|
|
|
|
# Topic to subscribe to for live packet data.
|
|
# Format: meshcore/{IATA}/{station_id}/packets
|
|
# Use + wildcard to receive from all stations in a region.
|
|
topic_subscribe = meshcore/SEA/+/packets
|
|
|
|
# Optional: subscribe to status messages too (for node metadata)
|
|
topic_status = meshcore/SEA/+/status
|
|
|
|
# How long to wait for packets before timing out (seconds)
|
|
timeout_seconds = 15
|
|
|
|
# Maximum packets to collect before stopping
|
|
max_packets = 10
|
|
|
|
# Authentication (leave blank for anonymous/unauthenticated access)
|
|
# If the broker requires credentials, set these.
|
|
username =
|
|
password =
|
|
|
|
# Client ID prefix (a random suffix will be appended automatically)
|
|
client_id_prefix = meshcore-test-
|
|
|
|
# Regions to subscribe to (comma-separated IATA codes)
|
|
# Add more regions to get more test data
|
|
regions = SEA
|
|
|
|
# Output file for collected fixture data (used by --collect-fixtures)
|
|
fixture_output = tests/fixtures/mqtt_packets.json
|