tractor/tests/ipc
Gud Boi 850d42cee0 Add the `TIPC_TOP_SRV` name-event wire codec
First half of plan 01 §5.2 (layer B): the `struct` layouts and
the `TIPCNameEvent` type for the kernel's *push-based* name
table, w/o any socket plumbing yet. Pure-python, so it tests
w/o a loaded `tipc` module.

Deats,
- `_SUBSCR_FMT = '=5I8s'` (28B `struct tipc_subscr`) and
  `_EVENT_FMT = '=10I8s'` (48B `struct tipc_event`).
- `_mk_subscr()` masks the timeout: python exposes
  `TIPC_WAIT_FOREVER` as **`-1`** which `struct` flat refuses
  to pack into an unsigned `'I'`.
- `_decode_name_event()` *drops* runt frames and unknown event
  codes rather than raising — a confused kernel must not be
  able to kill the reader task.

XXX two corrections to what the plan §5.2 sketch claimed, both
verified against a live kernel,
- the event is **48B** (`4+4+4+8+28`), NOT 40.
- native (`'='`) byte-order is **accepted**; publish+withdraw
  both round-tripped w/ the 28B subscription echoed back
  intact. So the proposed `_detect_topsrv_endianness()` `'>'`
  retry-probe is unnecessary and is NOT implemented.

Note the event carries no *scope* — the name-table doesn't
report one — so the decoded `.addr` echoes the subscription's
own rather than pretending to observe it.

(this patch was generated in some part by `claude-code` using `claude-opus-5` (`anthropic`))
2026-09-01 20:00:29 -04:00
..
__init__.py Start a very basic ipc-server unit test suite 2025-07-13 15:26:37 -04:00
test_channel_tunnel_boundary.py Move network APIs to lazy `tractor.net` 2026-09-01 18:10:53 -04:00
test_each_tpt.py Emit canonical tagged addresses 2026-09-01 15:47:28 -04:00
test_multi_tpt.py Add `enable_transports`/`registry_addrs` proto guard 2026-06-17 17:39:44 -04:00
test_server.py Add `Address.rebind_from_sockname` opt-out 2026-09-01 19:28:17 -04:00
test_server_tunnel_boundary.py Move network APIs to lazy `tractor.net` 2026-09-01 18:10:53 -04:00
test_tipc.py Add the `TIPC_TOP_SRV` name-event wire codec 2026-09-01 20:00:29 -04:00