summaryrefslogtreecommitdiffstats
path: root/scripts/lib/resulttool/log.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-05-26 21:56:18 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-05-27 10:22:28 +0100
commit64a2121a875ce128959ee0a62e310d5f91f87b0d (patch)
tree66a762cea97c456f26ada88887e4abb45991cf36 /scripts/lib/resulttool/log.py
parent66e96bf70753933714ff8edcc13a1f35a052656f (diff)
downloadopenembedded-core-contrib-64a2121a875ce128959ee0a62e310d5f91f87b0d.tar.gz
resulttool/log: Add ability to dump ltp logs as well as ptest
Currently only ptest logs are accessible with the log command, this adds support so the ltp logs can be extracted too. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/resulttool/log.py')
-rw-r--r--scripts/lib/resulttool/log.py21
1 files changed, 14 insertions, 7 deletions
diff --git a/scripts/lib/resulttool/log.py b/scripts/lib/resulttool/log.py
index f1bfd99500..eb3927ec82 100644
--- a/scripts/lib/resulttool/log.py
+++ b/scripts/lib/resulttool/log.py
@@ -34,13 +34,17 @@ def log(args, logger):
return 1
for _, run_name, _, r in resultutils.test_run_results(results):
- if args.dump_ptest and 'ptestresult.sections' in r:
- for name, ptest in r['ptestresult.sections'].items():
- logdata = resultutils.ptestresult_get_log(r, name)
+ if args.dump_ptest:
+ for sectname in ['ptestresult.sections', 'ltpposixresult.sections', 'ltpresult.sections']:
+ if sectname in r:
+ for name, ptest in r[sectname].items():
+ logdata = resultutils.generic_get_log(sectname, r, name)
if logdata is not None:
dest_dir = args.dump_ptest
if args.prepend_run:
dest_dir = os.path.join(dest_dir, run_name)
+ if not sectname.startswith("ptest"):
+ dest_dir = os.path.join(dest_dir, sectname.split(".")[0])
os.makedirs(dest_dir, exist_ok=True)
dest = os.path.join(dest_dir, '%s.log' % name)
@@ -49,10 +53,13 @@ def log(args, logger):
f.write(logdata)
if args.raw_ptest:
- rawlog = resultutils.ptestresult_get_rawlogs(r)
- if rawlog is not None:
- print(rawlog)
- else:
+ found = False
+ for sectname in ['ptestresult.rawlogs', 'ltpposixresult.rawlogs', 'ltpresult.rawlogs']:
+ rawlog = resultutils.generic_get_rawlogs(sectname, r)
+ if rawlog is not None:
+ print(rawlog)
+ found = True
+ if not found:
print('Raw ptest logs not found')
return 1