From e7233c9c93ae0f59d00063eaf4d7e4f9bd01d63d Mon Sep 17 00:00:00 2001 From: Masami Hiramatsu Date: Wed, 16 Feb 2022 15:16:02 +0900 Subject: 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 Reviewed-by: Heinrich Schuchardt --- test/py/u_boot_console_sandbox.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'test/py/u_boot_console_sandbox.py') 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 = [] -- cgit v1.2.3