Skip to content

Commit

Permalink
tests/net: add stub test for gcoap_forward_proxy
Browse files Browse the repository at this point in the history
This adds enough to do compile testing for gcoap_forward_proxy.
A proper test would still be needed, though.

This still already exposed compilation issues.
  • Loading branch information
maribu committed Oct 14, 2024
1 parent 71b91a1 commit 7c32c39
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tests/net/gcoap_forward_proxy/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
include ../Makefile.net_common

USEMODULE += embunit

USEMODULE += auto_init_gnrc_netif
USEMODULE += fmt
USEMODULE += ipv4_addr
USEMODULE += ipv6_addr
USEMODULE += gcoap_forward_proxy
USEMODULE += gnrc_ipv6_default
USEMODULE += netdev_default
USEMODULE += od
USEMODULE += shell
USEMODULE += shell_cmds_default

COAPS ?= 1

ifeq (1,$(COAPS))
USEMODULE += gcoap_dtls
USEMODULE += prng_sha256prng
USEPKG += tinydtls
KCONFIG_ADD_CONFIG += $(CURDIR)/coaps.config
endif

CFLAGS += -DTEST_SUITES
CFLAGS += -DHAS_SOCK_DNS_MOCK=1

include $(RIOTBASE)/Makefile.include

ifneq (,$(filter native native64,$(BOARD)))
test: PORT=
$(call target-export-variables,test,PORT)
endif
60 changes: 60 additions & 0 deletions tests/net/gcoap_forward_proxy/Makefile.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
BOARD_INSUFFICIENT_MEMORY := \
airfy-beacon \
arduino-duemilanove \
arduino-leonardo \
arduino-mega2560 \
arduino-nano \
arduino-uno \
atmega1284p \
atmega328p \
atmega328p-xplained-mini \
atmega8 \
atxmega-a3bu-xplained \
blackpill-stm32f103c8 \
bluepill-stm32f030c8 \
bluepill-stm32f103c8 \
calliope-mini \
derfmega128 \
hifive1 \
hifive1b \
i-nucleo-lrwan1 \
im880b \
mega-xplained \
microbit \
microduino-corerf \
msb-430 \
msb-430h \
nrf51dongle \
nrf6310 \
nucleo-c031c6 \
nucleo-f030r8 \
nucleo-f031k6 \
nucleo-f042k6 \
nucleo-f070rb \
nucleo-f072rb \
nucleo-f302r8 \
nucleo-f303k8 \
nucleo-f334r8 \
nucleo-l011k4 \
nucleo-l031k6 \
nucleo-l053r8 \
olimex-msp430-h1611 \
olimex-msp430-h2618 \
samd10-xmini \
saml10-xpro \
saml11-xpro \
slstk3400a \
stk3200 \
stm32f030f4-demo \
stm32f0discovery \
stm32f7508-dk \
stm32g0316-disco \
stm32l0538-disco \
stm32mp157c-dk2 \
telosb \
waspmote-pro \
weact-g030f6 \
yunjia-nrf51822 \
z1 \
zigduino \
#
5 changes: 5 additions & 0 deletions tests/net/gcoap_forward_proxy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
TODO
====

This application is here to ensure that the `gcoap_forward_proxy` is at least compile tested.
A proper test will hopefully be implemented some day that replaces this stub.
34 changes: 34 additions & 0 deletions tests/net/gcoap_forward_proxy/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright (C) 2024 ML!PA Consulting GmbH
*
* 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
* @brief test application for the GCoAP forward proxy
*
* @author Marian Buschsieweke <marian.buschsieweke@posteo.net>
* @}
*/

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

#define MAIN_QUEUE_SIZE (4)
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);

return 0;
}

0 comments on commit 7c32c39

Please sign in to comment.