Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/tests/net Pull up following revision(s) (requested by roy...



details:   https://anonhg.NetBSD.org/src/rev/7023974b299f
branches:  netbsd-9
changeset: 962939:7023974b299f
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Sep 05 08:45:53 2019 +0000

description:
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.

diffstat:

 tests/net/arp/t_arp.sh |  37 +++++++++++++++++++++++++++++++++++--
 tests/net/ndp/t_ndp.sh |  37 +++++++++++++++++++++++++++++++++++--
 2 files changed, 70 insertions(+), 4 deletions(-)

diffs (116 lines):

diff -r 0220dff58fdb -r 7023974b299f tests/net/arp/t_arp.sh
--- a/tests/net/arp/t_arp.sh    Thu Sep 05 08:44:10 2019 +0000
+++ b/tests/net/arp/t_arp.sh    Thu Sep 05 08:45:53 2019 +0000
@@ -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 @@
 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 @@
 
        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
 
diff -r 0220dff58fdb -r 7023974b299f tests/net/ndp/t_ndp.sh
--- a/tests/net/ndp/t_ndp.sh    Thu Sep 05 08:44:10 2019 +0000
+++ b/tests/net/ndp/t_ndp.sh    Thu Sep 05 08:45:53 2019 +0000
@@ -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 @@
 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 @@
 
        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
 



Home | Main Index | Thread Index | Old Index