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:31 +0100
commitf08831c5a977ec5ba0ef1338abd990901dc160a7 (patch)
treed682a126cf0f8b026124ddbebd65d2521dda873b /scripts/lib/resulttool/log.py
parent7a6739398a4a0760c6ae7aa90f91ffac89309e05 (diff)
downloadpoky-f08831c5a977ec5ba0ef1338abd990901dc160a7.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: 64a2121a875ce128959ee0a62e310d5f91f87b0d) 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