[CRIU] [PATCH 2/2] zdtm.sh: save archive with dump files

Andrey Vagin avagin at openvz.org
Thu May 23 11:06:01 EDT 2013


An archive is saved in unsuccessful case.

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 test/zdtm.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/test/zdtm.sh b/test/zdtm.sh
index 919b922..ed4c199 100755
--- a/test/zdtm.sh
+++ b/test/zdtm.sh
@@ -194,10 +194,13 @@ EOF
 
 exit_callback()
 {
+	echo $@
 	[ -n "$ZDTM_ROOT" ] && {
 		umount -l "$ZDTM_ROOT"
 		rmdir "$ZDTM_ROOT"
 	}
+
+	[[ -n "$ZDTM_FAILED" && -n "$DUMP_ARCHIVE" ]] && tar -czf $DUMP_ARCHIVE dump
 	[ -n "$TMPFS_DUMP" ] &&
 		umount -l "$TMPFS_DUMP"
 }
@@ -426,6 +429,8 @@ case_error()
 	test=${ZP}/${1#ns/}
 	local test_log=`pwd`/$test.out
 
+	ZDTM_FAILED=1
+
 	echo "Test: $test"
 	echo "====================== ERROR ======================"
 
@@ -506,6 +511,12 @@ while :; do
 		mount -t tmpfs none $TMPFS_DUMP || exit 1
 		continue;
 	fi
+	if [ "$1" = "-a" ]; then
+		shift
+		DUMP_ARCHIVE=$1
+		shift
+		continue;
+	fi
 	break;
 done
 
@@ -542,6 +553,7 @@ Options:
 	-b <commit> : Check backward compatibility
 	-x <PATTERN>: Exclude pattern
 	-t : mount tmpfs for dump files
+	-a <FILE>.tar.gz : save archive with dump files and logs
 EOF
 elif [ "${1:0:1}" = '-' ]; then
 	echo "unrecognized option $1"
-- 
1.8.2



More information about the CRIU mailing list