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

tests/gnrc_dhcpv6_client: add script to check if $IFACE exists

This commit is contained in:
Martine Lenders 2021-09-01 16:56:29 +02:00
parent 467236dba8
commit 76c04bd647
No known key found for this signature in database
GPG Key ID: 2134D77A5336DD80
2 changed files with 23 additions and 1 deletions

View File

@ -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

View File

@ -0,0 +1,17 @@
#! /bin/sh
#
# check_config.sh
# Copyright (C) 2021 Martine Lenders <mail@martine-lenders.eu>
#
# 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