tests/fprintd-utils: Verify errors if the device is already claimed

This commit is contained in:
Marco Trevisan (Treviño)
2020-04-02 21:25:13 +02:00
parent 4b0cde81fd
commit 870b48637a

View File

@ -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))