From 7f2133cc790180129c3f182241dec2576073642a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Sun, 24 Jan 2021 21:47:37 +0100 Subject: [PATCH] tests/fprintd: Verify using no-identification device with 'any' finger --- tests/fprintd.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/fprintd.py b/tests/fprintd.py index b16d34b..fd462af 100644 --- a/tests/fprintd.py +++ b/tests/fprintd.py @@ -828,6 +828,35 @@ class FPrintdVirtualNoStorageDeviceBaseTest(FPrintdVirtualStorageDeviceBaseTest) device_driver = 'virtual_device' driver_name = 'Virtual device for debugging' +class FPrintdVirtualNoStorageDeviceTest(FPrintdVirtualNoStorageDeviceBaseTest): + + def check_verify_finger_match(self, image, expect_match): + self.device.VerifyStart('(s)', 'any') + self.send_image(image) + self.wait_for_result() + self.assertTrue(self._verify_stopped) + if expect_match: + self.assertEqual(self._last_result, 'verify-match') + else: + self.assertEqual(self._last_result, 'verify-no-match') + self.device.VerifyStop() + + def test_verify_any_finger_match_first_only(self): + self.device.Claim('(s)', 'testuser') + self.addCleanup(self.device.Release) + + enrolled, enroll_map = self.enroll_multiple_images() + self.check_verify_finger_match(enroll_map[enrolled[0]], expect_match=True) + self.check_verify_finger_match(enroll_map[enrolled[1]], expect_match=False) + self.check_verify_finger_match(enroll_map[enrolled[2]], expect_match=False) + + def test_verify_any_finger_no_match(self): + self.device.Claim('(s)', 'testuser') + self.addCleanup(self.device.Release) + + FPrintdVirtualDeviceClaimedTest.test_verify_any_finger_no_match(self) + + class FPrintdManagerTests(FPrintdVirtualDeviceBaseTest): def setUp(self):