diff mbox series

[1/5] support/testing/infra/emulator.py: add a timeout argument for the login method

Message ID 20231105215221.1602465-1-adam.duskett@amarulasolutions.com
State Accepted
Headers show
Series [1/5] support/testing/infra/emulator.py: add a timeout argument for the login method | expand

Commit Message

Adam Duskett Nov. 5, 2023, 9:52 p.m. UTC
to override the current value of 60 seconds

As per a suggestion by Thomas, add a timeout argument to override the current
value of 60 seconds for the emulator.login method.

Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
---
 support/testing/infra/emulator.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Thomas Petazzoni Nov. 6, 2023, 7:44 p.m. UTC | #1
On Sun,  5 Nov 2023 14:52:17 -0700
Adam Duskett <adam.duskett@amarulasolutions.com> wrote:

> to override the current value of 60 seconds
> 
> As per a suggestion by Thomas, add a timeout argument to override the current
> value of 60 seconds for the emulator.login method.
> 
> Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
> ---
>  support/testing/infra/emulator.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Series applied. I just did a minor change on PATCH 2/5 and 3/5, I will
comment on PATCH 2/5 as the minor change is the same on both patches. Thanks!

Thomas
Peter Korsgaard Nov. 10, 2023, 11:51 a.m. UTC | #2
>>>>> "Adam" == Adam Duskett <adam.duskett@amarulasolutions.com> writes:

 > to override the current value of 60 seconds
 > As per a suggestion by Thomas, add a timeout argument to override the current
 > value of 60 seconds for the emulator.login method.

 > Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>

Committed to 2023.02.x and 2023.08.x, thanks.
diff mbox series

Patch

diff --git a/support/testing/infra/emulator.py b/support/testing/infra/emulator.py
index 02cf486128..09f81eca89 100644
--- a/support/testing/infra/emulator.py
+++ b/support/testing/infra/emulator.py
@@ -84,11 +84,11 @@  class Emulator(object):
 
     # Wait for the login prompt to appear, and then login as root with
     # the provided password, or no password if not specified.
-    def login(self, password=None):
+    def login(self, password=None, timeout=60):
         # The login prompt can take some time to appear when running multiple
         # instances in parallel, so set the timeout to a large value
         index = self.qemu.expect(["buildroot login:", pexpect.TIMEOUT],
-                                 timeout=60 * self.timeout_multiplier)
+                                 timeout=timeout * self.timeout_multiplier)
         if index != 0:
             self.logfile.write("==> System does not boot")
             raise SystemError("System does not boot")