Source-Changes-HG archive

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

[src/trunk]: src/tests/net/route Fix tests for blackhole routes



details:   https://anonhg.NetBSD.org/src/rev/db3e2ff1400a
branches:  trunk
changeset: 814941:db3e2ff1400a
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Thu Apr 21 09:46:49 2016 +0000

description:
Fix tests for blackhole routes

The gateway of a blackhole route must be a loopback interface.

diffstat:

 tests/net/route/t_flags.sh  |  10 +++++++---
 tests/net/route/t_flags6.sh |   9 ++++++---
 2 files changed, 13 insertions(+), 6 deletions(-)

diffs (65 lines):

diff -r e28a5ab9dfb2 -r db3e2ff1400a tests/net/route/t_flags.sh
--- a/tests/net/route/t_flags.sh        Thu Apr 21 07:24:09 2016 +0000
+++ b/tests/net/route/t_flags.sh        Thu Apr 21 09:46:49 2016 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_flags.sh,v 1.4 2016/04/04 07:37:08 ozaki-r Exp $
+#      $NetBSD: t_flags.sh,v 1.5 2016/04/21 09:46:49 ozaki-r Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -181,16 +181,20 @@
 
        export RUMP_SERVER=$SOCK_LOCAL
 
+       atf_check -s exit:0 -o ignore rump.ping -n -w 1 -c 1 10.0.0.1
+
        # 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 -net 10.0.0.0/24 10.0.0.1 -blackhole
+       # Gateway must be lo0
+       atf_check -s exit:0 -o ignore \
+           rump.route add -net 10.0.0.0/24 127.0.0.1 -blackhole
        $DEBUG && rump.netstat -rn -f inet
 
        # Up, Gateway, Blackhole, Static
        check_entry_flags 10.0.0/24 UGBS
 
-       atf_check -s not-exit:0 -o ignore -e match:'No route to host' \
+       atf_check -s not-exit:0 -o match:'100.0% packet loss' \
            rump.ping -n -w 1 -c 1 10.0.0.1
        $DEBUG && rump.netstat -rn -f inet
 
diff -r e28a5ab9dfb2 -r db3e2ff1400a tests/net/route/t_flags6.sh
--- a/tests/net/route/t_flags6.sh       Thu Apr 21 07:24:09 2016 +0000
+++ b/tests/net/route/t_flags6.sh       Thu Apr 21 09:46:49 2016 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_flags6.sh,v 1.1 2016/04/21 05:10:15 ozaki-r Exp $
+#      $NetBSD: t_flags6.sh,v 1.2 2016/04/21 09:46:49 ozaki-r Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -158,18 +158,21 @@
 
        export RUMP_SERVER=$SOCK_LOCAL
 
+       atf_check -s exit:0 -o ignore rump.ping6 -n -X 1 -c 1 $IP6_PEER
+
        # Delete an existing route first
        atf_check -s exit:0 -o ignore \
            rump.route delete -inet6 -net fc00::/64
 
+       # Gateway must be lo0
        atf_check -s exit:0 -o ignore \
-           rump.route add -inet6 -net fc00::/64 $IP6_PEER -blackhole
+           rump.route add -inet6 -net fc00::/64 ::1 -blackhole
        $DEBUG && rump.netstat -rn -f inet6
 
        # Up, Gateway, Blackhole, Static
        check_entry_flags fc00::/64 UGBS
 
-       atf_check -s not-exit:0 -o ignore -e match:'No route to host' \
+       atf_check -s not-exit:0 -o match:'100.0% packet loss' \
            rump.ping6 -n -X 1 -c 1 $IP6_PEER
        $DEBUG && rump.netstat -rn -f inet6
 



Home | Main Index | Thread Index | Old Index