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/7040a25256fb
branches: trunk
changeset: 344811:7040a25256fb
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Fri Apr 22 06:24:10 2016 +0000
description:
Add more tests of RTF_REJECT
diffstat:
tests/net/route/t_flags.sh | 21 ++++++++++++++++++++-
tests/net/route/t_flags6.sh | 22 +++++++++++++++++++++-
2 files changed, 41 insertions(+), 2 deletions(-)
diffs (71 lines):
diff -r e93065722e6f -r 7040a25256fb tests/net/route/t_flags.sh
--- a/tests/net/route/t_flags.sh Fri Apr 22 05:34:58 2016 +0000
+++ b/tests/net/route/t_flags.sh Fri Apr 22 06:24:10 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_flags.sh,v 1.5 2016/04/21 09:46:49 ozaki-r Exp $
+# $NetBSD: t_flags.sh,v 1.6 2016/04/22 06:24:10 ozaki-r Exp $
#
# Copyright (c) 2015 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -222,6 +222,25 @@
# Shouldn't be created
check_entry_fail 10.0.0.1 UH
+
+ # Gateway is lo0
+
+ # 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 127.0.0.1 -reject
+ $DEBUG && rump.netstat -rn -f inet
+
+ # Up, Gateway, Reject, Static
+ check_entry_flags 10.0.0/24 UGRS
+
+ atf_check -s not-exit:0 -o ignore -e match:'Network is unreachable' \
+ rump.ping -n -w 1 -c 1 10.0.0.1
+ $DEBUG && rump.netstat -rn -f inet
+
+ # Shouldn't be created
+ check_entry_fail 10.0.0.1 UH
}
test_icmp_redirect()
diff -r e93065722e6f -r 7040a25256fb tests/net/route/t_flags6.sh
--- a/tests/net/route/t_flags6.sh Fri Apr 22 05:34:58 2016 +0000
+++ b/tests/net/route/t_flags6.sh Fri Apr 22 06:24:10 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_flags6.sh,v 1.2 2016/04/21 09:46:49 ozaki-r Exp $
+# $NetBSD: t_flags6.sh,v 1.3 2016/04/22 06:24:10 ozaki-r Exp $
#
# Copyright (c) 2016 Internet Initiative Japan Inc.
# All rights reserved.
@@ -202,6 +202,26 @@
# Shouldn't be created
check_entry_fail $IP6_PEER UH
+
+ # Gateway is lo0
+
+ # 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 -net fc00::/64 ::1 -reject
+ $DEBUG && rump.netstat -rn -f inet6
+
+ # Up, Gateway, Reject, Static
+ check_entry_flags fc00::/64 UGRS
+
+ atf_check -s not-exit:0 -o ignore -e match:'Network is unreachable' \
+ rump.ping6 -n -X 1 -c 1 $IP6_PEER
+ $DEBUG && rump.netstat -rn -f inet6
+
+ # Shouldn't be created
+ check_entry_fail $IP6_PEER UH
}
test_announce()
Home |
Main Index |
Thread Index |
Old Index