Explorar o código

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

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>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
(cherry picked from commit b1d554b9a769657b3a4c3263fc71c8028b33475d)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Adam Duskett hai 1 ano
pai
achega
682e55ce9a
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      support/testing/infra/emulator.py

+ 2 - 2
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
     # Wait for the login prompt to appear, and then login as root with
     # the provided password, or no password if not specified.
     # 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
         # The login prompt can take some time to appear when running multiple
         # instances in parallel, so set the timeout to a large value
         # instances in parallel, so set the timeout to a large value
         index = self.qemu.expect(["buildroot login:", pexpect.TIMEOUT],
         index = self.qemu.expect(["buildroot login:", pexpect.TIMEOUT],
-                                 timeout=60 * self.timeout_multiplier)
+                                 timeout=timeout * self.timeout_multiplier)
         if index != 0:
         if index != 0:
             self.logfile.write("==> System does not boot")
             self.logfile.write("==> System does not boot")
             raise SystemError("System does not boot")
             raise SystemError("System does not boot")