[CRIU] [PATCH 20/21] zdtm.py: pass a test PID into zdtm hooks

Andrei Vagin avagin at openvz.org
Thu Dec 1 00:32:38 PST 2016


From: Andrei Vagin <avagin at virtuozzo.com>

Signed-off-by: Andrei Vagin <avagin at virtuozzo.com>
---
 test/zdtm.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/test/zdtm.py b/test/zdtm.py
index a17cce4..629a4fb 100755
--- a/test/zdtm.py
+++ b/test/zdtm.py
@@ -1022,14 +1022,18 @@ def cr(cr_api, test, opts):
 
 		sbs('pre-dump')
 
+		os.environ["ZDTM_TEST_PID"] = str(test.getpid())
 		if opts['norst']:
+			try_run_hook(test, ["--pre-dump"])
 			cr_api.dump("dump", opts = ["--leave-running"])
 		else:
+			try_run_hook(test, ["--pre-dump"])
 			cr_api.dump("dump")
 			test.gone()
 			sbs('pre-restore')
 			try_run_hook(test, ["--pre-restore"])
 			cr_api.restore()
+			os.environ["ZDTM_TEST_PID"] = str(test.getpid())
 			try_run_hook(test, ["--post-restore"])
 			sbs('post-restore')
 
-- 
2.7.4



More information about the CRIU mailing list