Commit Graph
2 Commits
Author SHA1 Message Date
HarukiToreda 6fa3df0af3 node bridge 2026-09-14 16:20:07 -04:00
James RichandClaude Opus 5 890f12ec27 Add native tests for the BLE mesh transport
Thirteen cases over the half of the transport that has no BLE in it: building an
advertisement, the ingress guards, the TX ring and the readiness pump. Full
suite 1385/1385.

Testable because BLEMeshHandler has no platform BLE dependency - ESP32BLEMesh
and NRF52BLEMesh do - so native now compiles it via HAS_BLE_MESH=1 on
native_base. Nothing runs there: main() instantiates neither platform subclass
on portduino, so bleMeshHandler stays null.

Adds one seam for it. deliverToRouter called router->enqueueReceivedMessage
directly, which meant the ingress guards could only be tested by standing up a
live Router; it now goes through a virtual enqueueReceived() that the test
overrides to observe what survives. Production always takes the default.

The cases are the bugs this transport actually had, or the ones its guards
exist to stop: a relayed packet must not be refused (refusing it capped the mesh
at one hop), onSend must queue rather than transmit (advertising inline stalled
the router for the length of every burst), a spoofed from=0 and an out-of-range
hop count must be dropped, claimed PKI authentication must be stripped rather
than believed off the wire, and our own advertisement heard by our own scanner
must not loop back in.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-01 16:35:08 -05:00