Add more debugging code

This commit is contained in:
ozaki-r 2016-03-13 05:46:20 +00:00
parent 2d7c1584f4
commit c3509e5280

View File

@ -1,4 +1,4 @@
# $NetBSD: t_ipv6address.sh,v 1.4 2016/03/12 06:15:31 ozaki-r Exp $
# $NetBSD: t_ipv6address.sh,v 1.5 2016/03/13 05:46:20 ozaki-r Exp $
#
# Copyright (c) 2015 Internet Initiative Japan Inc.
# All rights reserved.
@ -164,6 +164,8 @@ cleanup_bus()
{
local tmp_rump_server=$RUMP_SERVER
$DEBUG && dump_bus
export RUMP_SERVER=${SOCKSRC}
atf_check -s exit:0 rump.ifconfig shmif0 down
atf_check -s exit:0 rump.ifconfig shmif0 -linkstr
@ -185,8 +187,6 @@ cleanup_bus()
atf_check -s exit:0 rump.ifconfig shmif1 -linkstr
unset RUMP_SERVER
$DEBUG && dump_bus
atf_check -s exit:0 rm ${BUSSRC}
atf_check -s exit:0 rm ${BUSDST}
atf_check -s exit:0 rm ${BUS1}
@ -225,6 +225,21 @@ dump_bus()
shmif_dumpbus -p - ${BUS2} 2>/dev/null| tcpdump -n -e -r -
}
dump()
{
export RUMP_SERVER=${SOCKSRC}
rump.ndp -n -a
rump.netstat -nr -f inet6
export RUMP_SERVER=${SOCKDST}
rump.ndp -n -a
rump.netstat -nr -f inet6
export RUMP_SERVER=${SOCKFWD}
rump.ndp -n -a
rump.netstat -nr -f inet6
unset RUMP_SERVER
}
linklocal_head()
{
atf_set "descr" "Test for bassically function of the IPv6 linklocal address"
@ -280,6 +295,8 @@ linklocal_body()
atf_check -s exit:0 -o ignore rump.ifconfig -w 10
$DEBUG && rump.ifconfig shmif0
$DEBUG && dump
atf_check -s exit:0 -o match:"0.0% packet loss" \
rump.ping6 -c 1 -X $TIMEOUT -n -S ${src_if0_lladdr}%shmif0 ${IP6FWD0}
unset RUMP_SERVER
@ -322,6 +339,7 @@ linklocal_body()
linklocal_cleanup()
{
$DEBUG && dump
$DEBUG && dump_bus
cleanup_rump_servers
}