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-06-05 21:36:30 +0100
commit53559bb82dc42386383e23aaf88a1bc06301d062 (patch)
tree9946fb7154534ee8383df3b90ecc71ae2b4805fc /scripts/lib/resulttool/log.py
parent212c92482c91bd513bdbab5cb2c12acdce6f81ca (diff)
downloadpoky-53559bb82dc42386383e23aaf88a1bc06301d062.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. (From OE-Core rev: 0b513274a0ae722065cf1a605090000e854e2f81) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 64a2121a875ce128959ee0a62e310d5f91f87b0d) Signed-off-by: Steve Sakoman <steve@sakoman.com> 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):
34 return 1 34 return 1
35 35
36 for _, run_name, _, r in resultutils.test_run_results(results): 36 for _, run_name, _, r in resultutils.test_run_results(results):
37 if args.dump_ptest and 'ptestresult.sections' in r: 37 if args.dump_ptest:
38 for name, ptest in r['ptestresult.sections'].items(): 38 for sectname in ['ptestresult.sections', 'ltpposixresult.sections', 'ltpresult.sections']:
39 logdata = resultutils.ptestresult_get_log(r, name) 39 if sectname in r:
40 for name, ptest in r[sectname].items():
41 logdata = resultutils.generic_get_log(sectname, r, name)
40 if logdata is not None: 42 if logdata is not None:
41 dest_dir = args.dump_ptest 43 dest_dir = args.dump_ptest
42 if args.prepend_run: 44 if args.prepend_run:
43 dest_dir = os.path.join(dest_dir, run_name) 45 dest_dir = os.path.join(dest_dir, run_name)
46 if not sectname.startswith("ptest"):
47 dest_dir = os.path.join(dest_dir, sectname.split(".")[0])
44 48
45 os.makedirs(dest_dir, exist_ok=True) 49 os.makedirs(dest_dir, exist_ok=True)
46 dest = os.path.join(dest_dir, '%s.log' % name) 50 dest = os.path.join(dest_dir, '%s.log' % name)
@@ -49,10 +53,13 @@ def log(args, logger):
49 f.write(logdata) 53 f.write(logdata)
50 54
51 if args.raw_ptest: 55 if args.raw_ptest:
52 rawlog = resultutils.ptestresult_get_rawlogs(r) 56 found = False
53 if rawlog is not None: 57 for sectname in ['ptestresult.rawlogs', 'ltpposixresult.rawlogs', 'ltpresult.rawlogs']:
54 print(rawlog) 58 rawlog = resultutils.generic_get_rawlogs(sectname, r)
55 else: 59 if rawlog is not None:
60 print(rawlog)
61 found = True
62 if not found:
56 print('Raw ptest logs not found') 63 print('Raw ptest logs not found')
57 return 1 64 return 1
58 65