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 some tests to change flags of routes
details: https://anonhg.NetBSD.org/src/rev/6a1b0df6a2f1
branches: trunk
changeset: 352233:6a1b0df6a2f1
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Wed Mar 22 06:30:00 2017 +0000
description:
Add some tests to change flags of routes
diffstat:
tests/net/route/t_change.sh | 75 ++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 74 insertions(+), 1 deletions(-)
diffs (94 lines):
diff -r 26d7527060f5 -r 6a1b0df6a2f1 tests/net/route/t_change.sh
--- a/tests/net/route/t_change.sh Wed Mar 22 05:35:33 2017 +0000
+++ b/tests/net/route/t_change.sh Wed Mar 22 06:30:00 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_change.sh,v 1.9 2016/11/07 05:25:37 ozaki-r Exp $
+# $NetBSD: t_change.sh,v 1.10 2017/03/22 06:30:00 ozaki-r Exp $
#
# Copyright (c) 2011 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -293,6 +293,77 @@
env RUMP_SERVER=unix://commsock rump.halt
}
+atf_test_case route_change_flags cleanup
+route_change_flags_head()
+{
+
+ atf_set "descr" "Change flags of a route"
+ atf_set "require.progs" "rump_server"
+}
+
+route_change_flags_body()
+{
+
+ atf_check -s exit:0 ${netserver} ${RUMP_SERVER}
+
+ atf_check -s exit:0 rump.ifconfig shmif0 create
+ atf_check -s exit:0 rump.ifconfig shmif0 linkstr bus
+ atf_check -s exit:0 rump.ifconfig shmif0 10.0.0.10/24 up
+
+ check_route 10.0.0/24 '' UC shmif0
+ # Set reject flag
+ atf_check -s exit:0 -o ignore \
+ rump.route change -net 10.0.0.0/24 -reject
+ check_route 10.0.0/24 '' URCS shmif0
+ # Clear reject flag
+ atf_check -s exit:0 -o ignore \
+ rump.route change -net 10.0.0.0/24 -noreject
+ check_route 10.0.0/24 '' UCS shmif0
+
+ # TODO other flags
+}
+
+route_change_default_flags_cleanup()
+{
+
+ env RUMP_SERVER=unix://commsock rump.halt
+}
+
+atf_test_case route_change_default_flags cleanup
+route_change_default_flags_head()
+{
+
+ atf_set "descr" "Change flags of the default route"
+ atf_set "require.progs" "rump_server"
+}
+
+route_change_default_flags_body()
+{
+
+ atf_check -s exit:0 ${netserver} ${RUMP_SERVER}
+
+ atf_check -s exit:0 rump.ifconfig shmif0 create
+ atf_check -s exit:0 rump.ifconfig shmif0 linkstr bus
+ atf_check -s exit:0 rump.ifconfig shmif0 10.0.0.10/24 up
+
+ atf_check -s exit:0 -o ignore rump.route add default 10.0.0.1
+ check_route default 10.0.0.1 UGS shmif0
+ # Set reject flag
+ atf_check -s exit:0 -o ignore rump.route change default -reject
+ check_route default 10.0.0.1 UGRS shmif0
+ # Clear reject flag
+ atf_check -s exit:0 -o ignore rump.route change default -noreject
+ check_route default 10.0.0.1 UGS shmif0
+
+ # TODO other flags
+}
+
+route_change_default_flags_cleanup()
+{
+
+ env RUMP_SERVER=unix://commsock rump.halt
+}
+
atf_init_test_cases()
{
@@ -301,4 +372,6 @@
atf_add_test_case route_change_ifa
atf_add_test_case route_change_ifp
atf_add_test_case route_change_ifp_ifa
+ atf_add_test_case route_change_flags
+ atf_add_test_case route_change_default_flags
}
Home |
Main Index |
Thread Index |
Old Index