Fix 4 pre-existing legacy-test failures
Three distinct root causes, all pre-existing on master and confirmed
there with the same symptoms:
1. tests/generate_configs.py was missing COMMAND_PTY=, so the reflector
never opened its admin PTY. Every PTY-driven test (MUTE, UNMUTE, CFG,
TRUNK RELOAD) wrote to a regular file that nobody read. Adding the
config entry makes those commands actually reach the reflector, fixing
test_24_pty_trunk_mute and test_25_pty_trunk_reload.
2. TrunkLink::statusJson built active_talkers by iterating the global
trunk-talker map and filtering by isSharedTG(tg), which checks the
peer's remote_prefix. When TG_MAP remaps a peer-owned wire TG to a
local-owned TG, the local TG no longer matches the peer's prefix, so
the view silently dropped it. Iterate m_peer_active_tgs directly
instead — that set already contains post-remap local TGs for this
specific peer. Fixes test_22_tg_map_remap_in.
3. Python test harness parsed MsgTrunkNodeList vector-length prefixes as
u32 ('!I'), but AsyncMsg.h MsgPacker<std::vector> emits u16 lengths.
The parser mis-read into garbage at huge offsets and crashed with a
struct.error. Switch read_vec_str/u32/f32 to u16 ('!H') to match the
wire format. Fixes test_27_node_list_emitted.
Legacy suite: 27/27 passing (was 23/27).
Redis suite: 10/10 still passing.
This commit is contained in:
1 parent
16a98f3562
commit
ba3b100361
3 files changed
+15
-8
No files matched your search
@@ -24,6 +24,7 @@ def generate_reflector_conf(name: str) -> str:
|
||||
f"CLUSTER_TGS={cluster_str}",
|
||||
f"TRUNK_LISTEN_PORT={T.INTERNAL_TRUNK_PORT}",
|
||||
f"HTTP_SRV_PORT={T.INTERNAL_HTTP_PORT}",
|
||||
"COMMAND_PTY=/dev/shm/reflector_ctrl",
|
||||
"TRUNK_DEBUG=1",
|
||||
"",
|
||||
"[SERVER_CERT]",
|
||||
|
||||
+5
-3
@@ -205,8 +205,10 @@ def parse_msg(data: bytes):
|
||||
elif msg_type == MSG_TRUNK_NODE_LIST:
|
||||
# vec<string> callsigns, vec<u32> tgs, vec<float> lat, vec<float> lon,
|
||||
# vec<string> qth_names. Each vector is u32-prefixed length.
|
||||
# Vector length prefixes are u16 (MsgPacker<std::vector> in
|
||||
# AsyncMsg.h uses uint16_t for element counts).
|
||||
def read_vec_str(off):
|
||||
n = struct.unpack_from("!I", data, off)[0]; off += 4
|
||||
n = struct.unpack_from("!H", data, off)[0]; off += 2
|
||||
out = []
|
||||
for _ in range(n):
|
||||
s, off = unpack_string(data, off)
|
||||
@@ -214,13 +216,13 @@ def parse_msg(data: bytes):
|
||||
return out, off
|
||||
|
||||
def read_vec_u32(off):
|
||||
n = struct.unpack_from("!I", data, off)[0]; off += 4
|
||||
n = struct.unpack_from("!H", data, off)[0]; off += 2
|
||||
out = list(struct.unpack_from(f"!{n}I", data, off))
|
||||
off += 4 * n
|
||||
return out, off
|
||||
|
||||
def read_vec_f32(off):
|
||||
n = struct.unpack_from("!I", data, off)[0]; off += 4
|
||||
n = struct.unpack_from("!H", data, off)[0]; off += 2
|
||||
out = list(struct.unpack_from(f"!{n}f", data, off))
|
||||
off += 4 * n
|
||||
return out, off
|
||||
|
||||
Reference in new issue
Block a user