diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2016-11-08 16:14:47 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-11-09 23:26:28 -0800 |
commit | d57ca415774be9bf136d9350b9ca52bb29c0ebfb (patch) | |
tree | b7cd0d9ead048d80733f8c9e993a5bb606dd7c20 /cts | |
parent | f44bc369824ee4c14c5d0987673e27e6510843bc (diff) | |
download | chrome-ec-d57ca415774be9bf136d9350b9ca52bb29c0ebfb.tar.gz |
eCTS: Pause a few seconds before flushing tty
After a board is reset for setting up a tty port, the host should
wait for a few seconds before flushing the port as the board may
still be booting. This should prevent output from the previous boot
from creeping into a test run.
BUG=none
BRANCH=none
TEST=cts.py -m gpio, interrupt, timer
Change-Id: I1fb567a3a8ddcfff61865b6db3866c56be386c4a
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/408759
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'cts')
-rwxr-xr-x | cts/cts.py | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/cts/cts.py b/cts/cts.py index 2d2e824cbc..b42f16c44b 100755 --- a/cts/cts.py +++ b/cts/cts.py @@ -121,19 +121,6 @@ class Cts(object): self.th.get_serial() self.dut.get_serial() - def reset_boards(self): - """Resets the boards and allows them to run tests - Due to current (7/27/16) version of sync function, - both boards must be rest and halted, with the th - resuming first, in order for the test suite to run - in sync - """ - self.identify_boards() - self.th.send_open_ocd_commands(['init', 'reset halt']) - self.dut.send_open_ocd_commands(['init', 'reset halt']) - self.th.send_open_ocd_commands(['init', 'resume']) - self.dut.send_open_ocd_commands(['init', 'resume']) - @staticmethod def get_macro_args(filepath, macro): """Get list of args of a certain macro in a file when macro is used @@ -317,11 +304,25 @@ class Cts(object): self.dut.setup_tty() self.th.setup_tty() + # Boards might be still writing to tty. Wait a few seconds before flashing. + time.sleep(3) + # clear buffers self.dut.read_tty() self.th.read_tty() - self.reset_boards() + # Resets the boards and allows them to run tests + # Due to current (7/27/16) version of sync function, + # both boards must be rest and halted, with the th + # resuming first, in order for the test suite to run in sync + print 'Halting TH...' + self.th.send_open_ocd_commands(['init', 'reset halt']) + print 'Resetting DUT...' + self.dut.send_open_ocd_commands(['init', 'reset halt']) + print 'Resuming TH...' + self.th.send_open_ocd_commands(['init', 'resume']) + print 'Resuming DUT...' + self.dut.send_open_ocd_commands(['init', 'resume']) time.sleep(MAX_SUITE_TIME_SEC) |