-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Add functionality test for netdev_base
- Loading branch information
Showing
4 changed files
with
1,359 additions
and
0 deletions.
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,49 @@ | ||
|
||
SENDER ?= 0 | ||
ifeq (0,$(SENDER)) | ||
export APPLICATION = netdev_receiver | ||
else | ||
export APPLICATION = netdev_sender | ||
endif | ||
|
||
include ../Makefile.tests_common | ||
|
||
USEMODULE += defaulttransceiver | ||
USEMODULE += netdev_base | ||
|
||
DISABLE_MODULE += auto_init | ||
|
||
INCLUDES += -I$(RIOTBASE)/sys/net/include | ||
|
||
CHANNEL ?= 1 | ||
SENDER_ADDRESS ?= 1 | ||
RECEIVER_ADDRESS ?= 2 | ||
NID ?= 0 | ||
|
||
ifeq (native,$(BOARD)) | ||
RECEIVER_PORT ?= tap0 | ||
SENDER_PORT ?= tap1 | ||
else | ||
RECEIVER_PORT ?= /dev/ttyUSB1 | ||
SENDER_PORT ?= /dev/ttyUSB0 | ||
endif | ||
|
||
ifeq (0,$(SENDER)) | ||
CFLAGS += -DRECEIVER | ||
CFLAGS += -DNETDEV_TEST_ADDRESS=$(RECEIVER_ADDRESS) | ||
PORT ?= $(RECEIVER_PORT) | ||
else | ||
CFLAGS += -DSENDER | ||
CFLAGS += -DNETDEV_TEST_ADDRESS=$(SENDER_ADDRESS) | ||
PORT ?= $(SENDER_PORT) | ||
endif | ||
|
||
include $(RIOTBASE)/Makefile.include | ||
|
||
CFLAGS += -DNETDEV_TEST_CHANNEL=$(CHANNEL) | ||
CFLAGS += -DNETDEV_TEST_NID=$(NID) | ||
CFLAGS += -DNETDEV_TEST_RECEIVER=$(RECEIVER_ADDRESS) | ||
CFLAGS += -DNETDEV_TEST_SENDER=$(SENDER_ADDRESS) | ||
|
||
test: | ||
./tests/01-interaction.py |
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,21 @@ | ||
# netdev tests | ||
This application tests the module `netdev`, it's base module `netdev_base` in | ||
particular. | ||
The tests can be automated by running | ||
|
||
```bash | ||
SENDER=0 make all flash && SENDER=1 make all flash && make test | ||
``` | ||
|
||
The values of the network addresses, the channel, and the network ID can be | ||
configured by the environment variables | ||
|
||
* `NETDEV_TEST_RECEIVER` and `NETDEV_TEST_SENDER`, | ||
* `NETDEV_TEST_CHANNEL`, | ||
* `NETDEV_TEST_NID` | ||
|
||
You can set the role of the application by setting the `SENDER` variable to | ||
either 0 (application is receiver) or any other value (applictation is sender), | ||
but keep in mind, that both versions have to be flashed to to seperate devices | ||
(identified by `RECEIVER_PORT` and `SENDER_PORT` respectively) in order for | ||
`make test` to succeed. |
Oops, something went wrong.