[oe-commits] [openembedded-core] 01/30: resulttool: Add option to dump all ptest logs

git at git.openembedded.org git at git.openembedded.org
Wed May 8 11:23:09 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 1527c3e2bdc3ddeb557dd7e89cd12d6b7fc629a5
Author: Joshua Watt <jpewhacker at gmail.com>
AuthorDate: Fri May 3 22:17:52 2019 -0500

    resulttool: Add option to dump all ptest logs
    
    Adds an option to dump all the ptest logs to individual files to a
    specified directory.
    
    [YOCTO #13331]
    
    Signed-off-by: Joshua Watt <JPEWhacker at gmail.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 scripts/lib/resulttool/log.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/scripts/lib/resulttool/log.py b/scripts/lib/resulttool/log.py
index 5584f2d..1883040 100644
--- a/scripts/lib/resulttool/log.py
+++ b/scripts/lib/resulttool/log.py
@@ -30,6 +30,15 @@ def log(args, logger):
                 continue
             r = results[path][res]['result']
 
+            if args.dump_ptest:
+                if 'ptestresult.sections' in r:
+                    for name, ptest in r['ptestresult.sections'].items():
+                        if 'log' in ptest:
+                            dest = os.path.join(args.dump_ptest, '%s.log' % name)
+                            print(dest)
+                            with open(dest, 'w') as f:
+                                f.write(ptest['log'])
+
             if args.raw:
                 if 'ptestresult.rawlogs' in r:
                     print(r['ptestresult.rawlogs']['log'])
@@ -51,6 +60,8 @@ def register_commands(subparsers):
             help='the results file/directory/URL to import')
     parser.add_argument('--ptest', action='append', default=[],
             help='show logs for a ptest')
+    parser.add_argument('--dump-ptest', metavar='DIR',
+            help='Dump all ptest log files to the specified directory.')
     parser.add_argument('--raw', action='store_true',
             help='show raw logs')
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list