diff options
Diffstat (limited to 'scripts/lib/resulttool/log.py')
| -rw-r--r-- | scripts/lib/resulttool/log.py | 21 |
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 | ||
