test/py: add timestamps to log

It can be useful to record how long tests take; this can help debug slow
running test systems or track changes in performance over time. Enhance
the test system to record timestamps while running test:
- Whenever a new log file section is started.
- After U-Boot is started and communication has been established.
- After each host or U-Boot command is executed.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
This commit is contained in:
Stephen Warren 2017-10-27 11:04:08 -06:00 committed by Tom Rini
parent 1543bf794f
commit 9679d339ad
3 changed files with 44 additions and 0 deletions

View file

@ -215,6 +215,8 @@ class ConsoleBase(object):
self.log.error(str(ex))
self.cleanup_spawn()
raise
finally:
self.log.timestamp()
def run_command_list(self, cmds):
"""Run a list of commands.
@ -370,6 +372,7 @@ class ConsoleBase(object):
self.cleanup_spawn()
raise
finally:
self.log.timestamp()
self.log.end_section('Starting U-Boot')
def cleanup_spawn(self):