From c6647ba875225b876bec463c4490c90f960d0f60 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Wed, 16 Dec 2020 14:44:23 +0100 Subject: [PATCH] tests: Add test that enforces a verify/identify operation restart In the usual test we cancel the operation immediately by calling VerifyStop. This (often) tests the case where we don't end up restarting the Verify operation internally. We can easily force fprintd to have restarted already internally, so add a test that does so by sleeping a bit. This should give us a slightly higher branch coverage in the verify_cb/identify_cb tests. --- tests/fprintd.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/fprintd.py b/tests/fprintd.py index 9e6fc7e..03405e6 100644 --- a/tests/fprintd.py +++ b/tests/fprintd.py @@ -1214,6 +1214,12 @@ class FPrintdVirtualDeviceVerificationTests(FPrintdVirtualDeviceBaseTest): def test_verify_retry_general(self): self.assertVerifyRetry(FPrint.DeviceRetry.GENERAL, 'verify-retry-scan') + def test_verify_retry_general_restarted(self): + self.assertVerifyRetry(FPrint.DeviceRetry.GENERAL, 'verify-retry-scan') + # Give fprintd time to re-start the request. We can't force the other + # case (cancellation before restart happened), but we can force this one. + time.sleep(1) + def test_verify_retry_too_short(self): self.assertVerifyRetry(FPrint.DeviceRetry.TOO_SHORT, 'verify-swipe-too-short')