diff options
Diffstat (limited to 'cts')
-rw-r--r-- | cts/common/board.py | 14 | ||||
-rwxr-xr-x | cts/cts.py | 12 |
2 files changed, 15 insertions, 11 deletions
diff --git a/cts/common/board.py b/cts/common/board.py index c301fac302..f2dce110d7 100644 --- a/cts/common/board.py +++ b/cts/common/board.py @@ -96,7 +96,7 @@ class Board(object): """Subclass should implement this.""" pass - def send_open_ocd_commands(self, commands): + def send_openocd_commands(self, commands): """Send a command to the board via openocd. Args: @@ -159,7 +159,7 @@ class Board(object): 'init', 'reset init', 'flash write_image erase %s %s' % (image_path, self.flash_offset)] - return self.send_open_ocd_commands(cmd) + return self.send_openocd_commands(cmd) def to_string(self): s = ('Type: Board\n' @@ -170,9 +170,13 @@ class Board(object): 'tty: ' + str(self.tty) + '\n') return s - def reset(self): + def reset_halt(self): """Reset then halt board.""" - return self.send_open_ocd_commands(['init', 'reset halt']) + return self.send_openocd_commands(['init', 'reset halt']) + + def resume(self): + """Resume halting board.""" + return self.send_openocd_commands(['init', 'resume']) def setup_tty(self): """Call this before calling read_tty for the first time. @@ -181,7 +185,7 @@ class Board(object): this function after serial numbers are setup """ self.get_serial() - self.reset() + self.reset_halt() self.identify_tty_port() tty = None diff --git a/cts/cts.py b/cts/cts.py index 7781a2d8fc..0ef862d996 100755 --- a/cts/cts.py +++ b/cts/cts.py @@ -320,16 +320,16 @@ class Cts(object): # 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...' - if not self.th.send_open_ocd_commands(['init', 'reset halt']): + if not self.th.reset_halt(): raise RuntimeError('Failed to halt TH') print 'Halting DUT...' - if not self.dut.send_open_ocd_commands(['init', 'reset halt']): + if not self.dut.reset_halt(): raise RuntimeError('Failed to halt DUT') print 'Resuming TH...' - if not self.th.send_open_ocd_commands(['init', 'resume']): + if not self.th.resume(): raise RuntimeError('Failed to resume TH') print 'Resuming DUT...' - if not self.dut.send_open_ocd_commands(['init', 'resume']): + if not self.dut.resume(): raise RuntimeError('Failed to resume DUT') time.sleep(MAX_SUITE_TIME_SEC) @@ -342,10 +342,10 @@ class Cts(object): self.th.close_tty() print 'Halting TH...' - if not self.th.send_open_ocd_commands(['init', 'reset halt']): + if not self.th.reset_halt(): raise RuntimeError('Failed to halt TH') print 'Halting DUT...' - if not self.dut.send_open_ocd_commands(['init', 'reset halt']): + if not self.dut.reset_halt(): raise RuntimeError('Failed to halt DUT') if not dut_output or not th_output: |