From 870b48637a18abb429d2d737d0560e06943b4822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Thu, 2 Apr 2020 21:25:13 +0200 Subject: [PATCH] tests/fprintd-utils: Verify errors if the device is already claimed --- tests/test_fprintd_utils.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_fprintd_utils.py b/tests/test_fprintd_utils.py index 129cc25..2fd644f 100755 --- a/tests/test_fprintd_utils.py +++ b/tests/test_fprintd_utils.py @@ -178,6 +178,7 @@ class TestFprintdUtilsVerify(TestFprintdUtilsBase): self.process = self.start_utility_process('verify', args) out = self.get_process_output(self.process) + self.assertNotRegex(out, r'Device already in use by [A-z]+') self.assertNotIn('Verify result:', out) if checkEnrolled: @@ -206,6 +207,12 @@ class TestFprintdUtilsVerify(TestFprintdUtilsBase): time.sleep(self.sleep_time * 4) self.assertVerifyMatch(True) + def test_fprintd_multiple_verify_fails(self): + self.start_verify_process() + + with self.assertRaisesRegex(AssertionError, r'Device already in use'): + self.start_verify_process() + if __name__ == '__main__': # avoid writing to stderr unittest.main(testRunner=unittest.TextTestRunner(stream=sys.stdout, verbosity=2))