diff --git a/tests/gnrc_dhcpv6_client/Makefile b/tests/gnrc_dhcpv6_client/Makefile index a8586b0ed5..9e5c044122 100644 --- a/tests/gnrc_dhcpv6_client/Makefile +++ b/tests/gnrc_dhcpv6_client/Makefile @@ -41,7 +41,12 @@ include $(RIOTBASE)/Makefile.include .PHONY: dhcpv6_server -dhcpv6_server: IFACE := ${IFACE} +# export IFACE variable to environment of dhcpv6_server and +# test-with-config/check-config rules +# see: https://doc.riot-os.org/build-system-basics.html#variable-declaration-guidelines +$(call target-export-variables,test-with-config/check-config,IFACE) + +dhcpv6_server: dhcpv6_server: $(CURDIR)/dhcpv6_server.sh $(DHCPV6_SERVER_PORT) $(CURDIR)/kea-dhcp6.conf diff --git a/tests/gnrc_dhcpv6_client/tests-with-config/check-config.sh b/tests/gnrc_dhcpv6_client/tests-with-config/check-config.sh new file mode 100755 index 0000000000..bc60111fb5 --- /dev/null +++ b/tests/gnrc_dhcpv6_client/tests-with-config/check-config.sh @@ -0,0 +1,17 @@ +#! /bin/sh +# +# check_config.sh +# Copyright (C) 2021 Martine Lenders +# +# Distributed under terms of the MIT license. +# + +ip link show dev "${IFACE}" > /dev/null +RESULT=$? + +if [ $RESULT -ne 0 ]; then + echo "You may be able to create \"${IFACE}\" by using e.g." \ + "\`${RIOTTOOLS#${RIOTBASE}/}/tapsetup/tapsetup\`." +fi + +exit $RESULT