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:
parent
467236dba8
commit
76c04bd647
@ -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
|
||||
|
||||
|
17
tests/gnrc_dhcpv6_client/tests-with-config/check-config.sh
Executable file
17
tests/gnrc_dhcpv6_client/tests-with-config/check-config.sh
Executable 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
|
Loading…
Reference in New Issue
Block a user