Commit 8a2cefcc authored by Andrew Vagin's avatar Andrew Vagin Committed by Pavel Emelyanov

zdtm: save output of all tests in the /output file of a report

Jenkins sends this files as a message body if something failed.

Cc: Sergey Bronnikov <sergeyb@openvz.org>
Fixes: 474f2dfc ("zdtm.py: add option --keep-going")
Signed-off-by: 's avatarAndrew Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 03cd5070
...@@ -82,6 +82,19 @@ def add_to_report(path, tgt_name): ...@@ -82,6 +82,19 @@ def add_to_report(path, tgt_name):
os.mkdir(os.path.dirname(tgt_path)) os.mkdir(os.path.dirname(tgt_path))
shutil.copy2(path, 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 we run on
arch = os.uname()[4] arch = os.uname()[4]
...@@ -1100,7 +1113,7 @@ class launcher: ...@@ -1100,7 +1113,7 @@ class launcher:
print >> self.__file_report, testline print >> self.__file_report, testline
print >> self.__file_report, yaml.dump(details, explicit_start=True, explicit_end=True, default_style='|') print >> self.__file_report, yaml.dump(details, explicit_start=True, explicit_end=True, default_style='|')
if sub['log']: if sub['log']:
add_to_report(sub['log'], sub['name'].replace('/', '_') + "_" + failed_flavor + "/output") add_to_output(sub['log'])
else: else:
if self.__file_report: if self.__file_report:
testline = "ok %d - %s" % (self.__runtest, sub['name']) testline = "ok %d - %s" % (self.__runtest, sub['name'])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment