Add hardware-in-the-loop and fault injection tests - #282
Conversation
Docs updated, implemented 4 more tests, improved existing tests Fixes for CI Added Android to HIL tests
|
@usmanmehmood55 thanks for the PR. Would https://www.adafruit.com/product/3406 or https://www.ebay.de/itm/406283688259 work? |
|
@fotiDim technically yes, but both of these boards have different ways of installing/flashing the firmware onto the boards, compared to the standard nRF development kit. They use UART over the USB port, and need the firmware to be partitioned in their specific bootloader's styles, so I'd have to get one myself and test out the flashing process and do some trial and error on the partition sizes etc. They also might require a physical button to be pressed during every installation/flashing, which would make CI automation difficult. Standard nRF52 devkits have onboard flasher/debugger, so it'll work right out of the box, and won't require physical button presses. I will look into the Adafruit board, it might be easier than the ebay link one. But again, the standard devkit would be the easiest. |
|
HIL has analysis errors: Also since the PR is large do you think it could be broken down into smaller ones? |
|
It seems I was on Flutter 3.44.3 (Dart 3.12.2), and you were on the latest Flutter 3.47.0 (Dart 3.13.0). I've upgraded my side and fixed the issues.
Yes, I agree. Maybe I should split the PR into HIL tests, and production code improvements. |
Restore pre-HIL Windows implementation
|
@fotiDim The windows production code changes have been moved out of this PR, so now only 15 changed files remain. I also had an idea about the nRF52 devkits. Perhaps we could contact Nordic Semi about providing you the devkits. They often send out free devkits for evaluations and are very supportive of open source work related to their products. I think they'll find this use case worthwhile. We can ask them for 3-4 devkits, and can scale the tests to use 3-4 BLE instances. This will allow us to test concurrency in a nice way. |
Good thinking. I contacted them already... |
Co-authored-by: Foti Dim <foti@navideck.com>
|
@usmanmehmood55 should we expect another PR for Windows hardening? |
Summary
This PR adds a hardware-in-the-loop (HIL) test suite for
universal_ble.The fixture is a physical nRF52 DK running purpose-built Zephyr firmware. The firmware lives in the separate universal_ble_hil_firmware repository.
The Windows suite currently has 64 working tests:
The host controls the fixture over BLE. USB serial is used for firmware logs.
What the tests cover
The baseline suite covers:
The FIT suite arms the firmware with a fault plan before starting an ordinary BLE operation. The fixture can then:
Most tests also verify recovery. After the injected failure, the test performs another read, write, reconnect, or subscription. This catches cases where the original call fails correctly but leaves the connection or operation queue in a broken state.
These tests go through the complete path: Dart API, operation queue, Pigeon, Windows C++, WinRT, Windows Bluetooth stack, the radio link, and finally the Zephyr GATT server. This gives us coverage which mocks and software-only tests cannot provide.
Running the suite
These are manual hardware tests. They are not intended to run in normal pull-request CI because they require an nRF52 DK and exclusive access to a Bluetooth adapter.
Platform runners are generated locally and are not committed:
Flash HIL fixture firmware, and run the tests: