From 04829ed39f5c95137beac25b9516d7b538e1d613 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Tue, 11 Feb 2020 02:13:10 +0100 Subject: [PATCH] tests/fprintd: Check that we can't mix Enroll and Verify operations --- tests/fprintd.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/fprintd.py b/tests/fprintd.py index 4753a5c..5b4bc35 100755 --- a/tests/fprintd.py +++ b/tests/fprintd.py @@ -841,6 +841,22 @@ class FPrintdVirtualDeviceEnrollTests(FPrintdVirtualDeviceBaseTest): def test_enroll_error_data_full(self): self.assertEnrollError(FPrint.DeviceError.DATA_FULL, 'enroll-data-full') + def test_enroll_start_during_enroll(self): + with self.assertFprintError('AlreadyInUse'): + self.device.EnrollStart('(s)', 'left-thumb') + + def test_verify_start_during_enroll(self): + self.device.EnrollStop() + self.wait_for_result() + self.enroll_image('whorl') + self.device.EnrollStart('(s)', 'right-thumb') + with self.assertFprintError('AlreadyInUse'): + self.device.VerifyStart('(s)', 'any') + + def test_verify_stop_during_enroll(self): + with self.assertFprintError('AlreadyInUse'): + self.device.VerifyStop() + class FPrintdVirtualDeviceVerificationTests(FPrintdVirtualDeviceBaseTest): @@ -912,6 +928,18 @@ class FPrintdVirtualDeviceVerificationTests(FPrintdVirtualDeviceBaseTest): def test_verify_error_data_full(self): self.assertVerifyError(FPrint.DeviceError.DATA_FULL, 'verify-unknown-error') + def test_verify_start_during_verify(self): + with self.assertFprintError('AlreadyInUse'): + self.device.VerifyStart('(s)', self.verify_finger) + + def test_enroll_start_during_verify(self): + with self.assertFprintError('AlreadyInUse'): + self.device.EnrollStart('(s)', 'right-thumb') + + def test_enroll_stop_during_verify(self): + with self.assertFprintError('AlreadyInUse'): + self.device.EnrollStop() + class FPrintdVirtualDeviceIdentificationTests(FPrintdVirtualDeviceVerificationTests): '''This class will just repeat the tests of FPrintdVirtualDeviceVerificationTests