Module Name:    src
Committed By:   martin
Date:           Thu Sep  5 08:45:53 UTC 2019

Modified Files:
        src/tests/net/arp [netbsd-9]: t_arp.sh
        src/tests/net/ndp [netbsd-9]: t_ndp.sh

Log Message:
Pull up following revision(s) (requested by roy in ticket #175):

        tests/net/arp/t_arp.sh: revision 1.39
        tests/net/ndp/t_ndp.sh: revision 1.36

tests: fix ARP and NDP tests for RTM_* messages

While here add tests for RTM_MISS.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.37.2.1 src/tests/net/arp/t_arp.sh
cvs rdiff -u -r1.33.2.1 -r1.33.2.2 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/arp/t_arp.sh
diff -u src/tests/net/arp/t_arp.sh:1.37 src/tests/net/arp/t_arp.sh:1.37.2.1
--- src/tests/net/arp/t_arp.sh:1.37	Mon May 13 17:55:08 2019
+++ src/tests/net/arp/t_arp.sh	Thu Sep  5 08:45:53 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: t_arp.sh,v 1.37 2019/05/13 17:55:08 bad Exp $
+#	$NetBSD: t_arp.sh,v 1.37.2.1 2019/09/05 08:45:53 martin Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -33,6 +33,8 @@ IP4NET=10.0.1.0
 IP4DST=10.0.1.2
 IP4DST_PROXYARP1=10.0.1.3
 IP4DST_PROXYARP2=10.0.1.4
+IP4DST_FAIL1=10.0.1.99
+IP4DST_FAIL2=10.0.99.99
 
 DEBUG=${DEBUG:-false}
 TIMEOUT=1
@@ -718,7 +720,38 @@ arp_rtm_body()
 
 	hdr="RTM_ADD.+<UP,HOST,DONE,LLINFO,CLONED>"
 	what="<DST,GATEWAY>"
-	addr="$IP4DST link#2"
+	addr="$IP4DST $macaddr_dst"
+	atf_check -s exit:0 -o match:"$hdr" -o match:"$what" -o match:"$addr" \
+		cat $file
+
+	# Test ping and a resulting routing message (RTM_MISS) on subnet
+	rump.route -n monitor -c 1 > $file &
+	pid=$!
+	sleep 1
+	# arp_maxtries = 5, second between each try
+	atf_check -s exit:2 -o ignore -e ignore \
+		rump.ping -n -w 6 -c 6 $IP4DST_FAIL1
+	wait $pid
+	$DEBUG && cat $file
+
+	hdr="RTM_MISS.+<DONE>"
+	what="<DST,GATEWAY>"
+	addr="$IP4DST_FAIL1 link#2"
+	atf_check -s exit:0 -o match:"$hdr" -o match:"$what" -o match:"$addr" \
+		cat $file
+
+	# Test ping and a resulting routing message (RTM_MISS) off subnet
+	rump.route -n monitor -c 1 > $file &
+	pid=$!
+	sleep 1
+	atf_check -s exit:2 -o ignore -e ignore \
+		rump.ping -n -w 1 -c 1 $IP4DST_FAIL2
+	wait $pid
+	$DEBUG && cat $file
+
+	hdr="RTM_MISS.+<DONE>"
+	what="<DST>"
+	addr="$IP4DST_FAIL2"
 	atf_check -s exit:0 -o match:"$hdr" -o match:"$what" -o match:"$addr" \
 		cat $file
 

Index: src/tests/net/ndp/t_ndp.sh
diff -u src/tests/net/ndp/t_ndp.sh:1.33.2.1 src/tests/net/ndp/t_ndp.sh:1.33.2.2
--- src/tests/net/ndp/t_ndp.sh:1.33.2.1	Mon Aug 26 14:11:04 2019
+++ src/tests/net/ndp/t_ndp.sh	Thu Sep  5 08:45:53 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: t_ndp.sh,v 1.33.2.1 2019/08/26 14:11:04 martin Exp $
+#	$NetBSD: t_ndp.sh,v 1.33.2.2 2019/09/05 08:45:53 martin Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -31,6 +31,8 @@ IP6SRC=fc00::1
 IP6SRC2=fc00::3
 IP6DST=fc00::2
 IP6NET=fc00::0
+IP6DST_FAIL1=fc00::99
+IP6DST_FAIL2=fc01::99
 
 DEBUG=${DEBUG:-false}
 TIMEOUT=1
@@ -454,7 +456,38 @@ ndp_rtm_body()
 
 	hdr="RTM_ADD.+<UP,HOST,DONE,LLINFO,CLONED>"
 	what="<DST,GATEWAY>"
-	addr="$IP6DST link#2"
+	addr="$IP6DST $macaddr_dst"
+	atf_check -s exit:0 -o match:"$hdr" -o match:"$what" -o match:"$addr" \
+		cat $file
+
+	# Test ping and a resulting routing message (RTM_MISS) on subnet
+	rump.route -n monitor -c 1 > $file &
+	pid=$!
+	sleep 1
+	# nd6_mmaxtries = 3, second between each try
+	atf_check -s exit:1 -o ignore -e ignore \
+		rump.ping6 -n -X 3 -c 3 $IP6DST_FAIL1
+	wait $pid
+	$DEBUG && cat $file
+
+	hdr="RTM_MISS.+<DONE>"
+	what="<DST,GATEWAY>"
+	addr="$IP6DST_FAIL1 link#2"
+	atf_check -s exit:0 -o match:"$hdr" -o match:"$what" -o match:"$addr" \
+		cat $file
+
+	# Test ping and a resulting routing message (RTM_MISS) off subnet
+	rump.route -n monitor -c 1 > $file &
+	pid=$!
+	sleep 1
+	atf_check -s exit:1 -o ignore -e ignore \
+		rump.ping6 -n -X 1 -c 1 $IP6DST_FAIL2
+	wait $pid
+	$DEBUG && cat $file
+
+	hdr="RTM_MISS.+<DONE>"
+	what="<DST>"
+	addr="$IP6DST_FAIL2"
 	atf_check -s exit:0 -o match:"$hdr" -o match:"$what" -o match:"$addr" \
 		cat $file
 

Reply via email to