From 47250d2a974131c7c1db76c13303707dda28aaa4 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Wed, 22 Jan 2020 11:49:31 +0100 Subject: python: Add failure test We only had successful pam tests, add a failing one, and check that it fails. Signed-off-by: Bastien Nocera Reviewed-by: Andreas Schneider Reviewed-by: Ralph Boehme --- tests/pypamtest_test.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/pypamtest_test.py b/tests/pypamtest_test.py index ed12a71..030f01a 100755 --- a/tests/pypamtest_test.py +++ b/tests/pypamtest_test.py @@ -115,6 +115,11 @@ class PyPamTestRunTest(unittest.TestCase): self.assertSequenceEqual(res.info, (u'Authentication succeeded',)) self.assertSequenceEqual(res.errors, ()) + def test_run_failed_auth(self): + neo_password = "not-the-secret" + tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE, expected_rv=7) # PAM_AUTH_ERR + res = pypamtest.run_pamtest("neo", "matrix_py", [tc], [ neo_password ]) + def test_repr(self): tc = pypamtest.TestCase(pypamtest.PAMTEST_CHAUTHTOK, 1, 2) r = repr(tc) -- cgit v1.2.3