From f59b45fba2ce1315cb52a572171795634ffebf0f Mon Sep 17 00:00:00 2001 From: Andrew Vagin Date: Sun, 7 Aug 2016 17:22:52 +0300 Subject: [PATCH] zdtm: check lazy-pages Cc: Adrian Reber Signed-off-by: Andrew Vagin Signed-off-by: Mike Rapoport Signed-off-by: Pavel Emelyanov --- test/zdtm.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/test/zdtm.py b/test/zdtm.py index 3a546c5cd..4b064bc28 100755 --- a/test/zdtm.py +++ b/test/zdtm.py @@ -775,6 +775,7 @@ class criu: self.__iter = 0 self.__prev_dump_iter = None self.__page_server = (opts['page_server'] and True or False) + self.__lazy_pages = (opts['lazy_pages'] and True or False) self.__restore_sibling = (opts['sibling'] and True or False) self.__join_ns = (opts['join_ns'] and True or False) self.__empty_ns = (opts['empty_ns'] and True or False) @@ -961,6 +962,12 @@ class criu: r_opts.append('--external') r_opts.append('mnt[zdtm]:%s' % criu_dir) + lazy_pages_p = None + if self.__lazy_pages: + lazy_pages_p = self.__criu_act("lazy-pages", opts = [], nowait = True) + r_opts += ["--lazy-pages"] + time.sleep(1) # FIXME wait user fault fd socket + if self.__leave_stopped: r_opts += ['--leave-stopped'] @@ -982,6 +989,9 @@ class criu: pstree_check_stopped(self.__test.getpid()) pstree_signal(self.__test.getpid(), signal.SIGCONT) + if lazy_pages_p and lazy_pages_p.wait(): + raise test_fail_exc("CRIU lazy-pages") + @staticmethod def check(feature): return criu_cli.run("check", ["-v0", "--feature", feature]) == 0 @@ -1426,7 +1436,7 @@ class launcher: self.__show_progress(name) nd = ('nocr', 'norst', 'pre', 'iters', 'page_server', 'sibling', 'stop', 'empty_ns', - 'fault', 'keep_img', 'report', 'snaps', 'sat', 'script', 'rpc', + 'fault', 'keep_img', 'report', 'snaps', 'sat', 'script', 'rpc', 'lazy_pages', 'join_ns', 'dedup', 'sbs', 'freezecg', 'user', 'dry_run', 'noauto_dedup') arg = repr((name, desc, flavor, {d: self.__opts[d] for d in nd})) @@ -1706,6 +1716,8 @@ def run_tests(opts): run_flavs -= set(['ns', 'uns']) if opts['empty_ns']: run_flavs -= set(['h']) + if opts['lazy_pages']: + run_flavs -= set(['ns', 'uns']) if run_flavs: l.run_test(t, tdesc, run_flavs) @@ -1923,6 +1935,7 @@ rp.add_argument("-k", "--keep-img", help = "Whether or not to keep images after rp.add_argument("--report", help = "Generate summary report in directory") rp.add_argument("--keep-going", help = "Keep running tests in spite of failures", action = 'store_true') rp.add_argument("--ignore-taint", help = "Don't care about a non-zero kernel taint flag", action = 'store_true') +rp.add_argument("--lazy-pages", help = "restore pages on demand", action = 'store_true') lp = sp.add_parser("list", help = "List tests") lp.set_defaults(action = list_tests)