From 6f3583074fc05e16ca8a0244aa7bf6e634e7d6df Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 12 Nov 2024 07:13:17 -0700 Subject: 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 --- test/py/u_boot_console_base.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'test/py/u_boot_console_base.py') 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: -- cgit v1.2.3