Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/ieee802154_hal: extend radio hal test #16591

Closed
wants to merge 2 commits into from

Conversation

LarsKowoll
Copy link

@LarsKowoll LarsKowoll commented Jun 28, 2021

Refers to #15761, because it was hard to rebase

Contribution description

  • spam: Sends as fast and as many packets as specified in the parameters
  • reply: The receiver sends the package back as soon as possible
  • enable_prints: Prints interesting stuff. e.g. received packet. May have to be disabled due to timer issues caused by the printing
  • test_channel: Sends and receive on different channels
  • check_last_packet: Checks if the last packet matches to the expect sender

Testing procedure

There is a automated test in riotctrl. RIOT-OS/Release-Specs#222
It can be called in Release-Specs via tox -- -k "spec12" --non-RC --local

Currently there a three test:

  1. The first test checks whether the radios on channels 11 to 26 can receive and transmit packets.
  2. On the second test 20 packets send with a high frequency. It is checked whether all packets have been acknowledged.
  3. The last test checks if the receiver can send back a packet immediately.

All tests pass.

For manual testing you need two boards and flash it with tests/ieee802154_hal

Usage of the function spam:
Call spam on board with the parameters

spam <address_board2> <length_of_the_payload> <number_of_packets> <delay>

If you call spam with the parameters spam <address_board2> 5 3 1
The device will send a packet to device2 every 1 ms with a payload of 3 Chars in total 5 packets will be send.

You can set device2 in reply mode, means it will sends every packet back he receives, by calling the function reply. Just make sure to be easy on the delay otherwise the radio won't be able to handle this.

Issues/PRs references

None

@github-actions github-actions bot added the Area: tests Area: tests and testing framework label Jun 28, 2021
@jia200x jia200x changed the title Pr/radio hal tests tests/ieee802154_hal: extend radio hal test Jun 28, 2021
@LarsKowoll LarsKowoll force-pushed the pr/radio_hal_tests branch from 6567ce9 to 28e7df7 Compare June 28, 2021 12:05
Copy link
Contributor

@MrKevinWeiss MrKevinWeiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First thing I noticed was you should revert all the printf("something\n") back to puts("something"), less changes are better.

The RIOTCTRL flag is a bit questionable to me but probably OK for now. Any test is better than no test.

I will have to try it out later on.

@MrKevinWeiss
Copy link
Contributor

Ran the test with the release specs PR and things pass:

weiss@mobiweiss:~/wd/Release-Specs$ python=python3 RIOTBASE=/home/weiss/wd/RIOT tox -- -k "spec12" --non-RC --local
test create: /home/weiss/wd/Release-Specs/.tox/test
test installdeps: -rrequirements.txt
test installed: aiocoap==0.4.1,attrs==21.2.0,certifi==2021.5.30,cffi==1.14.5,chardet==4.0.0,coverage==5.5,Deprecated==1.2.12,idna==2.10,iniconfig==1.1.1,iotlabcli==3.2.1,jmespath==0.10.0,LinkHeader==0.4.3,packaging==20.9,paho-mqtt==1.5.1,pexpect==4.8.0,pluggy==0.13.1,psutil==5.8.0,ptyprocess==0.7.0,py==1.10.0,pycparser==2.20,PyGithub==1.55,PyJWT==2.1.0,PyNaCl==1.4.0,pyparsing==2.4.7,pyserial==3.5,pytest==6.2.4,pytest-cov==2.12.1,requests==2.25.1,riotctrl==0.4.1,scapy==2.4.5,six==1.16.0,toml==0.10.2,urllib3==1.26.6,wrapt==1.12.1
test run-test-pre: PYTHONHASHSEED='3027928498'
test run-test: commands[0] | pytest -k spec12 --non-RC --local
=================================================== test session starts ====================================================
platform linux -- Python 3.8.5, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 -- /home/weiss/wd/Release-Specs/.tox/test/bin/python
cachedir: .tox/test/.pytest_cache
rootdir: /home/weiss/wd/Release-Specs, configfile: setup.cfg
plugins: cov-2.12.1
collected 120 items / 117 deselected / 3 selected                                                                          

12-ieee802154/test_spec12.py::test_task01[nodes0] PASSED                                                             [ 33%]
12-ieee802154/test_spec12.py::test_task02[nodes0] PASSED                                                             [ 66%]
12-ieee802154/test_spec12.py::test_task03[nodes0] PASSED                                                             [100%]

===================================================== warnings summary =====================================================
.tox/test/lib/python3.8/site-packages/iotlabcli/associations.py:58
  /home/weiss/wd/Release-Specs/.tox/test/lib/python3.8/site-packages/iotlabcli/associations.py:58: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.9 it will stop working
    collections.MutableMapping, dict):

-- Docs: https://docs.pytest.org/en/stable/warnings.html
----------------------------- generated xml file: /home/weiss/wd/Release-Specs/test-report.xml -----------------------------
================================= 3 passed, 117 deselected, 1 warning in 183.79s (0:03:03) =================================
flake8 create: /home/weiss/wd/Release-Specs/.tox/flake8
flake8 installdeps: flake8
flake8 installed: flake8==3.9.2,mccabe==0.6.1,pycodestyle==2.7.0,pyflakes==2.3.1
flake8 run-test-pre: PYTHONHASHSEED='3027928498'
flake8 run-test: commands[0] | flake8
pylint create: /home/weiss/wd/Release-Specs/.tox/pylint
pylint installdeps: -rrequirements.txt, pylint
pylint installed: aiocoap==0.4.1,astroid==2.5.6,attrs==21.2.0,certifi==2021.5.30,cffi==1.14.5,chardet==4.0.0,coverage==5.5,Deprecated==1.2.12,idna==2.10,iniconfig==1.1.1,iotlabcli==3.2.1,isort==5.9.1,jmespath==0.10.0,lazy-object-proxy==1.6.0,LinkHeader==0.4.3,mccabe==0.6.1,packaging==20.9,paho-mqtt==1.5.1,pexpect==4.8.0,pluggy==0.13.1,psutil==5.8.0,ptyprocess==0.7.0,py==1.10.0,pycparser==2.20,PyGithub==1.55,PyJWT==2.1.0,pylint==2.8.3,PyNaCl==1.4.0,pyparsing==2.4.7,pyserial==3.5,pytest==6.2.4,pytest-cov==2.12.1,requests==2.25.1,riotctrl==0.4.1,scapy==2.4.5,six==1.16.0,toml==0.10.2,urllib3==1.26.6,wrapt==1.12.1
pylint run-test-pre: PYTHONHASHSEED='3027928498'
pylint run-test: commands[0] | pylint conftest.py testutils/ 03-single-hop-ipv6-icmp/ 04-single-hop-6lowpan-icmp/ 05-single-hop-route/ 06-single-hop-udp/ 07-multi-hop/ 08-interop/ 09-coap/ 10-icmpv6-error/ 11-lorawan/ 12-ieee802154/

--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)

_________________________________________________________ summary __________________________________________________________
  test: commands succeeded
  flake8: commands succeeded
  pylint: commands succeeded
  congratulations :)

@MrKevinWeiss MrKevinWeiss added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jun 29, 2021
@MrKevinWeiss
Copy link
Contributor

Lets just see what the CI says?

@jia200x
Copy link
Member

jia200x commented Jul 1, 2021

CI seems to be happy

@benpicco
Copy link
Contributor

static-tests is not so happy though

@fjmolinas
Copy link
Contributor

ping @jia200x @LarsKowoll

@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.

@stale stale bot added the State: stale State: The issue / PR has no activity for >185 days label Apr 16, 2022
@stale stale bot closed this Jun 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR State: stale State: The issue / PR has no activity for >185 days
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants