mirror of
https://gitlab.com/mishakmak/pam-fprint-grosshack.git
synced 2026-04-08 20:03:34 +02:00
tests: Add test that PAM gives up when daemon disappears
This commit is contained in:
@ -273,6 +273,19 @@ class TestPamFprintd(dbusmock.DBusTestCase):
|
|||||||
res = pypamtest.run_pamtest("toto", "fprintd-pam-test", [tc], [ 'unused' ])
|
res = pypamtest.run_pamtest("toto", "fprintd-pam-test", [tc], [ 'unused' ])
|
||||||
self.assertRegex(res.info[1], r'Verification timed out')
|
self.assertRegex(res.info[1], r'Verification timed out')
|
||||||
|
|
||||||
|
def test_pam_notices_fprintd_disappearing(self):
|
||||||
|
self.setup_device()
|
||||||
|
|
||||||
|
script = [
|
||||||
|
( 'MOCK: quit', True, 0 ),
|
||||||
|
]
|
||||||
|
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.assertEqual(len(res.errors), 0)
|
||||||
|
self.assertEqual(len(res.info), 0)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
if 'PAM_WRAPPER_SERVICE_DIR' not in os.environ:
|
if 'PAM_WRAPPER_SERVICE_DIR' not in os.environ:
|
||||||
print('Cannot run test without environment set correctly, run "meson test" instead')
|
print('Cannot run test without environment set correctly, run "meson test" instead')
|
||||||
|
|||||||
Reference in New Issue
Block a user