[CRIU] [PATCH] zdtm: check "criu dedup"

Andrei Vagin avagin at openvz.org
Thu Sep 1 14:12:39 PDT 2016


From: Andrew Vagin <avagin at virtuozzo.com>

Add a new option to zdtm.py to run "criu dedup" after "criu dump"
or "criu pre-dump".

Signed-off-by: Andrei Vagin <avagin at virtuozzo.com>
---
 scripts/travis/travis-tests | 2 ++
 test/jenkins/criu-dedup.sh  | 2 ++
 test/zdtm.py                | 9 +++++++--
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/scripts/travis/travis-tests b/scripts/travis/travis-tests
index f41260e..8adddce 100755
--- a/scripts/travis/travis-tests
+++ b/scripts/travis/travis-tests
@@ -45,7 +45,9 @@ make -C test/others/exec/ run
 ./test/zdtm.py run -t zdtm/static/env00 --sibling
 
 ./test/zdtm.py run -t zdtm/transition/maps007 --pre 2 --dedup
+./test/zdtm.py run -t zdtm/transition/maps007 --pre 2 --noauto-dedup
 ./test/zdtm.py run -t zdtm/transition/maps007 --pre 2 --page-server
+./test/zdtm.py run -t zdtm/transition/maps007 --pre 2 --page-server --dedup
 
 ./test/zdtm.py run -t zdtm/static/socket-tcp-local --norst
 
diff --git a/test/jenkins/criu-dedup.sh b/test/jenkins/criu-dedup.sh
index a6dc7dc..e75ef5f 100755
--- a/test/jenkins/criu-dedup.sh
+++ b/test/jenkins/criu-dedup.sh
@@ -10,3 +10,5 @@ prep
 ./test/zdtm.py run -t zdtm/transition/maps007 --keep-going --report report -f h --pre 8:.1 --dedup || fail
 ./test/zdtm.py run -t zdtm/static/mem-touch   --keep-going --report report -f h --pre 8:.1 --dedup || fail
 ./test/zdtm.py run -t zdtm/transition/maps008 --keep-going --report report -f h --pre 8:.1 --dedup || fail
+./test/zdtm.py run -t zdtm/transition/maps007 --keep-going --report report -f h --pre 8:.1 --noauto-dedup || fail
+./test/zdtm.py run -t zdtm/static/mem-touch   --keep-going --report report -f h --pre 8:.1 --noauto-dedup || fail
diff --git a/test/zdtm.py b/test/zdtm.py
index e138e57..8b692e2 100755
--- a/test/zdtm.py
+++ b/test/zdtm.py
@@ -763,6 +763,7 @@ class criu:
 		self.__script = opts['script']
 		self.__sat = (opts['sat'] and True or False)
 		self.__dedup = (opts['dedup'] and True or False)
+		self.__mdedup = (opts['noauto_dedup'] and True or False)
 		self.__user = (opts['user'] and True or False)
 		self.__leave_stopped = (opts['stop'] and True or False)
 		self.__criu = (opts['rpc'] and criu_rpc or criu_cli)
@@ -888,6 +889,8 @@ class criu:
 			a_opts += ['--leave-stopped']
 
 		self.__criu_act(action, opts = a_opts + opts)
+		if self.__mdedup and self.__iter > 1:
+			self.__criu_act("dedup", opts = [])
 
 		if self.__leave_stopped:
 			pstree_check_stopped(self.__test.getpid())
@@ -1354,8 +1357,9 @@ class launcher:
 		self.__show_progress()
 
 		nd = ('nocr', 'norst', 'pre', 'iters', 'page_server', 'sibling', 'unshare',
-				'fault', 'keep_img', 'report', 'snaps', 'sat', 'script', 'stop', 'rpc',
-				'join_ns', 'dedup', 'sbs', 'freezecg', 'user', 'dry_run', 'lazy_pages')
+				'fault', 'keep_img', 'report', 'snaps', 'sat', 'script', 'stop',
+				'join_ns', 'dedup', 'sbs', 'freezecg', 'user', 'dry_run', 'rpc',
+				'lazy_pages', 'noauto_dedup')
 		arg = repr((name, desc, flavor, {d: self.__opts[d] for d in nd}))
 
 		if self.__use_log:
@@ -1795,6 +1799,7 @@ rp.add_argument("--join-ns", help = "Restore tests and join existing namespace",
 rp.add_argument("--pre", help = "Do some pre-dumps before dump (n[:pause])")
 rp.add_argument("--snaps", help = "Instead of pre-dumps do full dumps", action = 'store_true')
 rp.add_argument("--dedup", help = "Auto-deduplicate images on iterations", action = 'store_true')
+rp.add_argument("--noauto-dedup", help = "Manual deduplicate images on iterations", action = 'store_true')
 rp.add_argument("--nocr", help = "Do not CR anything, just check test works", action = 'store_true')
 rp.add_argument("--norst", help = "Don't restore tasks, leave them running after dump", action = 'store_true')
 rp.add_argument("--stop", help = "Check that --leave-stopped option stops ps tree.", action = 'store_true')
-- 
2.7.4



More information about the CRIU mailing list