Skip to content

Commit

Permalink
tests: add test application for CongURE implementations with SFR
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed Jan 20, 2023
1 parent 914ca26 commit ec88642
Show file tree
Hide file tree
Showing 5 changed files with 152 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/gnrc_sixlowpan_frag_sfr_congure_impl/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
include ../Makefile.tests_common

USEMODULE += netdev_default
USEMODULE += auto_init_gnrc_netif
USEMODULE += gnrc_ipv6_router_default
USEMODULE += gnrc_sixlowpan_frag_sfr
USEMODULE += gnrc_udp
USEMODULE += gnrc_rpl
USEMODULE += auto_init_gnrc_rpl
USEMODULE += gnrc_pktdump
USEMODULE += gnrc_icmpv6_echo
USEMODULE += shell
USEMODULE += shell_cmd_gnrc_pktbuf
USEMODULE += shell_cmd_gnrc_udp
USEMODULE += ps
USEMODULE += netstats_l2
USEMODULE += netstats_ipv6
USEMODULE += netstats_rpl

CONGURE_IMPL ?= congure_sfr

ifeq (congure_sfr,$(CONGURE_IMPL))
USEMODULE += gnrc_sixlowpan_frag_sfr_congure_sfr
else
$(error "Unknown CongURE implementation `$(CONGURE_IMPL)`")
endif

include $(RIOTBASE)/Makefile.include

# Set a custom channel if needed
include $(RIOTMAKE)/default-radio-settings.inc.mk
54 changes: 54 additions & 0 deletions tests/gnrc_sixlowpan_frag_sfr_congure_impl/Makefile.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
BOARD_INSUFFICIENT_MEMORY := \
airfy-beacon \
arduino-duemilanove \
arduino-leonardo \
arduino-mega2560 \
arduino-nano \
arduino-uno \
atmega1284p \
atmega328p \
atmega328p-xplained-mini \
atxmega-a3bu-xplained \
b-l072z-lrwan1 \
blackpill-128kib \
bluepill-128kib \
bluepill-stm32f030c8 \
calliope-mini \
derfmega128 \
hifive1 \
hifive1b \
i-nucleo-lrwan1 \
im880b \
lsn50 \
mega-xplained \
microbit \
microduino-corerf \
msb-430 \
msb-430h \
nrf51dongle \
nrf6310 \
nucleo-f030r8 \
nucleo-f031k6 \
nucleo-f042k6 \
nucleo-f070rb \
nucleo-f072rb \
nucleo-f303k8 \
nucleo-f334r8 \
nucleo-l011k4 \
nucleo-l031k6 \
nucleo-l053r8 \
samd10-xmini \
saml10-xpro \
saml11-xpro \
slstk3400a \
stk3200 \
stm32f030f4-demo \
stm32f0discovery \
stm32g0316-disco \
stm32l0538-disco \
telosb \
waspmote-pro \
yunjia-nrf51822 \
z1 \
zigduino \
#
8 changes: 8 additions & 0 deletions tests/gnrc_sixlowpan_frag_sfr_congure_impl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
SFR CongURE implementation test
===============================
This test is largely based on the [`gnrc_networking`][1] example but is changed
so SFR with different CongURE implementations can be tested. When `CONGURE_IMPL`
is not set in the environment, `gnrc_sixlowpan_frag_sfr_congure_sfr` is used,
other implementations can be used with `congure_<impl>`.

[1]: https://github.com/RIOT-OS/RIOT/tree/master/examples/gnrc_networking
39 changes: 39 additions & 0 deletions tests/gnrc_sixlowpan_frag_sfr_congure_impl/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright (C) 2015-21 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/

/**
* @ingroup tests
* @{
*
* @file
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @author Martine Lenders <m.lenders@fu-berlin.de>
*
* @}
*/

#include <stdio.h>

#include "fmt.h"
#include "shell.h"
#include "msg.h"

#define MAIN_QUEUE_SIZE (8)
static msg_t _main_msg_queue[MAIN_QUEUE_SIZE];

int main(void)
{
msg_init_queue(_main_msg_queue, MAIN_QUEUE_SIZE);

char line_buf[SHELL_DEFAULT_BUFSIZE];
shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE);

/* should be never reached */
return 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env python3

# Copyright (C) 2021 Freie Universität Berlin
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.


import sys
from testrunner import run


def testfunc(child):
child.sendline('udp send fe80::1 1337 abcde')
child.expect_exact('Success: sent 5 byte(s) to [fe80::1]:1337')


if __name__ == "__main__":
sys.exit(run(testfunc))

0 comments on commit ec88642

Please # to comment.