verify: Pass the "any" finger parameter to the daemon

fprintd supports "any" finger parameter for the VerifyStart call, and it's
up to the daemon to pick the first known if the device doesn't support
identification.

So remove the check to verify utility and add a test to verify this is
respected.
This commit is contained in:
Marco Trevisan (Treviño)
2020-04-03 02:55:33 +02:00
parent d7ca9e6095
commit f6eb3b3ea5
2 changed files with 18 additions and 4 deletions

View File

@ -89,8 +89,10 @@ class TestFprintdUtilsBase(dbusmock.DBusTestCase):
super().tearDown()
def setup_device(self):
device_path = self.obj_fprintd_mock.AddDevice('FDO Trigger Finger Laser Reader', 3, 'swipe')
self.device_mock = self.dbus_con.get_object('net.reactivated.Fprint', device_path)
self.device_path = self.obj_fprintd_mock.AddDevice(
'FDO Trigger Finger Laser Reader', 3, 'swipe')
self.device_mock = self.dbus_con.get_object('net.reactivated.Fprint',
self.device_path)
self.set_enrolled_fingers(['left-little-finger', 'right-little-finger'])
def set_enrolled_fingers(self, fingers, user='toto'):
@ -236,6 +238,19 @@ class TestFprintdUtilsVerify(TestFprintdUtilsBase):
time.sleep(self.sleep_time)
self.assertVerifyMatch(True)
def test_fprintd_verify_any_finger_identification(self):
self.obj_fprintd_mock.RemoveDevice(self.device_path)
self.device_path = self.obj_fprintd_mock.AddDevice('Full powered device',
3, 'press', True)
self.device_mock = self.dbus_con.get_object('net.reactivated.Fprint',
self.device_path)
self.set_enrolled_fingers(VALID_FINGER_NAMES)
self.start_verify_process(finger='any')
self.device_mock.EmitVerifyStatus('verify-match', True)
time.sleep(self.sleep_time)
self.assertVerifyMatch(True)
def test_fprintd_verify_not_enrolled_fingers(self):
for finger in [f for f in VALID_FINGER_NAMES if f not in self.enrolled_fingers]:
regex = r'Finger \'{}\' not enrolled'.format(finger)