aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2020-01-22 11:49:31 +0100
committerAndreas Schneider <asn@samba.org>2020-03-19 12:43:28 +0100
commit47250d2a974131c7c1db76c13303707dda28aaa4 (patch)
treed9471dd07def440f1cb052272c9efccd2eca5840
parentc348d45fb518775f6a9b60a6c9b889bb3667d344 (diff)
downloadpam_wrapper-47250d2a974131c7c1db76c13303707dda28aaa4.tar.gz
pam_wrapper-47250d2a974131c7c1db76c13303707dda28aaa4.tar.xz
pam_wrapper-47250d2a974131c7c1db76c13303707dda28aaa4.zip
python: Add failure test
We only had successful pam tests, add a failing one, and check that it fails. Signed-off-by: Bastien Nocera <hadess@hadess.net> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
-rwxr-xr-xtests/pypamtest_test.py5
1 files changed, 5 insertions, 0 deletions
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)