diff --git a/src/device.c b/src/device.c index f39cee5..2fbf4f6 100644 --- a/src/device.c +++ b/src/device.c @@ -1494,8 +1494,6 @@ fprint_device_verify_start (FprintDBusDevice *dbus_dev, { g_autoptr(FpPrint) print = NULL; - priv->current_action = ACTION_VERIFY; - if (gallery) { print = g_ptr_array_steal_index_fast (gallery, 0); @@ -1518,6 +1516,7 @@ fprint_device_verify_start (FprintDBusDevice *dbus_dev, g_debug ("start verification device %d finger %s", priv->id, fp_finger_to_name (finger)); + priv->current_action = ACTION_VERIFY; priv->current_cancellable = g_cancellable_new (); priv->verify_data = g_object_ref (print); fp_device_verify (priv->dev, print, priv->current_cancellable, diff --git a/tests/fprintd.py b/tests/fprintd.py index fb74993..9408c8e 100644 --- a/tests/fprintd.py +++ b/tests/fprintd.py @@ -1780,6 +1780,25 @@ class FPrintdVirtualDeviceClaimedTest(FPrintdVirtualDeviceBaseTest): with self.assertFprintError('NoEnrolledPrints'): self.device.VerifyStart('(s)', 'right-thumb') + def test_verify_finger_not_enrolled_stops_verification(self): + self.enroll_image('whorl', finger='left-thumb') + with self.assertFprintError('NoEnrolledPrints'): + self.device.VerifyStart('(s)', 'right-thumb') + + with self.assertFprintError('NoActionInProgress'): + self.device.VerifyStop() + + def test_identify_finger_not_enrolled(self): + with self.assertFprintError('NoEnrolledPrints'): + self.device.VerifyStart('(s)', 'any') + + def test_identify_finger_not_enrolled_stops_verification(self): + with self.assertFprintError('NoEnrolledPrints'): + self.device.VerifyStart('(s)', 'any') + + with self.assertFprintError('NoActionInProgress'): + self.device.VerifyStop() + def test_unallowed_enroll_start(self): self._polkitd_obj.SetAllowed([''])