Module Name:    src
Committed By:   ozaki-r
Date:           Fri Dec 16 03:14:23 UTC 2016

Modified Files:
        src/tests/net/ndp: t_ra.sh

Log Message:
Improve stability of the tests

- Do ifconfig -w 10 after ifconfig up
- Accept /1d0h0m..s/ in addition to /23h59m..s/ for expiration time
- Prevent new RA messages from coming after flushing entries

The changes should fix flapping of test results on babylon5.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/net/ndp/t_ra.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/ndp/t_ra.sh
diff -u src/tests/net/ndp/t_ra.sh:1.7 src/tests/net/ndp/t_ra.sh:1.8
--- src/tests/net/ndp/t_ra.sh:1.7	Wed Dec 14 07:37:26 2016
+++ src/tests/net/ndp/t_ra.sh	Fri Dec 16 03:14:23 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: t_ra.sh,v 1.7 2016/12/14 07:37:26 ozaki-r Exp $
+#	$NetBSD: t_ra.sh,v 1.8 2016/12/16 03:14:23 ozaki-r Exp $
 #
 # Copyright (c) 2015 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -43,6 +43,7 @@ setup_shmif0()
 	export RUMP_SERVER=$sock
 	atf_check -s exit:0 rump.ifconfig shmif0 inet6 ${IP6ADDR}
 	atf_check -s exit:0 rump.ifconfig shmif0 up
+	atf_check -s exit:0 rump.ifconfig -w 10
 
 	$DEBUG && rump.ifconfig
 }
@@ -144,7 +145,7 @@ ra_basic_body()
 	atf_check -s exit:0 -o match:'if=shmif0' rump.ndp -r
 	atf_check -s exit:0 -o match:'advertised' rump.ndp -p
 	atf_check -s exit:0 -o match:'linkmtu=1300' rump.ndp -n -i shmif0
-	atf_check -s exit:0 -o match:'23h59m..s S R' rump.ndp -n -a
+	atf_check -s exit:0 -o match:'(23h59m|1d0h0m)..s S R' rump.ndp -n -a
 	atf_check -s exit:0 -o match:'fc00:1:' rump.ndp -n -a
 	atf_check -s exit:0 -o match:'fc00:1:' rump.ifconfig shmif0 inet6
 	unset RUMP_SERVER
@@ -208,10 +209,14 @@ ra_flush_prefix_entries_body()
 	atf_check -s exit:0 -o match:'if=shmif0' rump.ndp -r
 	atf_check -s exit:0 -o match:'advertised' rump.ndp -p
 	atf_check -s exit:0 -o match:'linkmtu=1300' rump.ndp -n -i shmif0
-	atf_check -s exit:0 -o match:'23h59m..s S R' rump.ndp -n -a
+	atf_check -s exit:0 -o match:'(23h59m|1d0h0m)..s S R' rump.ndp -n -a
 	atf_check -s exit:0 -o match:'fc00:1:' rump.ndp -n -a
 	atf_check -s exit:0 -o match:'fc00:1:' rump.ifconfig shmif0 inet6
 
+	# Terminate rtadvd to prevent new RA messages from coming
+	# Note that ifconfig down; kill -TERM doesn't work
+	kill -KILL `cat ${PIDFILE}`
+
 	# Flush all the entries in the prefix list
 	atf_check -s exit:0 rump.ndp -P
 
@@ -219,25 +224,17 @@ ra_flush_prefix_entries_body()
 	atf_check -s exit:0 -o match:'if=shmif0' rump.ndp -r
 	atf_check -s exit:0 -o empty rump.ndp -p
 	atf_check -s exit:0 -o match:'linkmtu=1300' rump.ndp -n -i shmif0
-	atf_check -s exit:0 -o match:'23h59m..s S R' rump.ndp -n -a
+	atf_check -s exit:0 -o match:'(23h59m|1d0h0m)..s S R' rump.ndp -n -a
 	atf_check -s exit:0 -o match:'fc00:1:' rump.ndp -n -a
 	atf_check -s exit:0 -o not-match:'fc00:1:' rump.ifconfig shmif0 inet6
 	unset RUMP_SERVER
 
-	atf_check -s exit:0 kill -TERM `cat ${PIDFILE}`
-	wait_term ${PIDFILE}
-
 	rump_server_destroy_ifaces
 }
 
 ra_flush_prefix_entries_cleanup()
 {
 
-	if [ -f ${PIDFILE} ]; then
-		kill -TERM `cat ${PIDFILE}`
-		wait_term ${PIDFILE}
-	fi
-
 	$DEBUG && dump
 	cleanup
 }
@@ -283,10 +280,14 @@ ra_flush_defrouter_entries_body()
 	atf_check -s exit:0 -o match:'if=shmif0' rump.ndp -r
 	atf_check -s exit:0 -o match:'advertised' rump.ndp -p
 	atf_check -s exit:0 -o match:'linkmtu=1300' rump.ndp -n -i shmif0
-	atf_check -s exit:0 -o match:'23h59m..s S R' rump.ndp -n -a
+	atf_check -s exit:0 -o match:'(23h59m|1d0h0m)..s S R' rump.ndp -n -a
 	atf_check -s exit:0 -o match:'fc00:1:' rump.ndp -n -a
 	atf_check -s exit:0 -o match:'fc00:1:' rump.ifconfig shmif0 inet6
 
+	# Terminate rtadvd to prevent new RA messages from coming
+	# Note that ifconfig down; kill -TERM doesn't work
+	kill -KILL `cat ${PIDFILE}`
+
 	# Flush all the entries in the default router list
 	atf_check -s exit:0 rump.ndp -R
 
@@ -294,25 +295,17 @@ ra_flush_defrouter_entries_body()
 	atf_check -s exit:0 -o empty rump.ndp -r
 	atf_check -s exit:0 -o match:'No advertising router' rump.ndp -p
 	atf_check -s exit:0 -o match:'linkmtu=1300' rump.ndp -n -i shmif0
-	atf_check -s exit:0 -o match:'23h59m..s S R' rump.ndp -n -a
+	atf_check -s exit:0 -o match:'(23h59m|1d0h0m)..s S R' rump.ndp -n -a
 	atf_check -s exit:0 -o match:'fc00:1:' rump.ndp -n -a
 	atf_check -s exit:0 -o match:'fc00:1:' rump.ifconfig shmif0 inet6
 	unset RUMP_SERVER
 
-	atf_check -s exit:0 kill -TERM `cat ${PIDFILE}`
-	wait_term ${PIDFILE}
-
 	rump_server_destroy_ifaces
 }
 
 ra_flush_defrouter_entries_cleanup()
 {
 
-	if [ -f ${PIDFILE} ]; then
-		kill -TERM `cat ${PIDFILE}`
-		wait_term ${PIDFILE}
-	fi
-
 	$DEBUG && dump
 	cleanup
 }

Reply via email to