Source-Changes-HG archive

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

[src/trunk]: src/tests/net Enable debug logging of kernels such as ARP and ND...



details:   https://anonhg.NetBSD.org/src/rev/64676ffa3072
branches:  trunk
changeset: 353714:64676ffa3072
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Fri May 19 02:56:58 2017 +0000

description:
Enable debug logging of kernels such as ARP and ND if $DEUBG=true

diffstat:

 tests/net/net_common.sh |  17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diffs (41 lines):

diff -r 92ee7c3625bf -r 64676ffa3072 tests/net/net_common.sh
--- a/tests/net/net_common.sh   Fri May 19 02:20:24 2017 +0000
+++ b/tests/net/net_common.sh   Fri May 19 02:56:58 2017 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: net_common.sh,v 1.16 2017/05/17 06:30:15 ozaki-r Exp $
+#      $NetBSD: net_common.sh,v 1.17 2017/05/19 02:56:58 ozaki-r Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -185,16 +185,31 @@
 _rump_server_ifaces=./.__ifaces
 _rump_server_buses=./.__buses
 
+DEBUG_SYSCTL_ENTRIES="net.inet.arp.debug net.inet6.icmp6.nd6_debug \
+    net.inet.ipsec.debug"
+
 _rump_server_start_common()
 {
        local sock=$1
        local libs=
+       local backup=$RUMP_SERVER
 
        shift 1
        libs="$*"
 
        atf_check -s exit:0 rump_server $libs $sock
 
+       if $DEBUG; then
+               # Enable debugging features in the kernel
+               export RUMP_SERVER=$sock
+               for ent in $DEBUG_SYSCTL_ENTRIES; do
+                       if rump.sysctl -q $ent; then
+                               atf_check -s exit:0 rump.sysctl -q -w $ent=1
+                       fi
+               done
+               export RUMP_SERVER=$backup
+       fi
+
        echo $sock >> $_rump_server_socks
        $DEBUG && cat $_rump_server_socks
 }



Home | Main Index | Thread Index | Old Index