Commit c12778ec authored by Marco Trevisan's avatar Marco Trevisan Committed by Bastien Nocera
Browse files

tests/fprintd: Verify that each enroll stage happens

Instead of automatically replying with the 'whorl' image for every enroll
state signal with result 'enroll-stage-passed', only perform the number
of required enroll stages and ensure that we get the expected results.

This also will allow to manually perform enroll steps in other tests.
parent dbabd4d7
......@@ -307,8 +307,9 @@ class FPrintdVirtualDeviceTest(FPrintdTest):
self._abort = params[1]
self._last_result = params[0]
if not self._abort and self._last_result == 'enroll-stage-passed':
self.send_image('whorl')
if not self._abort and self._last_result.startswith('enroll-'):
# Exit wait loop, onto next enroll state (if any)
self._abort = True
elif self._abort:
pass
else:
......@@ -354,8 +355,13 @@ class FPrintdVirtualDeviceTest(FPrintdTest):
def enroll_image(self, img, finger='right-index-finger'):
self.device.EnrollStart('(s)', finger)
stages = self.device.get_cached_property('num-enroll-stages').unpack()
for stage in range(stages):
self.send_image(img)
self.wait_for_result()
if stage < stages - 1:
self.wait_for_result('enroll-stage-passed')
else:
self.wait_for_result('enroll-completed')
self.device.EnrollStop()
self.assertEqual(self._last_result, 'enroll-completed')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment