diff options
author | Chase Qi <chase.qi@linaro.org> | 2017-12-05 16:18:10 +0800 |
---|---|---|
committer | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2017-12-05 13:32:28 +0000 |
commit | 85639b61d267f60beca3230b125633b3e92b7360 (patch) | |
tree | 0da15a76cf4bcbd16ac2059bb20fce902bca804c | |
parent | 0729429901be04ba1d62377b97771c10744ce351 (diff) |
android: vts: save logs in vts_run_details.txt
For each test/module, VTS creates a temporary log file like:
/tmp/vts-runner-log<some-id>/VtsKernelLtp/latest/test_run_details.txt
This patch uses monitor-runner-output.py provided by vts to monitor
real-time test progress and save logs in vts_run_details.txt.
Change-Id: Icaa06bba9e44becb6a7e2e84348293c64100113f
Signed-off-by: Chase Qi <chase.qi@linaro.org>
-rwxr-xr-x | automated/android/tradefed/tradefed-runner.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/automated/android/tradefed/tradefed-runner.py b/automated/android/tradefed/tradefed-runner.py index 3fb97a3..dd63645 100755 --- a/automated/android/tradefed/tradefed-runner.py +++ b/automated/android/tradefed/tradefed-runner.py @@ -150,6 +150,14 @@ if command is None: logger.error("Not supported path: %s" % args.TEST_PATH) sys.exit(1) +vts_monitor_enabled = False +if command == 'android-vts/tools/vts-tradefed' and \ + os.path.exists('android-vts/testcases/vts/script/monitor-runner-output.py'): + vts_monitor_enabled = True + vts_run_details = open('{}/vts_run_details.txt'.format(OUTPUT), 'w') + monitor_cmd = 'android-vts/testcases/vts/script/monitor-runner-output.py -m' + monitor_vts_output = subprocess.Popen(shlex.split(monitor_cmd), stderr=subprocess.STDOUT, stdout=vts_run_details) + child = pexpect.spawn(command, logfile=tradefed_stdout) try: child.expect(prompt, timeout=60) @@ -217,6 +225,9 @@ logger.info('Tradefed test finished') tradefed_logcat.kill() tradefed_logcat_out.close() tradefed_stdout.close() +if vts_monitor_enabled: + monitor_vts_output.kill() + vts_run_details.close() # Locate and parse test result. result_dir = '%s/results' % args.TEST_PATH |