Skip to content

Test harness; improved driver API; bugfixing - #109

Open
ivmarkov wants to merge 51 commits into
esp-rs:mainfrom
sysgrok:test-harness
Open

Test harness; improved driver API; bugfixing#109
ivmarkov wants to merge 51 commits into
esp-rs:mainfrom
sysgrok:test-harness

Conversation

@ivmarkov

@ivmarkov ivmarkov commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

This (large) PR introduces the capability to run the upstream OpenThread functional (Python), timing (Python) and expect (TCL dsl) end-to-end tests on binaries built with the openthread crate.

The benefit of running these end-to-end tests on top of openthread-derived binaries is that this way we can properly test the two openthread aspects which are not just a trivial "safe Rust API for C OpenThread":

  • The whole async "platform" implementation of openthread (the otPlat* functions) that revolves around the async Radio trait, the async alarms (embassy-time) and so on.
  • The concrete 802.15.4 Radio driver implementation which is compiled in the openthread-derived binary.

The tests can run in the following mode of operation:

  1. (CI) With simulated radio (See SimRadio in openthread/tests; it goes over UDP);
  2. (CI) With "virtual time" radio; VT tests run much shorter; radio is still simulated; (see VtRadio in openthread/tests)
  3. (Manual for now, needs hardware in the loop) With the SpinelRadio and a real ot_rcp hardware dongle. This is a HIL test but it does NOT test our Radio drivers, as the Spinel radio instead works with the standard ot_rcp ESP-IDF or NRF52 firmware flashed on the controller which is used as a USB dongle; this setup however DOES test the Spinel radio driver itself, of course, which is just as important
  4. (Manual for now, needs hardware in the loop) A native non-spinel firmware based on the EspRadio or NrfRadio and then flashed with espflash or probe-rs UPDATE: or any other, like the nrf-802154 as long as it has a compliant cli_node test driver binary; DOES test the actual radio. Needs a manual step for flashing

In terms of changes:

openthread/tests

The majority. A brand new sub-project tree, whose purpose is to contain openthread-derived binaries which can be driven with OT CLI commands over a serial protocol.

Similar to rs-matter/tests.

openthread/xtask

Extended with an itest sub-module and corresponding command line args, which is the way to invoke the E2E tests.

Similar to rs-matter/xtask. Check .github/itest/yml for more info

openthread

The crate DID see some changes and bugfixes as a result of running the tests. In particular:

Safe wrappers for the OpenThread CLI API

openthread-derived binaries now have a small type-safe API for supporting a "console".
Necessary, or else our binaries cannot be commanded by the E2E tests what to do, which goes via the OT CLI.

Over what protocol the console goes is platform specific of course and up to the user to wire; openthread/tests/esp uses USB-serial. The Spinel radios - as they run on the host itself - just use their stdin/out.

radio.rs module cleanup

This is the most obtrusive change, sorry. The radio.rs module was already sitting at 2K+ lines and after some additions / bugfixes crossed the 3K line. It is now split into sub-modules.

Support for rssi / otPlatRadioGetRssi

We now report the last RSSI/LQI received by the last incoming frame

Support for otPlatRadio*SrcMatch

These platform callbacks allow OpenThread to tell the 802.15.4 driver which children have data (which determines the setting/clearing of the pending bit as per esp-rs/esp-hal#6090

@ivmarkov
ivmarkov force-pushed the test-harness branch 4 times, most recently from a22c19f to 47f9e4e Compare August 13, 2026 13:54
@ivmarkov
ivmarkov force-pushed the test-harness branch 2 times, most recently from 12b954c to 3c11414 Compare August 14, 2026 07:18
@ivmarkov
ivmarkov marked this pull request as ready for review August 14, 2026 18:56
@ivmarkov

Copy link
Copy Markdown
Collaborator Author

@bjoernQ This is ready now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant