diff --git a/tests/fprintd.py b/tests/fprintd.py index 1f586e8..d40ba77 100644 --- a/tests/fprintd.py +++ b/tests/fprintd.py @@ -558,8 +558,14 @@ class FPrintdVirtualDeviceBaseTest(FPrintdTest): super().tearDown() - def wait_for_result(self, expected=None): + def wait_for_result(self, expected=None, max_wait=-1): self._abort = False + + if max_wait > 0: + def abort_timeout(): + self._abort = True + GLib.timeout_add(max_wait, abort_timeout) + while not self._abort: ctx.iteration(True) @@ -2078,6 +2084,19 @@ class FPrintdVirtualDeviceVerificationTests(FPrintdVirtualDeviceBaseTest): self.assertIn(GLib.Variant('()', ()), self.get_all_async_replies()) + def test_verify_error_ignored_after_report(self): + with Connection(self.sockaddr) as con: + self.send_finger_automatic(False, con=con) + self.send_finger_report(True, con=con) + self.send_image('whorl', con=con) + self.wait_for_result() + + self.assertTrue(self._verify_stopped) + self.assertEqual(self._last_result, 'verify-match') + + self.send_error(con=con) + self.wait_for_result(max_wait=200, expected='verify-match') + class FPrintdVirtualDeviceIdentificationTests(FPrintdVirtualDeviceVerificationTests): '''This class will just repeat the tests of FPrintdVirtualDeviceVerificationTests