Source-Changes-HG archive

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

[src/trunk]: src/tests/net/route Add more tests of RTF_REJECT



details:   https://anonhg.NetBSD.org/src/rev/1fa6dc515f74
branches:  trunk
changeset: 814968:1fa6dc515f74
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Sat Apr 23 08:54:20 2016 +0000

description:
Add more tests of RTF_REJECT

diffstat:

 tests/net/route/t_flags.sh  |  20 ++++++++++++++++++--
 tests/net/route/t_flags6.sh |  21 +++++++++++++++++++--
 2 files changed, 37 insertions(+), 4 deletions(-)

diffs (83 lines):

diff -r 01ac8ef2c772 -r 1fa6dc515f74 tests/net/route/t_flags.sh
--- a/tests/net/route/t_flags.sh        Fri Apr 22 20:19:30 2016 +0000
+++ b/tests/net/route/t_flags.sh        Sat Apr 23 08:54:20 2016 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_flags.sh,v 1.6 2016/04/22 06:24:10 ozaki-r Exp $
+#      $NetBSD: t_flags.sh,v 1.7 2016/04/23 08:54:20 ozaki-r Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -223,7 +223,7 @@
        # Shouldn't be created
        check_entry_fail 10.0.0.1 UH
 
-       # Gateway is lo0
+       # Gateway is lo0 (RTF_GATEWAY)
 
        # Delete an existing route first
        atf_check -s exit:0 -o ignore rump.route delete -net 10.0.0.0/24
@@ -241,6 +241,22 @@
 
        # Shouldn't be created
        check_entry_fail 10.0.0.1 UH
+
+       # Gateway is lo0 (RTF_HOST)
+
+       # Delete an existing route first
+       atf_check -s exit:0 -o ignore rump.route delete -net 10.0.0.0/24
+
+       atf_check -s exit:0 -o ignore \
+           rump.route add -host 10.0.0.1/24 127.0.0.1 -iface -reject
+       $DEBUG && rump.netstat -rn -f inet
+
+       # Up, Host, Reject, Static
+       check_entry_flags 10.0.0.1 UHRS
+
+       atf_check -s not-exit:0 -o ignore -e match:'No route to host' \
+           rump.ping -n -w 1 -c 1 10.0.0.1
+       $DEBUG && rump.netstat -rn -f inet
 }
 
 test_icmp_redirect()
diff -r 01ac8ef2c772 -r 1fa6dc515f74 tests/net/route/t_flags6.sh
--- a/tests/net/route/t_flags6.sh       Fri Apr 22 20:19:30 2016 +0000
+++ b/tests/net/route/t_flags6.sh       Sat Apr 23 08:54:20 2016 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_flags6.sh,v 1.3 2016/04/22 06:24:10 ozaki-r Exp $
+#      $NetBSD: t_flags6.sh,v 1.4 2016/04/23 08:54:20 ozaki-r Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -203,7 +203,7 @@
        # Shouldn't be created
        check_entry_fail $IP6_PEER UH
 
-       # Gateway is lo0
+       # Gateway is lo0 (RTF_GATEWAY)
 
        # Delete an existing route first
        atf_check -s exit:0 -o ignore \
@@ -222,6 +222,23 @@
 
        # Shouldn't be created
        check_entry_fail $IP6_PEER UH
+
+       # Gateway is lo0 (RTF_HOST)
+
+       # Delete an existing route first
+       atf_check -s exit:0 -o ignore \
+           rump.route delete -inet6 -net fc00::/64
+
+       atf_check -s exit:0 -o ignore \
+           rump.route add -inet6 -host fc00::/64 ::1 -iface -reject
+       $DEBUG && rump.netstat -rn -f inet6
+
+       # Up, Host, Reject, Static
+       check_entry_flags fc00:: UHRS
+
+       atf_check -s not-exit:0 -o ignore -e match:'No route to host' \
+           rump.ping6 -n -X 1 -c 1 $IP6_PEER
+       $DEBUG && rump.netstat -rn -f inet6
 }
 
 test_announce()



Home | Main Index | Thread Index | Old Index