Module Name: src
Committed By: roy
Date: Tue Sep 3 19:07:50 UTC 2019
Modified Files:
src/tests/net/arp: t_arp.sh
src/tests/net/ndp: t_ndp.sh
Log Message:
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.38 -r1.39 src/tests/net/arp/t_arp.sh
cvs rdiff -u -r1.35 -r1.36 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.38 src/tests/net/arp/t_arp.sh:1.39
--- src/tests/net/arp/t_arp.sh:1.38 Mon Aug 19 03:22:05 2019
+++ src/tests/net/arp/t_arp.sh Tue Sep 3 19:07:50 2019
@@ -1,4 +1,4 @@
-# $NetBSD: t_arp.sh,v 1.38 2019/08/19 03:22:05 ozaki-r Exp $
+# $NetBSD: t_arp.sh,v 1.39 2019/09/03 19:07:50 roy 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.35 src/tests/net/ndp/t_ndp.sh:1.36
--- src/tests/net/ndp/t_ndp.sh:1.35 Mon Aug 19 03:20:27 2019
+++ src/tests/net/ndp/t_ndp.sh Tue Sep 3 19:07:50 2019
@@ -1,4 +1,4 @@
-# $NetBSD: t_ndp.sh,v 1.35 2019/08/19 03:20:27 ozaki-r Exp $
+# $NetBSD: t_ndp.sh,v 1.36 2019/09/03 19:07:50 roy 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