[CRIU] [PATCH] zdtm: show error messages in a error case

Andrey Vagin avagin at openvz.org
Mon Oct 12 23:51:01 PDT 2015


From: Andrew Vagin <avagin at openvz.org>

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

diff --git a/test/zdtm.py b/test/zdtm.py
index 03a0f63..a8674f1 100755
--- a/test/zdtm.py
+++ b/test/zdtm.py
@@ -307,6 +307,7 @@ class criu_cli:
 		print "Run CRIU: [" + action + " " + " ".join(s_args) + "]"
 		ret = self.__criu(action, s_args)
 		if ret != 0:
+			grep_errors(os.path.join(self.__ddir(), log))
 			raise test_fail_exc("CRIU %s" % action)
 
 	def __criu_cr(self, action, opts):
@@ -520,6 +521,19 @@ def self_checkskip(tname):
 
 	return False
 
+def print_sep(title, sep = "="):
+	sep_len = (80 - len(title) - 2) / 2
+	sep = sep * sep_len
+	print "%s %s %s" % (sep, title, sep)
+
+def grep_errors(fname):
+	s = "=" * 10
+	print_sep("grep Error")
+	f = open(fname)
+	for l in f:
+		if "Error" in l:
+			print l,
+	print_sep("ERROR OVER")
 
 def run_tests(opts):
 	excl = None
-- 
2.4.3



More information about the CRIU mailing list