[CRIU] [PATCH 3/3] zdtm.sh: add the option to clean up in successful cases

Andrey Vagin avagin at openvz.org
Fri May 17 05:59:14 EDT 2013


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

diff --git a/test/zdtm.sh b/test/zdtm.sh
index 7817df5..ad338ac 100755
--- a/test/zdtm.sh
+++ b/test/zdtm.sh
@@ -162,6 +162,7 @@ PIDNS=""
 
 ITERATIONS=1
 EXCLUDE_PATTERN=""
+CLEANUP=0
 PAGE_SERVER=0
 PS_PORT=12345
 
@@ -413,6 +414,8 @@ EOF
 	done
 	cat $test.out
 	cat $test.out | grep -q PASS || return 2
+	[ "$CLEANUP" -ne 0 ] && rm -rf `dirname $ddump`
+	return 0
 }
 
 case_error()
@@ -482,6 +485,11 @@ while :; do
 		PAGE_SERVER=1
 		continue;
 	fi
+	if [ "$1" = "-C" ]; then
+		shift
+		CLEANUP=1
+		continue;
+	fi
 	if [ "$1" = "-x" ]; then
 		shift
 		EXCLUDE_PATTERN=$1
@@ -520,6 +528,7 @@ Options:
 	-d : Dump a test process and check that this process can continue working.
 	-i : Number of ITERATIONS of dump/restore
 	-p : Test page server
+	-C : Delete dump files if a test completed successfully
 	-b <commit> : Check backward compatibility
 	-x <PATTERN>: Exclude pattern
 EOF
-- 
1.8.2



More information about the CRIU mailing list