summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2021-04-01 18:37:14 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2021-04-01 23:09:29 +0200
commite8622b3e632bc8fe9d3c6803f5e230960386b046 (patch)
tree0b456ad83b3d100772a4246ff777bc6c50f217e6 /tests
parent5785dc65b4a8c5068d7993884a16d74de6f84f8e (diff)
device: Support enrolling on devices with no identification support
Diffstat (limited to 'tests')
-rw-r--r--tests/fprintd.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/fprintd.py b/tests/fprintd.py
index 37a7bfa..940e5e9 100644
--- a/tests/fprintd.py
+++ b/tests/fprintd.py
@@ -567,6 +567,7 @@ class FPrintdVirtualImageDeviceBaseTests(FPrintdTest):
socket_env = 'FP_VIRTUAL_IMAGE'
device_driver = 'virtual_image'
driver_name = 'Virtual image device for debugging'
+ has_identification = True
class FPrintdVirtualDeviceBaseTest(FPrintdVirtualImageDeviceBaseTests):
@@ -882,10 +883,12 @@ class FPrintdVirtualStorageDeviceBaseTest(FPrintdVirtualDeviceBaseTest):
def _maybe_reduce_enroll_stages(self, stages=-1):
# Reduce the number of default enroll stages, we can go a bit faster
stages = stages if stages > 0 else self.enroll_stages
- stages += 1 # Adding the extra stage for duplicates-check
+ if self.has_identification:
+ stages += 1 # Adding the extra stage for duplicates-check
if self.num_enroll_stages == stages:
return
- self.send_command('SET_ENROLL_STAGES', stages - 1)
+ device_stages = stages -1 if self.has_identification else stages
+ self.send_command('SET_ENROLL_STAGES', device_stages)
while self.num_enroll_stages != stages:
ctx.iteration(True)
self.assertIn({'num-enroll-stages': stages}, self._changed_properties)
@@ -1004,10 +1007,8 @@ class FPrintdVirtualNoStorageDeviceBaseTest(FPrintdVirtualStorageDeviceBaseTest)
socket_env = 'FP_VIRTUAL_DEVICE'
device_driver = 'virtual_device'
driver_name = 'Virtual device for debugging'
+ has_identification = False
- def enroll_image(self, img, device=None, finger='right-index-finger',
- expected_result='enroll-completed', claim_user=None):
- self.skipTest('Identification not supported, thus is the enrolling')
class FPrintdVirtualNoStorageDeviceTest(FPrintdVirtualNoStorageDeviceBaseTest):
@@ -2212,8 +2213,9 @@ class FPrintdVirtualDeviceEnrollTests(FPrintdVirtualDeviceBaseTest):
self.assertEnrollError(FPrint.DeviceError.DATA_INVALID, 'enroll-unknown-error')
def test_enroll_error_data_not_found(self):
- self.assertEnrollError(
- FPrint.DeviceError.DATA_NOT_FOUND, 'enroll-stage-passed')
+ if self.has_identification:
+ self.assertEnrollError(
+ FPrint.DeviceError.DATA_NOT_FOUND, 'enroll-stage-passed')
self.assertEnrollError(FPrint.DeviceError.DATA_NOT_FOUND, 'enroll-unknown-error')
def test_enroll_error_data_full(self):