mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-23 18:19:39 +00:00
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: 474f2dfc5d ("zdtm.py: add option --keep-going")
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
parent
03cd507053
commit
8a2cefcc04
1 changed files with 14 additions and 1 deletions
15
test/zdtm.py
15
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]
|
||||
|
|
@ -1100,7 +1113,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'])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue