tools/migrate_obp_rules.py reads hblink.cfg (to learn which systems are OPENBRIDGE) and an old-form rules.py, lifts every inline OBP member into an OBP_BRIDGES table, drops any bridge left empty (OBP_BRIDGES recreates it at load), flags ingress-fork ERRORs and renumber WARNINGs, prints a summary, and writes a new file (never overwrites rules.py). Comments are not preserved. tests/test_obp_bridges.py gains a round-trip proof: an old inline config migrated then loaded the new way yields identical routing indexes, plus fork/renumber/TS-override/empty-bridge cases (74 tests total, all green). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Tests
Regression tests pinning the behavior of helpers extracted during the 2026 cleanup. They exist because a live OBP/HBP network with real DMR audio cannot be reproduced in a dev environment, so the routing helpers are validated in isolation instead.
test_acl.py—HBSYSTEM.dmrd_acl_check()(the shared master/peer ACL logic): PERMIT/DENY matching, per-timeslot scoping, and the once-per-stream drop logging.test_lc.py—gen_lcs()andembed_lc()frombridge.py: Link Control generation and the DMR payload LC rewrite used by all four group-routing paths.
Running
From the repo root, using the project virtualenv (which has twisted,
dmr_utils3, and bitarray):
venv/bin/python -m unittest discover -s tests -v
Pure stdlib unittest — no extra dependencies. They also run under pytest if
you have it installed (venv/bin/python -m pytest tests).