Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/net/ndp Add a test case that deletes auto-configured a...
details: https://anonhg.NetBSD.org/src/rev/0635d2fbd61a
branches: trunk
changeset: 349604:0635d2fbd61a
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Fri Dec 16 03:49:45 2016 +0000
description:
Add a test case that deletes auto-configured addresses
diffstat:
tests/net/ndp/t_ra.sh | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 70 insertions(+), 1 deletions(-)
diffs (89 lines):
diff -r 7a7127a310bc -r 0635d2fbd61a tests/net/ndp/t_ra.sh
--- a/tests/net/ndp/t_ra.sh Fri Dec 16 03:14:23 2016 +0000
+++ b/tests/net/ndp/t_ra.sh Fri Dec 16 03:49:45 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_ra.sh,v 1.8 2016/12/16 03:14:23 ozaki-r Exp $
+# $NetBSD: t_ra.sh,v 1.9 2016/12/16 03:49:45 ozaki-r Exp $
#
# Copyright (c) 2015 Internet Initiative Japan Inc.
# All rights reserved.
@@ -310,10 +310,79 @@
cleanup
}
+atf_test_case ra_delete_address cleanup
+ra_delete_address_head()
+{
+
+ atf_set "descr" "Tests for deleting auto-configured address"
+ atf_set "require.progs" "rump_server rump.rtadvd rump.ndp rump.ifconfig"
+}
+
+ra_delete_address_body()
+{
+
+ rump_server_fs_start $RUMPSRV netinet6
+ rump_server_start $RUMPCLI netinet6
+
+ setup_shmif0 ${RUMPSRV} ${IP6SRV}
+ setup_shmif0 ${RUMPCLI} ${IP6CLI}
+
+ export RUMP_SERVER=${RUMPSRV}
+ atf_check -s exit:0 -o match:'0.->.1' rump.sysctl -w net.inet6.ip6.forwarding=1
+ export LD_PRELOAD=/usr/lib/librumphijack.so
+ atf_check -s exit:0 mkdir -p /rump/var/chroot/rtadvd
+ unset LD_PRELOAD
+ unset RUMP_SERVER
+
+ create_rtadvdconfig
+
+ export RUMP_SERVER=${RUMPCLI}
+ atf_check -s exit:0 -o match:'0.->.1' rump.sysctl -w net.inet6.ip6.accept_rtadv=1
+ unset RUMP_SERVER
+
+ export RUMP_SERVER=${RUMPSRV}
+ atf_check -s exit:0 rump.rtadvd -c ${CONFIG} shmif0
+ atf_check -s exit:0 sleep 3
+ atf_check -s exit:0 -o ignore -e empty cat ${PIDFILE}
+ unset RUMP_SERVER
+
+ export RUMP_SERVER=${RUMPCLI}
+ $DEBUG && dump_entries
+ atf_check -s exit:0 -o match:'if=shmif0' rump.ndp -r
+ atf_check -s exit:0 -o match:'advertised' rump.ndp -p
+ atf_check -s exit:0 -o match:'linkmtu=1300' rump.ndp -n -i shmif0
+ atf_check -s exit:0 -o match:'(23h59m|1d0h0m)..s S R' rump.ndp -n -a
+ atf_check -s exit:0 -o match:'fc00:1:' rump.ndp -n -a
+ atf_check -s exit:0 -o match:'fc00:1:' rump.ifconfig shmif0 inet6
+
+ $DEBUG && rump.ifconfig shmif0
+ atf_check -s exit:0 rump.ifconfig shmif0 inet6 \
+ $(rump.ifconfig shmif0 |awk '/AUTOCONF/ {print $2}') delete
+ unset RUMP_SERVER
+
+ atf_check -s exit:0 kill -TERM `cat ${PIDFILE}`
+ wait_term ${PIDFILE}
+
+ rump_server_destroy_ifaces
+}
+
+ra_delete_address_cleanup()
+{
+
+ if [ -f ${PIDFILE} ]; then
+ kill -TERM `cat ${PIDFILE}`
+ wait_term ${PIDFILE}
+ fi
+
+ $DEBUG && dump
+ cleanup
+}
+
atf_init_test_cases()
{
atf_add_test_case ra_basic
atf_add_test_case ra_flush_prefix_entries
atf_add_test_case ra_flush_defrouter_entries
+ atf_add_test_case ra_delete_address
}
Home |
Main Index |
Thread Index |
Old Index