From 79945603f0273542282c27f8f996f2546a525e6a Mon Sep 17 00:00:00 2001 From: ozaki-r Date: Thu, 20 Feb 2020 08:02:26 +0000 Subject: [PATCH] tests: abort if MAC address duplication found --- tests/net/net_common.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/net/net_common.sh b/tests/net/net_common.sh index 73325fa75e45..7c2602f40462 100644 --- a/tests/net/net_common.sh +++ b/tests/net/net_common.sh @@ -1,4 +1,4 @@ -# $NetBSD: net_common.sh,v 1.38 2020/02/20 07:58:19 ozaki-r Exp $ +# $NetBSD: net_common.sh,v 1.39 2020/02/20 08:02:26 ozaki-r Exp $ # # Copyright (c) 2016 Internet Initiative Japan Inc. # All rights reserved. @@ -183,6 +183,7 @@ CRYPTO_NPF_LIBS="$CRYPTO_LIBS -lrumpvfs -lrumpdev_bpf -lrumpnet_npf" _rump_server_socks=./.__socks _rump_server_ifaces=./.__ifaces _rump_server_buses=./.__buses +_rump_server_macaddrs=./.__macaddrs DEBUG_SYSCTL_ENTRIES="net.inet.arp.debug net.inet6.icmp6.nd6_debug \ net.inet.ipsec.debug" @@ -318,14 +319,21 @@ rump_server_add_iface() local ifname=$2 local bus=$3 local backup=$RUMP_SERVER + local macaddr= export RUMP_SERVER=$sock atf_check -s exit:0 rump.ifconfig $ifname create if [ -n "$bus" ]; then atf_check -s exit:0 rump.ifconfig $ifname linkstr $bus fi + macaddr=$(get_macaddr $sock $ifname) export RUMP_SERVER=$backup + if [ -f $_rump_server_macaddrs ]; then + atf_check -s not-exit:0 grep -q $macaddr $_rump_server_macaddrs + fi + echo $macaddr >> $_rump_server_macaddrs + echo $sock $ifname >> $_rump_server_ifaces $DEBUG && cat $_rump_server_ifaces