1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

examples: tests: unify native arguments for ZEP

This commit is contained in:
Oleg Hahm 2023-12-15 01:12:46 +01:00
parent b9c8b659ed
commit 273486be78
16 changed files with 28 additions and 42 deletions

View File

@ -18,6 +18,14 @@ ifeq (native,$(RIOT_TERMINAL))
TERMPROG ?= $(FLASHFILE)
else
TERMFLAGS += -n $(FLASHFILE)
ifeq (1,$(USE_ZEP))
ZEP_IP ?= [::1]
ZEP_PORT_BASE ?= 17754
TERMFLAGS += --native-args '-z $(ZEP_IP):$(ZEP_PORT_BASE)'
endif
ifneq (,$(ZEP_MAC))
TERMFLAGS += --native-args '\-\-eui64=$(ZEP_MAC)'
endif
endif
export VALGRIND ?= valgrind
@ -92,9 +100,7 @@ endif
LINKFLAGS += -ffunction-sections
# set the tap interface for term/valgrind
ifneq (,$(filter netdev_tap,$(USEMODULE)))
PORT ?= tap0
endif
PORT ?= tap0
# Configure default eeprom file
EEPROM_FILE ?= $(BINDIR)/native.eeprom

View File

@ -70,12 +70,7 @@ USE_ZEP ?= 0
# set the ZEP port for native
ZEP_PORT_BASE ?= 17754
ifeq (1,$(USE_ZEP))
TERMFLAGS += --native-args '-z [::1]:$(ZEP_PORT_BASE)'
USEMODULE += socket_zep
ifneq (,$(ZEP_MAC))
TERMFLAGS += --native-args '\-\-eui64=$(ZEP_MAC)'
endif
endif
include $(RIOTBASE)/Makefile.include

View File

@ -82,12 +82,7 @@ USE_ZEP ?= 0
# set the ZEP port for native
ZEP_PORT_BASE ?= 17754
ifeq (1,$(USE_ZEP))
TERMFLAGS += --native-args '-z [::1]:$(ZEP_PORT_BASE)'
USEMODULE += socket_zep
ifneq (,$(ZEP_MAC))
TERMFLAGS += --native-args '\-\-eui64=$(ZEP_MAC)'
endif
endif
include $(RIOTBASE)/Makefile.include

View File

@ -40,10 +40,5 @@ TERMPROG ?= sudo $(RIOTTOOLS)/zep_dispatch/start_network.sh $(TERMPROG_FLAGS)
# -z [::1]:$PORT for each ZEP device
TERMFLAGS ?= $(patsubst %,-z [::1]:%, $(shell seq $(ZEP_PORT_BASE) $(ZEP_PORT_MAX)))
# set optional ZEP l2 address
ifneq (,$(ZEP_MAC))
TERMFLAGS += --native-args '\-\-eui64=$(ZEP_MAC)'
endif
# native uses $PORT to specify the TAP interface
PORT ?= $(TAP)

View File

@ -47,12 +47,7 @@ USE_ZEP ?= 0
# set the ZEP port for native
ZEP_PORT_BASE ?= 17754
ifeq (1,$(USE_ZEP))
TERMFLAGS += --native-args '-z [::1]:$(ZEP_PORT_BASE)'
USEMODULE += socket_zep
ifneq (,$(ZEP_MAC))
TERMFLAGS += --native-args '\-\-eui64=$(ZEP_MAC)'
endif
endif
# Uncomment the following 2 lines to specify static link lokal IPv6 address

View File

@ -6,7 +6,7 @@ export TAP ?= tap0
# use Ethernet as link-layer protocol
ifeq (native,$(BOARD))
PORT += $(TAP)
PORT ?= $(TAP)
else
ETHOS_BAUDRATE ?= 115200
CFLAGS += -DETHOS_BAUDRATE=$(ETHOS_BAUDRATE)

View File

@ -37,7 +37,8 @@ ifeq (native, $(BOARD))
USEMODULE += socket_zep
USEMODULE += socket_zep_hello
USEMODULE += netdev
TERMFLAGS += --native-args '-z 127.0.0.1:17754' # Murdock has no IPv6 support
RIOT_TERMINAL = native
TERMFLAGS += -z 127.0.0.1:17754 # Murdock has no IPv6 support
# make sure each instance gets their own fs
CFLAGS += -DCONFIG_NATIVE_ISOLATE_FS=1
else

View File

@ -15,7 +15,8 @@ USEMODULE += shell_cmds_default
# use Ethernet as link-layer protocol
ifeq (native,$(BOARD))
TERMFLAGS += --native-args '-z [::1]:17754'
RIOT_TERMINAL = native
TERMFLAGS += -z [::1]:17754
else
ETHOS_BAUDRATE ?= 115200
CFLAGS += -DETHOS_BAUDRATE=$(ETHOS_BAUDRATE)

View File

@ -4,7 +4,8 @@ include ../Makefile.net_common
ifeq (native, $(BOARD))
USEMODULE += socket_zep
TERMFLAGS ?= --native-args '-z "0.0.0.0:17755,localhost:17754"'
RIOT_TERMINAL = native
TERMFLAGS ?= -z "0.0.0.0:17755,localhost:17754"
USEMODULE += netdev
# somehow this breaks the test
DISABLE_MODULE += test_utils_print_stack_usage

View File

@ -13,7 +13,8 @@ ifeq (native, $(BOARD))
USEMODULE += socket_zep
USEMODULE += socket_zep_hello
USEMODULE += netdev
TERMFLAGS += --native-args '-z 127.0.0.1:17754' # Murdock has no IPv6 support
RIOT_TERMINAL = native
TERMFLAGS += -z 127.0.0.1:17754 # Murdock has no IPv6 support
else
USEMODULE += netdev_default
# automated test only works on native

View File

@ -28,7 +28,8 @@ ifeq (native, $(BOARD))
USEMODULE += socket_zep
USEMODULE += socket_zep_hello
USEMODULE += netdev
TERMFLAGS = --native-args '-z 127.0.0.1:17754' # Murdock has no IPv6 support
RIOT_TERMINAL = native
TERMFLAGS = -z 127.0.0.1:17754 # Murdock has no IPv6 support
else
USEMODULE += netdev_default
# automated test only works on native

View File

@ -27,7 +27,8 @@ BOARD_WHITELIST += adafruit-clue \
ifeq ($(BOARD), native)
ZEP_PORT_BASE ?= 17754
TERMFLAGS += --native-args '-z [::1]:$(ZEP_PORT_BASE)'
RIOT_TERMINAL = native
TERMFLAGS += -z [::1]:$(ZEP_PORT_BASE)
USEMODULE += socket_zep
# the same for Kconfig
ifeq (1,$(TEST_KCONFIG))

View File

@ -39,8 +39,7 @@ USEMODULE += ieee802154_submac
USEMODULE += ztimer_usec
ifeq ($(BOARD), native)
ZEP_PORT_BASE ?= 17754
TERMFLAGS += --native-args '-z [::1]:$(ZEP_PORT_BASE)'
USE_ZEP = 1
USEMODULE += socket_zep
endif

View File

@ -6,6 +6,7 @@ USEMODULE += od
USEMODULE += socket_zep
USEMODULE += netdev
TERMFLAGS ?= --native-args '-z [::1]:17754'
RIOT_TERMINAL = native
TERMFLAGS ?= -z [::1]:17754
include $(RIOTBASE)/Makefile.include

View File

@ -51,9 +51,9 @@ def testfunc(child):
if __name__ == "__main__":
os.environ['TERMFLAGS'] = "--native-args '\\-\\-eui64=00:5a:45:50:0a:00:30:38' --native-args '-z [%s]:%d,[%s]:%d'"\
% (zep_params['local_addr'], zep_params['local_port'],
zep_params['remote_addr'], zep_params['remote_port'])
os.environ['TERMFLAGS'] = "--eui64=00:5a:45:50:0a:00:30:38 -z [%s]:%d,[%s]:%d" % (
zep_params['local_addr'], zep_params['local_port'],
zep_params['remote_addr'], zep_params['remote_port'])
s = socket.socket(family=socket.AF_INET, type=socket.SOCK_DGRAM)
s.bind(("127.0.0.1", zep_params['remote_port']))
res = run(testfunc, timeout=1, echo=True, traceback=True)

View File

@ -3,10 +3,4 @@ include ../Makefile.sys_common
USEMODULE += shell
USEMODULE += shell_cmd_coreclk
# Use a terminal that does not introduce extra characters into the stream.
RIOT_TERMINAL ?= socat
include $(RIOTBASE)/Makefile.include
# the test script skips tests if socat is not used
$(call target-export-variables,$(RIOT_TERMINAL),RIOT_TERMINAL)