aboutsummaryrefslogtreecommitdiff
path: root/test/py/u_boot_console_sandbox.py
diff options
context:
space:
mode:
authorMasami Hiramatsu <masami.hiramatsu@linaro.org>2022-02-16 15:16:02 +0900
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2022-02-26 07:37:01 +0100
commite7233c9c93ae0f59d00063eaf4d7e4f9bd01d63d (patch)
tree83707f2f2ea88754c9ed5eabd0be57ab019a34e1 /test/py/u_boot_console_sandbox.py
parent06396e2e663809ae6b5da013d5ad165ba16445a6 (diff)
test/py: Handle expected reboot while booting sandbox
Add expected_reset optional argument to ConsoleBase::ensure_spawned(), ConsoleBase::restart_uboot() and ConsoleSandbox::restart_uboot_with_flags() so that it can handle a reset while the 1st boot process after main boot logo before prompt correctly. Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'test/py/u_boot_console_sandbox.py')
-rw-r--r--test/py/u_boot_console_sandbox.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/py/u_boot_console_sandbox.py b/test/py/u_boot_console_sandbox.py
index 7e1eb0e0b4..ce4ca7e55e 100644
--- a/test/py/u_boot_console_sandbox.py
+++ b/test/py/u_boot_console_sandbox.py
@@ -57,11 +57,14 @@ class ConsoleSandbox(ConsoleBase):
cmd += self.sandbox_flags
return Spawn(cmd, cwd=self.config.source_dir)
- def restart_uboot_with_flags(self, flags):
+ def restart_uboot_with_flags(self, flags, expect_reset=False):
"""Run U-Boot with the given command-line flags
Args:
flags: List of flags to pass, each a string
+ expect_reset: Boolean indication whether this boot is expected
+ to be reset while the 1st boot process after main boot before
+ prompt. False by default.
Returns:
A u_boot_spawn.Spawn object that is attached to U-Boot.
@@ -69,7 +72,7 @@ class ConsoleSandbox(ConsoleBase):
try:
self.sandbox_flags = flags
- return self.restart_uboot()
+ return self.restart_uboot(expect_reset)
finally:
self.sandbox_flags = []