Skip to content

Commit

Permalink
tests: add test for 6LoWPAN SFR using CongURE
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed Oct 12, 2022
1 parent 8376b83 commit d4f03f0
Show file tree
Hide file tree
Showing 7 changed files with 1,361 additions and 0 deletions.
43 changes: 43 additions & 0 deletions tests/gnrc_sixlowpan_frag_sfr_congure/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
include ../Makefile.tests_common

USEMODULE += congure_mock
USEMODULE += gnrc_ipv6_router_default
USEMODULE += gnrc_sixlowpan_frag_sfr
USEMODULE += gnrc_sixlowpan_frag_sfr_congure
USEMODULE += gnrc_sixlowpan_iphc
USEMODULE += gnrc_ipv6_nib
USEMODULE += gnrc_netif
USEMODULE += embunit
USEMODULE += netdev_ieee802154
USEMODULE += netdev_test
USEMODULE += ztimer_msec ztimer_usec

CFLAGS += -DTEST_SUITES

include $(RIOTBASE)/Makefile.include

ifndef CONFIG_GNRC_IPV6_NIB_NO_RTR_SOL
# disable router solicitations so they don't interfere with the tests
CFLAGS += -DCONFIG_GNRC_IPV6_NIB_NO_RTR_SOL=1
endif
# SFR parameters
ifndef CONFIG_GNRC_SIXLOWPAN_SFR_OPT_WIN_SIZE
# fix window size
CFLAGS += -DCONFIG_GNRC_SIXLOWPAN_SFR_OPT_WIN_SIZE=3U
endif
ifndef CONFIG_GNRC_SIXLOWPAN_SFR_INTER_FRAME_GAP_US
# decrease inter frame gap
CFLAGS += -DCONFIG_GNRC_SIXLOWPAN_SFR_INTER_FRAME_GAP_US=5U
endif
ifndef CONFIG_GNRC_SIXLOWPAN_SFR_MIN_ARQ_TIMEOUT_MS
# decrease minimal ARQ timeout
CFLAGS += -DCONFIG_GNRC_SIXLOWPAN_SFR_MIN_ARQ_TIMEOUT_MS=100U
endif
ifndef CONFIG_GNRC_SIXLOWPAN_SFR_OPT_ARQ_TIMEOUT_MS
# decrease initial ARQ timeout
CFLAGS += -DCONFIG_GNRC_SIXLOWPAN_SFR_OPT_ARQ_TIMEOUT_MS=100U
endif
ifndef CONFIG_GNRC_SIXLOWPAN_SFR_MOCK_ARQ_TIMER
# mock ARQ timer
CFLAGS += -DCONFIG_GNRC_SIXLOWPAN_SFR_MOCK_ARQ_TIMER=1U
endif
48 changes: 48 additions & 0 deletions tests/gnrc_sixlowpan_frag_sfr_congure/Makefile.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
BOARD_INSUFFICIENT_MEMORY := \
arduino-duemilanove \
arduino-leonardo \
arduino-mega2560 \
arduino-nano \
arduino-uno \
atmega1284p \
atmega328p \
atmega328p-xplained-mini \
atxmega-a1u-xpro \
atxmega-a3bu-xplained \
blackpill \
bluepill \
bluepill-stm32f030c8 \
derfmega128 \
hifive1 \
hifive1b \
i-nucleo-lrwan1 \
im880b \
mega-xplained \
microduino-corerf \
msb-430 \
msb-430h \
nucleo-f030r8 \
nucleo-f031k6 \
nucleo-f042k6 \
nucleo-f070rb \
nucleo-f072rb \
nucleo-f302r8 \
nucleo-f303k8 \
nucleo-f334r8 \
nucleo-l011k4 \
nucleo-l031k6 \
nucleo-l053r8 \
samd10-xmini \
saml10-xpro \
saml11-xpro \
slstk3400a \
stk3200 \
stm32f030f4-demo \
stm32f0discovery \
stm32l0538-disco \
stm32mp157c-dk2 \
telosb \
waspmote-pro \
z1 \
zigduino \
#
8 changes: 8 additions & 0 deletions tests/gnrc_sixlowpan_frag_sfr_congure/app.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CONFIG_KCONFIG_USEMODULE_GNRC_IPV6_NIB=y
CONFIG_KCONFIG_USEMODULE_GNRC_SIXLOWPAN=y
CONFIG_KCONFIG_USEMODULE_GNRC_SIXLOWPAN_FRAG_SFR=y
# disable router solicitations so they don't interfere with the tests
CONFIG_GNRC_IPV6_NIB_NO_RTR_SOL=y
# preconfigure SFR for tests
CONFIG_GNRC_SIXLOWPAN_SFR_OPT_WIN_SIZE=3
CONFIG_GNRC_SIXLOWPAN_SFR_MOCK_ARQ_TIMER=y
50 changes: 50 additions & 0 deletions tests/gnrc_sixlowpan_frag_sfr_congure/common.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Copyright (C) 2017 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.
*/

/**
* @defgroup tests_gnrc_ipv6_nib Common header for GNRC's NIB tests
* @ingroup tests
* @brief Common definitions for GNRC's NIB tests
* @{
*
* @file
*
* @author Martine Lenders <m.lenders@fu-berlin.de>
*/
#ifndef COMMON_H
#define COMMON_H

#include <stdio.h>

#include "net/gnrc.h"
#include "net/gnrc/netif.h"

#ifdef __cplusplus
extern "C" {
#endif

#define _LL0 (0xb8)
#define _LL1 (0x8c)
#define _LL2 (0xcc)
#define _LL3 (0xba)
#define _LL4 (0xef)
#define _LL5 (0x9a)
#define _LL6 (0x67)
#define _LL7 (0x42)

extern gnrc_netif_t *_mock_netif;

void _tests_init(void);
void _common_set_up(void);

#ifdef __cplusplus
}
#endif

#endif /* COMMON_H */
/** @} */
Loading

0 comments on commit d4f03f0

Please sign in to comment.