-
Notifications
You must be signed in to change notification settings - Fork 21
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
WIP: add test for ieee802154 #222
Open
LarsKowoll
wants to merge
9
commits into
RIOT-OS:master
Choose a base branch
from
LarsKowoll:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
fc1da18
add test for radio hal
LarsKowoll e0fc1a2
add tests for ieee 802.15.4
LarsKowoll cf3c5f5
remove comments and revert changes
LarsKowoll 1fef9ea
update to current status
LarsKowoll 5596ac0
remove additonal lines
LarsKowoll 84ecc5f
add additional line for tox.ini
LarsKowoll 4f5a8a0
12-ieee802154/test_spec12.py changed function names
LarsKowoll adf6db7
12-ieee802154/test_spec12.py adjust function calls
LarsKowoll cb0d3c6
12-ieee802154/test_spec12.py refactor function names
LarsKowoll File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,66 @@ | ||||||||
from time import sleep | ||||||||
import pytest | ||||||||
|
||||||||
from riotctrl_shell.ieee802154 import IEEE802154Phy | ||||||||
|
||||||||
APP = 'tests/ieee802154_hal' | ||||||||
PHY_MODE = 'O-QPSK' | ||||||||
DEFAULT_CHANNEL = 26 | ||||||||
pytestmark = pytest.mark.rc_only() | ||||||||
|
||||||||
|
||||||||
class Shell(IEEE802154Phy): | ||||||||
pass | ||||||||
|
||||||||
|
||||||||
@pytest.mark.parametrize('nodes', | ||||||||
[pytest.param(['remote-revb', 'remote-revb'])], | ||||||||
indirect=['nodes']) | ||||||||
def test_task01(riot_ctrl): | ||||||||
sender, receiver = ( | ||||||||
riot_ctrl(0, APP, Shell, port='/dev/ttyUSB0'), | ||||||||
riot_ctrl(1, APP, Shell, port='/dev/ttyUSB1'), | ||||||||
) | ||||||||
sender.ieee802154_tx_mode("direct") | ||||||||
receiver.ieee802154_tx_mode("direct") | ||||||||
receiver_addr = receiver.ieee802154_print_addr() | ||||||||
sender_addr = sender.ieee802154_print_addr() | ||||||||
for i in range(11, 27): | ||||||||
sender.ieee802154_config_phy(PHY_MODE, i, 0) | ||||||||
receiver.ieee802154_config_phy(PHY_MODE, i, 0) | ||||||||
sleep(1) | ||||||||
sender.ieee802154_txtspam(receiver_addr, 1, 0) | ||||||||
sleep(1) | ||||||||
receiver.ieee802154_check_last_packet(sender_addr, i) | ||||||||
sleep(0.5) | ||||||||
|
||||||||
|
||||||||
@pytest.mark.parametrize('nodes', | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
[pytest.param(['remote-revb', 'remote-revb'])], | ||||||||
indirect=['nodes']) | ||||||||
def test_task02(riot_ctrl): | ||||||||
sender, receiver = ( | ||||||||
riot_ctrl(0, APP, Shell, port='/dev/ttyUSB0'), | ||||||||
riot_ctrl(1, APP, Shell, port='/dev/ttyUSB1'), | ||||||||
) | ||||||||
sender.ieee802154_tx_mode("direct") | ||||||||
receiver.ieee802154_tx_mode("direct") | ||||||||
receiver_addr = receiver.ieee802154_print_addr() | ||||||||
sender.ieee802154_txtspam(receiver_addr, 5, 1000) | ||||||||
|
||||||||
|
||||||||
@pytest.mark.parametrize('nodes', | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
[pytest.param(['remote-revb', 'remote-revb'])], | ||||||||
indirect=['nodes']) | ||||||||
def test_task03(riot_ctrl): | ||||||||
sender, receiver = ( | ||||||||
riot_ctrl(0, APP, Shell, port='/dev/ttyUSB0'), | ||||||||
riot_ctrl(1, APP, Shell, port='/dev/ttyUSB1'), | ||||||||
) | ||||||||
sender.ieee802154_tx_mode("direct") | ||||||||
receiver.ieee802154_tx_mode("direct") | ||||||||
receiver_addr = receiver.ieee802154_print_addr() | ||||||||
receiver.ieee802154_reply() | ||||||||
sender.ieee802154_txtsnd(receiver_addr, 1) | ||||||||
sleep(1) | ||||||||
sender.ieee802154_check_last_packet(receiver_addr, DEFAULT_CHANNEL) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,6 @@ pytest | |
pytest-cov | ||
riotctrl | ||
scapy | ||
pyserial | ||
pexpect | ||
paho-mqtt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,4 +61,5 @@ commands = | |
08-interop/ \ | ||
09-coap/ \ | ||
10-icmpv6-error/ \ | ||
11-lorawan/ | ||
11-lorawan/ \ | ||
12-ieee802154/ |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remote-revb
is not available on the testbed.