From fcd2d65490fc8a97ba7a3bf4eacc3b5f2d9dcd2d Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Mon, 6 Apr 2020 17:43:04 +0200 Subject: [PATCH] tests: Add PAM test for hardware failure This error is supposed to help replicate the problems encountered in: https://gitlab.freedesktop.org/libfprint/fprintd/-/issues/59 --- tests/pam/test_pam_fprintd.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/pam/test_pam_fprintd.py b/tests/pam/test_pam_fprintd.py index 99383a2..3946543 100755 --- a/tests/pam/test_pam_fprintd.py +++ b/tests/pam/test_pam_fprintd.py @@ -88,6 +88,19 @@ class TestPamFprintd(dbusmock.DBusTestCase): self.device_mock = self.dbus_con.get_object('net.reactivated.Fprint', device_path) self.device_mock.SetEnrolledFingers('toto', ['left-little-finger', 'right-little-finger']) + def test_pam_fprintd_identify_error(self): + self.setup_device() + script = [ + ( 'verify-unknown-error', True, 2 ) + ] + self.device_mock.SetVerifyScript(script) + + tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE, expected_rv=PAM_AUTHINFO_UNAVAIL) + res = pypamtest.run_pamtest("toto", "fprintd-pam-test", [tc], [ 'unused' ]) + + self.assertRegex(res.info[0], r'Swipe your left little finger across the fingerprint reader') + self.assertEqual(len(res.errors), 0) + def test_pam_fprintd_auth(self): self.setup_device() script = [