Module Name:    src
Committed By:   ozaki-r
Date:           Fri Apr  6 09:22:38 UTC 2018

Modified Files:
        src/tests/net: net_common.sh

Log Message:
Show outputs of commands if $DEBUG


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/tests/net/net_common.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/net/net_common.sh
diff -u src/tests/net/net_common.sh:1.26 src/tests/net/net_common.sh:1.27
--- src/tests/net/net_common.sh:1.26	Thu Feb  1 05:22:01 2018
+++ src/tests/net/net_common.sh	Fri Apr  6 09:22:38 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: net_common.sh,v 1.26 2018/02/01 05:22:01 ozaki-r Exp $
+#	$NetBSD: net_common.sh,v 1.27 2018/04/06 09:22:38 ozaki-r Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -319,19 +319,23 @@ rump_server_add_iface()
 rump_server_destroy_ifaces()
 {
 	local backup=$RUMP_SERVER
+	local outout=ignore
 
 	$DEBUG && cat $_rump_server_ifaces
 
 	# Try to dump states before destroying interfaces
 	for sock in $(cat $_rump_server_socks); do
 		export RUMP_SERVER=$sock
-		atf_check -s exit:0 -o ignore rump.ifconfig
-		atf_check -s exit:0 -o ignore rump.netstat -nr
+		if $DEBUG; then
+			output=save:/dev/stdout
+		fi
+		atf_check -s exit:0 -o $output rump.ifconfig
+		atf_check -s exit:0 -o $output rump.netstat -nr
 		# XXX still need hijacking
-		atf_check -s exit:0 -o ignore $HIJACKING rump.netstat -nai
-		atf_check -s exit:0 -o ignore rump.arp -na
-		atf_check -s exit:0 -o ignore rump.ndp -na
-		atf_check -s exit:0 -o ignore $HIJACKING ifmcstat
+		atf_check -s exit:0 -o $output $HIJACKING rump.netstat -nai
+		atf_check -s exit:0 -o $output rump.arp -na
+		atf_check -s exit:0 -o $output rump.ndp -na
+		atf_check -s exit:0 -o $output $HIJACKING ifmcstat
 	done
 
 	# XXX using pipe doesn't work. See PR bin/51667

Reply via email to