Skip to content

Commit

Permalink
examples: tests: update native TERMFLAGS
Browse files Browse the repository at this point in the history
Updating the Makefiles for example and test applications to set the
TERMFLAGS correctly for native.
  • Loading branch information
OlegHahm committed Dec 13, 2023
1 parent 0f7bed0 commit fe1332d
Show file tree
Hide file tree
Showing 24 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions examples/gcoap/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ USE_ZEP ?= 0
# set the ZEP port for native
ZEP_PORT_BASE ?= 17754
ifeq (1,$(USE_ZEP))
TERMFLAGS += -z [::1]:$(ZEP_PORT_BASE)
TERMFLAGS += --native-args '-z [::1]:$(ZEP_PORT_BASE)'
USEMODULE += socket_zep

ifneq (,$(ZEP_MAC))
TERMFLAGS += --eui64=$(ZEP_MAC)
TERMFLAGS += --native-args '\-\-eui64=$(ZEP_MAC)'
endif
endif

Expand Down
4 changes: 2 additions & 2 deletions examples/gcoap_dtls/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ USE_ZEP ?= 0
# set the ZEP port for native
ZEP_PORT_BASE ?= 17754
ifeq (1,$(USE_ZEP))
TERMFLAGS += -z [::1]:$(ZEP_PORT_BASE)
TERMFLAGS += --native-args '-z [::1]:$(ZEP_PORT_BASE)'
USEMODULE += socket_zep

ifneq (,$(ZEP_MAC))
TERMFLAGS += --eui64=$(ZEP_MAC)
TERMFLAGS += --native-args '\-\-eui64=$(ZEP_MAC)'
endif
endif

Expand Down
2 changes: 1 addition & 1 deletion examples/gnrc_border_router/Makefile.native.conf
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ TERMFLAGS ?= $(patsubst %,-z [::1]:%, $(shell seq $(ZEP_PORT_BASE) $(ZEP_PORT_MA

# set optional ZEP l2 address
ifneq (,$(ZEP_MAC))
TERMFLAGS += --eui64=$(ZEP_MAC)
TERMFLAGS += --native-args '\-\-eui64=$(ZEP_MAC)'
endif

# native uses $PORT to specify the TAP interface
Expand Down
4 changes: 2 additions & 2 deletions examples/gnrc_networking/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ USE_ZEP ?= 0
# set the ZEP port for native
ZEP_PORT_BASE ?= 17754
ifeq (1,$(USE_ZEP))
TERMFLAGS += -z [::1]:$(ZEP_PORT_BASE)
TERMFLAGS += --native-args '-z [::1]:$(ZEP_PORT_BASE)'
USEMODULE += socket_zep

ifneq (,$(ZEP_MAC))
TERMFLAGS += --eui64=$(ZEP_MAC)
TERMFLAGS += --native-args '\-\-eui64=$(ZEP_MAC)'
endif
endif

Expand Down
2 changes: 1 addition & 1 deletion tests/net/emcute/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export TAP ?= tap0

# use Ethernet as link-layer protocol
ifeq (native,$(BOARD))
TERMFLAGS ?= $(TAP)
PORT += $(TAP)
else
ETHOS_BAUDRATE ?= 115200
CFLAGS += -DETHOS_BAUDRATE=$(ETHOS_BAUDRATE)
Expand Down
2 changes: 1 addition & 1 deletion tests/net/gcoap_fileserver/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ifeq (native, $(BOARD))
USEMODULE += socket_zep
USEMODULE += socket_zep_hello
USEMODULE += netdev
TERMFLAGS += -z 127.0.0.1:17754 # Murdock has no IPv6 support
TERMFLAGS += --native-args '-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
Expand Down
2 changes: 1 addition & 1 deletion tests/net/gnrc_dhcpv6_client_6lbr/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ USEMODULE += shell_cmds_default

# use Ethernet as link-layer protocol
ifeq (native,$(BOARD))
TERMFLAGS += -z [::1]:17754
TERMFLAGS += --native-args '-z [::1]:17754'
else
ETHOS_BAUDRATE ?= 115200
CFLAGS += -DETHOS_BAUDRATE=$(ETHOS_BAUDRATE)
Expand Down
2 changes: 1 addition & 1 deletion tests/net/gnrc_dhcpv6_relay/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ USEMODULE += gnrc_netif_single # Only one interface used and it makes

# use Ethernet as link-layer protocol
ifeq (native,$(BOARD))
TERMFLAGS ?= $(TAP)
PORT ?= $(TAP)
else
ETHOS_BAUDRATE ?= 115200
CFLAGS += -DETHOS_BAUDRATE=$(ETHOS_BAUDRATE)
Expand Down
2 changes: 1 addition & 1 deletion tests/net/gnrc_ipv6_ext/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export TAP ?= tap0

# use Ethernet as link-layer protocol
ifeq (native,$(BOARD))
TERMFLAGS ?= $(TAP)
PORT ?= $(TAP)
else
ETHOS_BAUDRATE ?= 115200
CFLAGS += -DETHOS_BAUDRATE=$(ETHOS_BAUDRATE)
Expand Down
2 changes: 1 addition & 1 deletion tests/net/gnrc_ipv6_ext_frag/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CFLAGS += -DOUTPUT=TEXT
CFLAGS += -DTEST_SUITES="gnrc_ipv6_ext_frag"

ifeq (native,$(BOARD))
TERMFLAGS ?= $(TAP)
PORT ?= $(TAP)
else
ETHOS_BAUDRATE ?= 115200
CFLAGS += -DETHOS_BAUDRATE=$(ETHOS_BAUDRATE)
Expand Down
2 changes: 1 addition & 1 deletion tests/net/gnrc_ipv6_ext_opt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export TAP ?= tap0

# use Ethernet as link-layer protocol
ifeq (native,$(BOARD))
TERMFLAGS ?= $(TAP)
PORT ?= $(TAP)
else
ETHOS_BAUDRATE ?= 115200
CFLAGS += -DETHOS_BAUDRATE=$(ETHOS_BAUDRATE)
Expand Down
2 changes: 1 addition & 1 deletion tests/net/gnrc_ipv6_nib_dns/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ USEMODULE += gnrc_ipv6_default
USEMODULE += gnrc_ipv6_nib_dns
# use Ethernet as link-layer protocol
ifeq (native,$(BOARD))
TERMFLAGS ?= $(TAP)
PORT ?= $(TAP)
else
ETHOS_BAUDRATE ?= 115200
CFLAGS += -DETHOS_BAUDRATE=$(ETHOS_BAUDRATE)
Expand Down
2 changes: 1 addition & 1 deletion tests/net/gnrc_netif_ieee802154/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ include ../Makefile.net_common

ifeq (native, $(BOARD))
USEMODULE += socket_zep
TERMFLAGS ?= -z "0.0.0.0:17755,localhost:17754"
TERMFLAGS ?= --native-args '-z "0.0.0.0:17755,localhost:17754"'
USEMODULE += netdev
# somehow this breaks the test
DISABLE_MODULE += test_utils_print_stack_usage
Expand Down
2 changes: 1 addition & 1 deletion tests/net/gnrc_rpl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ifeq (native, $(BOARD))
USEMODULE += socket_zep
USEMODULE += socket_zep_hello
USEMODULE += netdev
TERMFLAGS += -z 127.0.0.1:17754 # Murdock has no IPv6 support
TERMFLAGS += --native-args '-z 127.0.0.1:17754' # Murdock has no IPv6 support
else
USEMODULE += netdev_default
# automated test only works on native
Expand Down
2 changes: 1 addition & 1 deletion tests/net/gnrc_rpl_srh/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CFLAGS += -DOUTPUT=TEXT

# use Ethernet as link-layer protocol
ifeq (native,$(BOARD))
TERMFLAGS ?= $(TAP)
PORT ?= $(TAP)
else
ETHOS_BAUDRATE ?= 115200
CFLAGS += -DETHOS_BAUDRATE=$(ETHOS_BAUDRATE)
Expand Down
2 changes: 1 addition & 1 deletion tests/net/gnrc_sixlowpan_frag_sfr_congure_impl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ifeq (native, $(BOARD))
USEMODULE += socket_zep
USEMODULE += socket_zep_hello
USEMODULE += netdev
TERMFLAGS = -z 127.0.0.1:17754 # Murdock has no IPv6 support
TERMFLAGS = --native-args '-z 127.0.0.1:17754' # Murdock has no IPv6 support
else
USEMODULE += netdev_default
# automated test only works on native
Expand Down
2 changes: 1 addition & 1 deletion tests/net/gnrc_sock_dns/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ USEMODULE += gnrc_netif_single # Only one interface used and it makes
# shell commands easier
# use Ethernet as link-layer protocol
ifeq (native,$(BOARD))
TERMFLAGS ?= $(TAP)
PORT ?= $(TAP)
else
ETHOS_BAUDRATE ?= 115200
CFLAGS += -DETHOS_BAUDRATE=$(ETHOS_BAUDRATE)
Expand Down
2 changes: 1 addition & 1 deletion tests/net/gnrc_sock_dodtls/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ USEPKG += tinydtls

# use Ethernet as link-layer protocol
ifeq (native,$(BOARD))
TERMFLAGS ?= $(TAP)
PORT ?= $(TAP)
else
ETHOS_BAUDRATE ?= 115200
CFLAGS += -DETHOS_BAUDRATE=$(ETHOS_BAUDRATE)
Expand Down
2 changes: 1 addition & 1 deletion tests/net/gnrc_sock_tcp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ TIMEOUT_MS ?= 3000
TEST_ON_CI_BLACKLIST += all

ifeq (native,$(BOARD))
TERMFLAGS ?= $(TAP)
PORT ?= $(TAP)
else
ETHOS_BAUDRATE ?= 115200
CFLAGS += -DETHOS_BAUDRATE=$(ETHOS_BAUDRATE)
Expand Down
2 changes: 1 addition & 1 deletion tests/net/gnrc_tcp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ CUSTOM_GNRC_TCP_NO_TIMEOUT ?= 1
TEST_ON_CI_BLACKLIST += all

ifeq (native,$(BOARD))
TERMFLAGS ?= $(TAP)
PORT ?= $(TAP)
else
ETHOS_BAUDRATE ?= 115200
CFLAGS += -DETHOS_BAUDRATE=$(ETHOS_BAUDRATE)
Expand Down
2 changes: 1 addition & 1 deletion tests/net/ieee802154_hal/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ BOARD_WHITELIST += adafruit-clue \

ifeq ($(BOARD), native)
ZEP_PORT_BASE ?= 17754
TERMFLAGS += -z [::1]:$(ZEP_PORT_BASE)
TERMFLAGS += --native-args '-z [::1]:$(ZEP_PORT_BASE)'
USEMODULE += socket_zep
# the same for Kconfig
ifeq (1,$(TEST_KCONFIG))
Expand Down
2 changes: 1 addition & 1 deletion tests/net/ieee802154_submac/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ USEMODULE += ztimer_usec

ifeq ($(BOARD), native)
ZEP_PORT_BASE ?= 17754
TERMFLAGS += -z [::1]:$(ZEP_PORT_BASE)
TERMFLAGS += --native-args '-z [::1]:$(ZEP_PORT_BASE)'
USEMODULE += socket_zep
endif

Expand Down
2 changes: 1 addition & 1 deletion tests/net/socket_zep/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ USEMODULE += od
USEMODULE += socket_zep
USEMODULE += netdev

TERMFLAGS ?= -z [::1]:17754
TERMFLAGS ?= --native-args '-z [::1]:17754'

include $(RIOTBASE)/Makefile.include
6 changes: 3 additions & 3 deletions tests/net/socket_zep/tests/01-run.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ def testfunc(child):


if __name__ == "__main__":
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'])
os.environ['TERMFLAGS'] = "--native-args '\\-\\-eui64=00:5a:45:50:0a:00:30:38' --native-args '-z [%s]:%d,[%s]:%d'" \

Check failure on line 54 in tests/net/socket_zep/tests/01-run.py

View workflow job for this annotation

GitHub Actions / static-tests

E501 line too long (120 > 119 characters)
% ( zep_params['local_addr'], zep_params['local_port'],

Check failure on line 55 in tests/net/socket_zep/tests/01-run.py

View workflow job for this annotation

GitHub Actions / static-tests

E201 whitespace after '('
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)
Expand Down

0 comments on commit fe1332d

Please sign in to comment.