[CRIU] [PATCH] zdtm: save output of all tests in the /output file of a report
Andrey Vagin
avagin at openvz.org
Tue May 24 22:38:26 PDT 2016
From: Andrew Vagin <avagin at virtuozzo.com>
Jenkins sends this files as a message body if something failed.
Cc: Sergey Bronnikov <sergeyb at openvz.org>
Fixes: 474f2dfc5dd4 ("zdtm.py: add option --keep-going")
Signed-off-by: Andrew Vagin <avagin at virtuozzo.com>
---
test/zdtm.py | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/test/zdtm.py b/test/zdtm.py
index 353ec26..0b6fdd0 100755
--- a/test/zdtm.py
+++ b/test/zdtm.py
@@ -82,6 +82,19 @@ def add_to_report(path, tgt_name):
os.mkdir(os.path.dirname(tgt_path))
shutil.copy2(path, tgt_path)
+def add_to_output(path):
+ global report_dir
+ if not report_dir:
+ return
+
+ fdi = open(path, "r")
+ fdo = open(os.path.join(report_dir, "output"), "a")
+ while True:
+ buf = fdi.read(1<<20)
+ if not buf:
+ break
+ fdo.write(buf)
+
# Arch we run on
arch = os.uname()[4]
@@ -1135,7 +1148,7 @@ class launcher:
print >> self.__file_report, testline
print >> self.__file_report, yaml.dump(details, explicit_start=True, explicit_end=True, default_style='|')
if sub['log']:
- add_to_report(sub['log'], sub['name'].replace('/', '_') + "_" + failed_flavor + "/output")
+ add_to_output(sub['log'])
else:
if self.__file_report:
testline = "ok %d - %s" % (self.__runtest, sub['name'])
--
2.7.4
More information about the CRIU
mailing list