publishing: MQTT works in satellite mode + Redis publishes per-client status blob

- Move MQTT init above the satellite early-return in Reflector::initialize so
  satellite-mode reflectors publish to MQTT (client connect/disconnect, talker
  events, full status, etc.) just like full reflectors.
- Add reflector-sat (SATELLITE_OF=reflector-a) to the default test compose so
  satellite mode is exercised end-to-end. New test_31 verifies MQTT
  client-connect/disconnect events under the satellite's own topic prefix.
- Add RedisStore::pushClientStatus and Reflector::publishClientStatus to write
  the per-client status JSON (qth, rx siglev/sql_open/enabled/active,
  monitoredTGs, selected TG, ...) to live:client:<callsign>.status. Hooked
  from publishRxUpdate, handleNodeInfo, setMonitoredTGs, and setTg.
- New Redis test_live_client_status_blob sends a synthetic MsgNodeInfoV2 with
  qth+rx and asserts the parsed blob contains the expected fields.

31/31 trunk + 10/10 twin + 14/14 redis pass.
This commit is contained in:
Audric committed 2026-04-17 01:05:37 +02:00
1 parent 6b7a1f0306
commit 688a62ec5b
10 files changed
+299 -33

No files matched your search

+22
View File
@@ -61,6 +61,15 @@ SATELLITE = {
"listen_port": 5303,
}
# A real satellite-mode reflector — runs as a satellite of the primary
# reflector. Used to verify that satellite mode preserves features like
# MQTT publishing and the V2 client server.
SATELLITE_NODE = {
"name": "sat",
"id": "SAT_NODE",
"port_base": 55000,
}
# Redis broker — used by reflectors flagged `redis: True`.
# Each reflector uses its own DB index to avoid pollution between tests.
REDIS = {
@@ -206,6 +215,19 @@ def service_name(name: str) -> str:
def mapped_satellite_port(name: str) -> int:
return REFLECTORS[name]["trunk_port_base"] + 303
def sat_node_service_name() -> str:
return f"reflector-{SATELLITE_NODE['name']}"
def sat_node_parent() -> str:
"""Parent reflector that the satellite-mode node attaches to."""
return sorted(REFLECTORS)[0]
def sat_node_mapped_client_port() -> int:
return SATELLITE_NODE["port_base"] + 300
def sat_node_mapped_http_port() -> int:
return SATELLITE_NODE["port_base"] + 3080
def trunk_section_name(name_a: str, name_b: str = "") -> str:
"""Shared trunk section name for a link between two reflectors.