summaryrefslogtreecommitdiff
path: root/test/py/u_boot_console_base.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2024-11-12 07:13:17 -0700
committerTom Rini <trini@konsulko.com>2024-11-13 12:01:35 -0600
commit6f3583074fc05e16ca8a0244aa7bf6e634e7d6df (patch)
treeabaf86a44d2945d2c2488199c97ebcde54a1ab69 /test/py/u_boot_console_base.py
parent530c694c450e5b98c50ea5b1201df474bc952ca9 (diff)
test: Allow connecting to a running board
Sometimes we know that the board is already running the right software, so provide an option to allow running of tests directly, without first resetting the board. This saves time when re-running a test where only the Python code is changing. Note that this feature is open to errors, since the user must know that the board is in a fit state to execute tests. It is useful for repeated iteration on a particular test, where it can save quite a bit of time. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/py/u_boot_console_base.py')
-rw-r--r--test/py/u_boot_console_base.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/test/py/u_boot_console_base.py b/test/py/u_boot_console_base.py
index 965832a4989..311e649d55b 100644
--- a/test/py/u_boot_console_base.py
+++ b/test/py/u_boot_console_base.py
@@ -441,11 +441,17 @@ class ConsoleBase(object):
if not self.config.gdbserver:
self.p.timeout = TIMEOUT_MS
self.p.logfile_read = self.logstream
- if expect_reset:
- loop_num = 2
+ if self.config.use_running_system:
+ # Send an empty command to set up the 'expect' logic. This has
+ # the side effect of ensuring that there was no partial command
+ # line entered
+ self.run_command(' ')
else:
- loop_num = 1
- self.wait_for_boot_prompt(loop_num = loop_num)
+ if expect_reset:
+ loop_num = 2
+ else:
+ loop_num = 1
+ self.wait_for_boot_prompt(loop_num = loop_num)
self.at_prompt = True
self.at_prompt_logevt = self.logstream.logfile.cur_evt
except Exception as ex: