Files
pyxis/tests
torlando-agent[bot]andClaude Opus 4.8 092fbedc44 test: on-device LXMF e2e harness with bz2-on-receive probe
tests/hardware/ drives a flashed T-Deck through LXMF round-trips against a
Mac-side echo bot over the device's TCP-client -> rnsd link, via the firmware's
-DPYXIS_TEST_HOOKS T: command surface.

- run_e2e.sh: orchestrator -- autodetect serial port + Mac IP, verify rnsd on
  :4242, build+flash with the TCP target baked in, run the harness, assert.
- tdeck_harness.py: resets the device, establishes path/identity with the bot,
  then runs a bz2-on-receive probe + DIRECT/OPPORTUNISTIC (and PROPAGATED when
  PYXIS_PROPAGATION_NODE_HEX is set) round-trips, watching for crash signatures.
- lxmf_echo_bot.py: Mac-side LXMF echo bot; on a BZ2PROBE trigger it replies
  with a ~1.5KB highly-compressible payload so python LXMF sends a bz2-COMPRESSED
  Resource, exercising the receiver's decompress-on-receive path.

Parametrized -- serial port, Mac IP, and propagation-node hash all come from the
environment; nothing deployment-specific is committed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UWZuYkHBRqNb6BZHV8sTG5
2026-06-19 15:49:44 -04:00
..
2026-05-04 14:50:16 -04:00

Pyxis Tests

Three test surfaces, each runnable independently.

1. Pyxis-unique pytest suite

Native C++ tests of pyxis-unique code (BLE fragmenter, HDLC, etc.) and Python tests of build scripts.

/usr/bin/python3 -m pytest tests/build_scripts tests/native -v

System Python 3.9 has pytest pre-installed; Homebrew Python does not.

  • build_scripts/test_patch_nimble.py — verifies patch_nimble.py idempotency, drift detection, missing-file handling
  • native/test_hdlc.{cpp,py} — HDLC escape/unescape/frame round-trip + golden vector against Python RNS
  • native/test_ble_fragmenter.{cpp,py} — BLEFragmenter ↔ BLEReassembler: in-order, out-of-order, duplicate, dropped+timeout, per-peer isolation, MTU change
  • native/test_ble_peer_manager.{cpp,py} — connection-map state machine: discover, identity promotion, blacklist, handle map cleanup, MAC rotation, pool exhaustion
  • native/test_ble_operation_queue.{cpp,py} — GATT op queue: FIFO, busy-state, timeout, clearForConnection, builder
  • native/test_ring_buffers.{cpp,py} — PCM + encoded SPSC ring buffers, including 100k-frame multithreaded producer/consumer stress
  • native/test_audio_filters.{cpp,py} — VoiceFilterChain frequency response, peak limiting, multichannel

Adding a new native C++ test

Pattern: pure C++ unit + thin pytest wrapper.

  1. Write tests/native/test_<thing>.cpp — include from ../../{src,lib/...} for the unit under test, use the existing EXPECT_EQ/EXPECT_TRUE/RUN(name) framework, return non-zero on any failure.
  2. If the unit pulls in microReticulum types, the shims in tests/native/ cover what's been needed so far:
    • Bytes.hbytes_shim.h (minimal RNS::Bytes — append/data/size/writable/resize/mid)
    • Log.h (no-op TRACE/WARNING/INFO/ERROR macros)
    • Utilities/OS.h (OS::time() with set_fake_time()/clear_fake_time())
  3. Write tests/native/test_<thing>.py — copy the test_hdlc.py template, swap source/include paths, run.
  4. Confirm: /usr/bin/python3 -m pytest tests/native/test_<thing>.py -v

2. LXST audio interop tests

Python tests verifying wire format and codec compatibility between pyxis (C++), Python LXST, and LXST-kt (Kotlin).

/usr/bin/python3 -m pytest tests/interop -v

Requires pycodec2 and access to $HOME/repos/public/LXST.

3. microReticulum native unit tests (PlatformIO)

The fork's microReticulum tests live under deps/microReticulum/test/ and run via PlatformIO Unity.

cd deps/microReticulum && pio test -e native17

Use native17, not native — the C++11 env is broken (static-constexpr ODR-use). Baseline as of 2026-05-02: 94/114 PASS, 7 FAIL, 5 SKIPPED, 7 suites ERRORED. The clean suites are test_os, test_bytes, test_msgpack, test_crypto, test_filesystem, test_objects, test_interop, test_general, test_reference, test_example, test_collections.