Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions 12-ieee802154/test_spec12.py
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',
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@pytest.mark.parametrize('nodes',
@pytest.mark.local_only
@pytest.mark.parametrize('nodes',

remote-revb is not available on the testbed.

[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',
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@pytest.mark.parametrize('nodes',
@pytest.mark.local_only
@pytest.mark.parametrize('nodes',

[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',
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@pytest.mark.parametrize('nodes',
@pytest.mark.local_only
@pytest.mark.parametrize('nodes',

[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)
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ pytest
pytest-cov
riotctrl
scapy
pyserial
pexpect
paho-mqtt
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,5 @@ commands =
08-interop/ \
09-coap/ \
10-icmpv6-error/ \
11-lorawan/
11-lorawan/ \
12-ieee802154/