[CRIU] [PATCH] zdtm.sh: dump traffic for *tcpbuf* tests

Andrey Vagin avagin at openvz.org
Thu Jul 18 16:26:29 EDT 2013


Sometimes these tests don't pass successfully and we need more
information to investigate the problem.

https://bugzilla.openvz.org/show_bug.cgi?id=2676
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 test/zdtm.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/test/zdtm.sh b/test/zdtm.sh
index c23ce20..0acd22d 100755
--- a/test/zdtm.sh
+++ b/test/zdtm.sh
@@ -169,6 +169,7 @@ EXCLUDE_PATTERN=""
 CLEANUP=0
 PAGE_SERVER=0
 PS_PORT=12345
+TCPDUMP_PID=
 
 check_mainstream()
 {
@@ -207,6 +208,9 @@ exit_callback()
 	[[ -n "$ZDTM_FAILED" && -n "$DUMP_ARCHIVE" ]] && tar -czf $DUMP_ARCHIVE dump
 	[ -n "$TMPFS_DUMP" ] &&
 		umount -l "$TMPFS_DUMP"
+
+	[ -n "$TCPDUMP_PID" ] &&
+		kill $TCPDUMP_PID
 }
 trap exit_callback EXIT
 
@@ -368,6 +372,11 @@ EOF
 		args="-n uts -n ipc -n net -n pid -n mnt --root $ZDTM_ROOT --pidfile $TPID $args"
 	fi
 
+	echo $tname | grep -q tcpbuf && {
+		tcpdump -w dump/$tname/$PID/tcpdump.data -i lo &
+		TCPDUMP_PID=$!
+	}
+
 	for i in `seq $ITERATIONS`; do
 
 		ddump=dump/$tname/$PID/$i
@@ -455,6 +464,10 @@ EOF
 		sleep 0.$sltime
 		[ $sltime -lt 9 ] && sltime=$((sltime+1))
 	done
+
+	[ -n "$TCPDUMP_PID" ] && kill $TCPDUMP_PID
+	TCPDUMP_PID=""
+	
 	cat $test.out
 	cat $test.out | grep -q PASS || return 2
 	[ "$CLEANUP" -ne 0 ] && rm -rf `dirname $ddump`
-- 
1.8.3.1



More information about the CRIU mailing list