X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=test%2Fpy%2Fu_boot_console_exec_attach.py;h=445b58dda6121f85eb7bc3bb3fbdc6408e8a1fb2;hb=c631e150feb150cff744c12d5e54b609ba62a227;hp=19520cb3b9072eceac7cb2f47385b9b9a8441d31;hpb=e8debf394fbba594fcfc267c61f8c6bbca395b06;p=u-boot diff --git a/test/py/u_boot_console_exec_attach.py b/test/py/u_boot_console_exec_attach.py index 19520cb3b9..445b58dda6 100644 --- a/test/py/u_boot_console_exec_attach.py +++ b/test/py/u_boot_console_exec_attach.py @@ -35,11 +35,13 @@ class ConsoleExecAttach(ConsoleBase): # HW flow control would mean this could be infinite. super(ConsoleExecAttach, self).__init__(log, config, max_fifo_fill=16) - self.log.action('Flashing U-Boot') - cmd = ['u-boot-test-flash', config.board_type, config.board_identity] - runner = self.log.get_runner(cmd[0], sys.stdout) - runner.run(cmd) - runner.close() + with self.log.section('flash'): + self.log.action('Flashing U-Boot') + cmd = ['u-boot-test-flash', config.board_type, config.board_identity] + runner = self.log.get_runner(cmd[0], sys.stdout) + runner.run(cmd) + runner.close() + self.log.status_pass('OK') def get_spawn(self): """Connect to a fresh U-Boot instance. @@ -56,10 +58,14 @@ class ConsoleExecAttach(ConsoleBase): args = [self.config.board_type, self.config.board_identity] s = Spawn(['u-boot-test-console'] + args) - self.log.action('Resetting board') - cmd = ['u-boot-test-reset'] + args - runner = self.log.get_runner(cmd[0], sys.stdout) - runner.run(cmd) - runner.close() + try: + self.log.action('Resetting board') + cmd = ['u-boot-test-reset'] + args + runner = self.log.get_runner(cmd[0], sys.stdout) + runner.run(cmd) + runner.close() + except: + s.close() + raise return s