diff options
-rw-r--r-- | cts/common/board.py | 7 | ||||
-rwxr-xr-x | cts/cts.py | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/cts/common/board.py b/cts/common/board.py index 090b3eb931..e56ec47b2d 100644 --- a/cts/common/board.py +++ b/cts/common/board.py @@ -81,8 +81,7 @@ class Board(object): List of serials """ usb_args = ['lsusb', '-v', '-d', '0x0483:0x374b'] - usb_process = sp.Popen(usb_args, stdout=sp.PIPE, shell=False) - st_link_info = usb_process.communicate()[0] + st_link_info = sp.check_output(usb_args) st_serials = [] for line in st_link_info.split('\n'): if 'iSerial' not in line: @@ -254,6 +253,10 @@ class Board(object): fcntl.fcntl(fd, fcntl.F_SETFL, flag | os.O_NONBLOCK) return fd + def close_tty(self): + """Close tty""" + os.close(self.tty) + class TestHarness(Board): """Subclass of Board representing a Test Harness. diff --git a/cts/cts.py b/cts/cts.py index ed0889698d..781abe4f07 100755 --- a/cts/cts.py +++ b/cts/cts.py @@ -335,8 +335,10 @@ class Cts(object): print 'Reading DUT tty...' dut_output, _ = self.dut.read_tty() + self.dut.close_tty() print 'Reading TH tty...' th_output, _ = self.th.read_tty() + self.th.close_tty() print 'Halting TH...' if not self.th.send_open_ocd_commands(['init', 'reset halt']): |