summaryrefslogtreecommitdiff
path: root/test/py/u_boot_console_exec_attach.py
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2024-11-25 17:23:49 -0600
committerTom Rini <trini@konsulko.com>2024-11-25 17:34:08 -0600
commit48380f9b2a12e3fc6339d6af5a154bded769d911 (patch)
tree4782d21bfc7ddf81f757a38a85bf47d18f20e69d /test/py/u_boot_console_exec_attach.py
parentdc1859f8d2ac3faaa5e2e1d465ec4bd8980520a5 (diff)
parent3073246d1be682071d8b3d07d06c2484907aed60 (diff)
Merge tag 'v2025.01-rc3' into next
Prepare v2025.01-rc3
Diffstat (limited to 'test/py/u_boot_console_exec_attach.py')
-rw-r--r--test/py/u_boot_console_exec_attach.py31
1 files changed, 22 insertions, 9 deletions
diff --git a/test/py/u_boot_console_exec_attach.py b/test/py/u_boot_console_exec_attach.py
index 8dd8cc1230c..8b253b4451d 100644
--- a/test/py/u_boot_console_exec_attach.py
+++ b/test/py/u_boot_console_exec_attach.py
@@ -59,14 +59,27 @@ class ConsoleExecAttach(ConsoleBase):
args = [self.config.board_type, self.config.board_identity]
s = Spawn(['u-boot-test-console'] + args)
- 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
+ if self.config.use_running_system:
+ self.log.action('Connecting to board without reset')
+ else:
+ 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
+
+ def close(self):
+ super().close()
+
+ self.log.action('Releasing board')
+ args = [self.config.board_type, self.config.board_identity]
+ cmd = ['u-boot-test-release'] + args
+ runner = self.log.get_runner(cmd[0], sys.stdout)
+ runner.run(cmd)
+ runner.close()