-
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.
Merge pull request #11930 from brummer-simon/gnrc_tcp-improve_tests
gnrc_tcp: test improvement
- Loading branch information
Showing
14 changed files
with
748 additions
and
616 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,61 @@ | ||
include ../Makefile.tests_common | ||
|
||
# Basic Configuration | ||
BOARD ?= native | ||
TAP ?= tap0 | ||
|
||
# Shorten default TCP timeouts to speedup testing | ||
MSL_US ?= 1000000 | ||
TIMEOUT_US ?= 3000000 | ||
|
||
# Mark Boards with insufficient memory | ||
BOARD_INSUFFICIENT_MEMORY := arduino-duemilanove arduino-leonardo \ | ||
arduino-mega2560 arduino-nano arduino-uno \ | ||
hifive1 hifive1b i-nucleo-lrwan1 mega-xplained \ | ||
msb-430 msb-430h nucleo-f030r8 nucleo-f031k6 \ | ||
nucleo-f042k6 nucleo-f070rb nucleo-f072rb \ | ||
nucleo-f303k8 nucleo-f334r8 nucleo-l031k6 \ | ||
nucleo-l053r8 saml10-xpro saml11-xpro \ | ||
stm32f0discovery stm32l0538-disco telosb \ | ||
waspmote-pro wsn430-v1_3b wsn430-v1_4 z1 | ||
|
||
# unsupported by ethos: chronos, hamilton, ruuvitag | ||
BOARD_BLACKLIST := chronos hamilton ruuvitag thingy52 | ||
|
||
# This test depends on tap device setup (only allowed by root) | ||
# Suppress test execution to avoid CI errors | ||
TEST_ON_CI_BLACKLIST += all | ||
|
||
CFLAGS += -DSHELL_NO_ECHO | ||
CFLAGS += -DGNRC_TCP_MSL=$(MSL_US) | ||
CFLAGS += -DGNRC_TCP_CONNECTION_TIMEOUT_DURATION=$(TIMEOUT_US) | ||
|
||
ifeq (native,$(BOARD)) | ||
USEMODULE += netdev_tap | ||
TERMFLAGS ?= $(TAP) | ||
else | ||
USEMODULE += stdio_ethos | ||
ETHOS_BAUDRATE ?= 115200 | ||
CFLAGS += -DETHOS_BAUDRATE=$(ETHOS_BAUDRATE) | ||
TERMDEPS += ethos | ||
TERMPROG ?= sudo $(RIOTTOOLS)/ethos/ethos | ||
TERMFLAGS ?= $(TAP) $(PORT) $(ETHOS_BAUDRATE) | ||
endif | ||
|
||
USEMODULE += auto_init_gnrc_netif | ||
USEMODULE += gnrc_ipv6_default | ||
USEMODULE += gnrc_tcp | ||
USEMODULE += gnrc_pktbuf_cmd | ||
USEMODULE += shell | ||
USEMODULE += shell_commands | ||
USEMODULE += od | ||
|
||
# Export used tap device to environment | ||
export TAPDEV = $(TAP) | ||
|
||
.PHONY: ethos | ||
|
||
ethos: | ||
$(Q)env -u CC -u CFLAGS make -C $(RIOTTOOLS)/ethos | ||
|
||
include $(RIOTBASE)/Makefile.include |
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,34 @@ | ||
Test description | ||
========== | ||
The entire GNRC TCP test consists of several test cases. Each test is ran via its own python script | ||
in the tests directory. | ||
|
||
1) 01-conn_lifecycle_as_client.py | ||
This test covers TCP connection establishment and teardown with GNRC_TCP acting as tcp client. | ||
|
||
2) 02-conn_lifecycle_as_server.py | ||
This test covers TCP connection establishment and teardown with GNRC_TCP acting as tcp server. | ||
|
||
3) 03-send_data.py | ||
This test covers sending of a byte stream from GNRC_TCP to the host system. | ||
The amount of data to send is large enough to force GNRC_TCP to split the given stream into | ||
multiple packets. | ||
|
||
4) 04-receive_data.py | ||
This test covers receiving of a byte stream from the host system. The received data is | ||
causing window opening and closing as well as data transmission over multiple packets. | ||
|
||
Setup | ||
========== | ||
The test requires a tap-device setup. This can be achieved by running 'dist/tools/tapsetup/tapsetup' | ||
or by executing the following commands: | ||
|
||
sudo ip tuntap add tap0 mode tap user ${USER} | ||
sudo ip link set tap0 up | ||
|
||
Usage | ||
========== | ||
make BOARD=<BOARD_NAME> all flash | ||
sudo make BOARD=<BOARD_NAME> test | ||
|
||
'sudo' is only required if the board is not native, due to ethos usage. |
Oops, something went wrong.