1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-01 00:59:48 +00:00

oeqa/runtime/login: Fix dbus-wait timeout and loop conditional

The dbus-wait command returns a timeout after 60s but reports "success", detect this.
Unfortunately it does effectively break the test as the signal is nearly never being
correctly detected since it was already sent.

For that reason comment out the code instead too.

Also fix the loop conditional as the logic was incorrect and it was looping
indefinitely when an image match didn't occur.

(From OE-Core rev: 89c930e9e4b38b116edcba59e88621a39f8bda67)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2024-03-07 09:19:34 +00:00
parent f6235fef62
commit 0bd3234676
+5 -4
View File
@@ -66,15 +66,16 @@ class LoginTest(OERuntimeTestCase):
# Which is ugly and I hate it but it 'works' for various definitions of # Which is ugly and I hate it but it 'works' for various definitions of
# 'works'. # 'works'.
### ###
status, output = self.target.run('dbus-wait org.matchbox_project.desktop Loaded') # RP: if the signal is sent before we run this, it will never be seen and we'd timeout
if status != 0: #status, output = self.target.run('dbus-wait org.matchbox_project.desktop Loaded')
self.fail('dbus-wait failed. This could mean that the image never loaded the matchbox desktop.') #if status != 0 or "Timeout" in output:
# self.fail('dbus-wait failed (%s, %s). This could mean that the image never loaded the matchbox desktop.' % (status, output))
# Start taking screenshots every 2 seconds until diff=0 or timeout is 60 seconds # Start taking screenshots every 2 seconds until diff=0 or timeout is 60 seconds
timeout = time.time() + 60 timeout = time.time() + 60
diff = True diff = True
with tempfile.NamedTemporaryFile(prefix="oeqa-screenshot-login", suffix=".png") as t: with tempfile.NamedTemporaryFile(prefix="oeqa-screenshot-login", suffix=".png") as t:
while diff != 0 or time.time() > timeout: while diff != 0 and time.time() < timeout:
time.sleep(2) time.sleep(2)
ret = self.target.runner.run_monitor("screendump", args={"filename": t.name, "format":"png"}) ret = self.target.runner.run_monitor("screendump", args={"filename": t.name, "format":"png"})