-
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: provide initial tests for gnrc_ipv6_ext_frag
- Loading branch information
Showing
5 changed files
with
920 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,62 @@ | ||
DEVELHELP := 1 | ||
# name of your application | ||
include ../Makefile.tests_common | ||
|
||
BOARD_INSUFFICIENT_MEMORY := arduino-duemilanove arduino-leonardo \ | ||
arduino-mega2560 arduino-nano \ | ||
arduino-uno hifive1 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 telosb thingy52 waspmote-pro \ | ||
wsn430-v1_3b wsn430-v1_4 z1 | ||
# chronos, hamilton, mips-malta, and ruuvitag boards don't support ethos | ||
BOARD_BLACKLIST := chronos hamilton mips-malta ruuvitag | ||
|
||
export TAP ?= tap0 | ||
|
||
CFLAGS += -DOUTPUT=TEXT | ||
CFLAGS += -DTEST_SUITES="gnrc_ipv6_ext_frag" | ||
CFLAGS += -DGNRC_IPV6_EXT_FRAG_LIMITS_POOL_SIZE=3 | ||
|
||
# use Ethernet as link-layer protocol | ||
ifeq (native,$(BOARD)) | ||
USEMODULE += netdev_tap | ||
|
||
TERMFLAGS ?= $(TAP) | ||
else | ||
USEMODULE += ethos | ||
|
||
ETHOS_BAUDRATE ?= 115200 | ||
CFLAGS += -DETHOS_BAUDRATE=$(ETHOS_BAUDRATE) -DUSE_ETHOS_FOR_STDIO | ||
TERMDEPS += ethos | ||
TERMPROG ?= sudo $(RIOTTOOLS)/ethos/ethos | ||
TERMFLAGS ?= $(TAP) $(PORT) $(ETHOS_BAUDRATE) | ||
endif | ||
USEMODULE += auto_init_gnrc_netif | ||
# Specify the mandatory networking modules for IPv6 | ||
USEMODULE += gnrc_ipv6_router_default | ||
USEMODULE += gnrc_icmpv6_error | ||
USEMODULE += gnrc_pktdump | ||
USEMODULE += gnrc_pktbuf_cmd | ||
# IPv6 extension headers | ||
USEMODULE += gnrc_ipv6_ext_frag | ||
# UDP support for payload | ||
USEMODULE += gnrc_udp | ||
USEMODULE += od | ||
# Add unittest framework | ||
USEMODULE += embunit | ||
# Add also the shell, some shell commands | ||
USEMODULE += shell | ||
USEMODULE += shell_commands | ||
USEMODULE += ps | ||
|
||
# TEST_ON_CI_WHITELIST += all | ||
|
||
.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,36 @@ | ||
# `gnrc_ipv6_ext_frag` test | ||
|
||
This test utilizes [scapy] to test the IPv6 Extension header parsing. | ||
|
||
It is intended to just test the fragmentation header handling and generation. | ||
For other extension header types please provide a separate test application. | ||
|
||
To test, compile and flash the application to any board of your liking (since | ||
`ethos` is used to communicate with non-native boards it really doesn't matter | ||
as long as the application fits). | ||
|
||
``` | ||
make flash | ||
``` | ||
|
||
And run the tests using | ||
|
||
``` | ||
sudo make test | ||
``` | ||
|
||
Note that root privileges are required since `scapy` needs to construct Ethernet | ||
frames to properly communicate over the TAP interface. | ||
|
||
The tests succeeds if you see the string `SUCCESS`. | ||
|
||
If any problems are encountered (i.e. if the test prints the sting `FAILED`), | ||
set the echo parameter in the `run()` function at the bottom of the test script | ||
(tests/01-run.py) to `True`. The test script will then offer a more detailed | ||
output. | ||
|
||
It might be that due to `scapy`'s sniffer not picking up an expected packet | ||
sometimes that the test application hangs for a while and then issues `FAILED`. | ||
Just restart the test in that case. | ||
|
||
[scapy]: https://scapy.readthedocs.io/en/latest/ |
Oops, something went wrong.