[riot-notifications] [RIOT-OS/RIOT] tests: add tests for netdev flooding race-condition (#11256)
notifications at github.com
Sun Mar 24 16:28:10 CET 2019
The RIOT community cares a lot about code quality.
Therefore, before describing what your contribution is about, we would like
you to make sure that your modifications are compliant with the RIOT
coding conventions, see https://github.com/RIOT-OS/RIOT/wiki/Coding-conventions.
### Contribution description
While working on #11068, I noticed a race condition within the state machine (see p. 51 in the [datasheet](http://ww1.microchip.com/downloads/en/devicedoc/atmel-8351-mcu_wireless-at86rf233_datasheet.pdf)) of the `at86rf2xx` device driver:
This PR introduces two accompanying applications that reproduce this race condition.
- A `netdev_flood_flooder` that sends IEEE 802.15.4 frames periodically every 5ms
- A `netdev_flood_replier` that receives those frames and tries to reply to them with different content after a 2ms delay
If they would succeed the `netdev_flood_replier` application would just receive the frames sent by `netdev_flood_flooder`, however due to the discovered race condition it may happen that it reads the data it just sent.
Put here the description of your contribution:
- describe which part(s) of RIOT is (are) involved
- if it's a bug fix, describe the bug that it solves and how it is solved
- you can also give more information to reviewers about how to test your changes
### Testing procedure
In general: check the READMEs, they should describe it very well. But here is the rundown.
Compile and flash `tests/netdev_flood_flooder` first
make -C tests/netdev_flood_flooder flash
Check the output with
make -C tests/netdev_flood_flooder term
Then compile and flash `tests/netdev_flood_replier` too
make -C tests/netdev_flood_replier flash
Use the `make test` target to check the output. If the following message is **not** shown it is successful (which it shouldn't be in the current master).
Unexpected payload. This test failed!
Details steps to test your contribution:
- which test/example to compile for which board and is there a 'test' command
- how to know that it was not working/available in master
- the expected success test output
### Issues/PRs references
Issue made clear with these tests was found and is making problems for #11068.
Examples: Fixes #1234. See also #5678. Depends on PR #9876.
Please use keywords (e.g., fixes, resolve) with the links to the issues you
resolved, this way they will be automatically closed when your pull request
is merged. See https://help.github.com/articles/closing-issues-using-keywords/.
You can view, comment on, or merge this pull request online at:
-- Commit Summary --
* tests: add tests for netdev flooding race-condition
-- File Changes --
A tests/netdev_flood_flooder/Makefile (15)
A tests/netdev_flood_flooder/README.md (43)
A tests/netdev_flood_flooder/main.c (212)
A tests/netdev_flood_flooder/netdev_flood.h (59)
A tests/netdev_flood_replier/Makefile (19)
A tests/netdev_flood_replier/README.md (34)
A tests/netdev_flood_replier/main.c (306)
A tests/netdev_flood_replier/tests/01-run.py (22)
-- Patch Links --
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the notifications