Module Name:    src
Committed By:   ozaki-r
Date:           Thu Mar 22 09:21:24 UTC 2018

Modified Files:
        src/tests/net/if_tap: t_tap.sh
        src/tests/net/ndp: t_ndp.sh

Log Message:
Avoid setting IP addresses of the same subnet on different interface

If we do so, there will remain one route that is of a preceding address, but
that behavior is not documented and may be changed in the future.  Tests
shouldn't rely on such a unstable behavior.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/net/if_tap/t_tap.sh
cvs rdiff -u -r1.30 -r1.31 src/tests/net/ndp/t_ndp.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/net/if_tap/t_tap.sh
diff -u src/tests/net/if_tap/t_tap.sh:1.7 src/tests/net/if_tap/t_tap.sh:1.8
--- src/tests/net/if_tap/t_tap.sh:1.7	Thu Feb  1 05:22:02 2018
+++ src/tests/net/if_tap/t_tap.sh	Thu Mar 22 09:21:24 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: t_tap.sh,v 1.7 2018/02/01 05:22:02 ozaki-r Exp $
+#	$NetBSD: t_tap.sh,v 1.8 2018/03/22 09:21:24 ozaki-r Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -82,10 +82,6 @@ tap_stand_alone_body()
 	atf_check -s exit:0 rump.ifconfig shmif0 $IP4_LOCAL
 	atf_check -s exit:0 rump.ifconfig shmif0 inet6 $IP6_LOCAL
 	atf_check -s exit:0 rump.ifconfig shmif0 up
-	atf_check -s exit:0 rump.ifconfig tap0 create
-	atf_check -s exit:0 rump.ifconfig tap0 $IP4_TAP
-	atf_check -s exit:0 rump.ifconfig tap0 inet6 $IP6_TAP
-	atf_check -s exit:0 rump.ifconfig tap0 up
 	atf_check -s exit:0 rump.ifconfig -w 10
 
 	export RUMP_SERVER=${SOCK_REMOTE}
@@ -96,14 +92,23 @@ tap_stand_alone_body()
 	atf_check -s exit:0 rump.ifconfig -w 10
 
 	atf_check -s exit:0 -o ignore rump.ping -n -w $TIMEOUT -c 1 $IP4_LOCAL
-	# Cannot reach to an alone tap
-	atf_check -s not-exit:0 -o ignore -e ignore \
-	    rump.ping -n -w $TIMEOUT -c 1 $IP4_TAP
-
 	atf_check -s exit:0 -o ignore rump.ping6 -n -X $TIMEOUT -c 1 $IP6_LOCAL
+
+	export RUMP_SERVER=${SOCK_LOCAL}
+	atf_check -s exit:0 rump.ifconfig shmif0 $IP4_LOCAL delete
+	atf_check -s exit:0 rump.ifconfig shmif0 inet6 $IP6_LOCAL delete
+	atf_check -s exit:0 rump.ifconfig tap0 create
+	atf_check -s exit:0 rump.ifconfig tap0 $IP4_TAP
+	atf_check -s exit:0 rump.ifconfig tap0 inet6 $IP6_TAP
+	atf_check -s exit:0 rump.ifconfig tap0 up
+	atf_check -s exit:0 rump.ifconfig -w 10
+
+	export RUMP_SERVER=${SOCK_REMOTE}
 	# Cannot reach to an alone tap
 	atf_check -s not-exit:0 -o ignore -e ignore \
 	    rump.ping6 -n -X $TIMEOUT -c 1 $IP6_TAP
+	atf_check -s not-exit:0 -o ignore -e ignore \
+	    rump.ping -n -w $TIMEOUT -c 1 $IP4_TAP
 
 	rump_server_destroy_ifaces
 }

Index: src/tests/net/ndp/t_ndp.sh
diff -u src/tests/net/ndp/t_ndp.sh:1.30 src/tests/net/ndp/t_ndp.sh:1.31
--- src/tests/net/ndp/t_ndp.sh:1.30	Fri Nov 24 03:38:32 2017
+++ src/tests/net/ndp/t_ndp.sh	Thu Mar 22 09:21:24 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: t_ndp.sh,v 1.30 2017/11/24 03:38:32 kre Exp $
+#	$NetBSD: t_ndp.sh,v 1.31 2018/03/22 09:21:24 ozaki-r Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -488,7 +488,7 @@ ndp_purge_on_route_change_body()
 
 	rump_server_add_iface $SOCKSRC shmif1 bus1
 	export RUMP_SERVER=$SOCKSRC
-	atf_check -s exit:0 rump.ifconfig shmif1 inet6 $IP6SRC2
+	atf_check -s exit:0 rump.ifconfig shmif1 inet6 fc00:1::1
 	atf_check -s exit:0 rump.ifconfig -w 10
 
 	$DEBUG && rump.netstat -nr -f inet6

Reply via email to