1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

tests/pam_winbind.py: turn pypamtest.PamTestError into a failure

A failure generated by the AssertionError() checks can be added
to selftest/knownfail.d/*.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14124

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
This commit is contained in:
Stefan Metzmacher 2019-09-18 08:04:42 +02:00 committed by Günther Deschner
parent a77be15d28
commit cd3ffaabb5
3 changed files with 20 additions and 5 deletions

View File

@ -30,7 +30,10 @@ class SimplePamTests(samba.tests.TestCase):
expected_rc = 0 # PAM_SUCCESS
tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE, expected_rc)
res = pypamtest.run_pamtest(unix_username, "samba", [tc], [password])
try:
res = pypamtest.run_pamtest(unix_username, "samba", [tc], [password])
except pypamtest.PamTestError as e:
raise AssertionError(str(e))
self.assertTrue(res is not None)
@ -42,7 +45,10 @@ class SimplePamTests(samba.tests.TestCase):
expected_rc = 7 # PAM_AUTH_ERR
tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE, expected_rc)
res = pypamtest.run_pamtest(unix_username, "samba", [tc], [password])
try:
res = pypamtest.run_pamtest(unix_username, "samba", [tc], [password])
except pypamtest.PamTestError as e:
raise AssertionError(str(e))
self.assertTrue(res is not None)
@ -52,6 +58,9 @@ class SimplePamTests(samba.tests.TestCase):
expected_rc = 0 # PAM_SUCCESS
tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE, expected_rc)
res = pypamtest.run_pamtest(unix_username, "samba", [tc], [password])
try:
res = pypamtest.run_pamtest(unix_username, "samba", [tc], [password])
except pypamtest.PamTestError as e:
raise AssertionError(str(e))
self.assertTrue(res is not None)

View File

@ -31,6 +31,9 @@ class PamChauthtokTests(samba.tests.TestCase):
expected_rc = 0 # PAM_SUCCESS
tc = pypamtest.TestCase(pypamtest.PAMTEST_CHAUTHTOK, expected_rc)
res = pypamtest.run_pamtest(unix_username, "samba", [tc], [password, newpassword, newpassword])
try:
res = pypamtest.run_pamtest(unix_username, "samba", [tc], [password, newpassword, newpassword])
except pypamtest.PamTestError as e:
raise AssertionError(str(e))
self.assertTrue(res is not None)

View File

@ -31,7 +31,10 @@ class PasswordExpirePamTests(samba.tests.TestCase):
expected_rc = 0 # PAM_SUCCESS
tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE, expected_rc)
res = pypamtest.run_pamtest(unix_username, "samba", [tc], [password])
try:
res = pypamtest.run_pamtest(unix_username, "samba", [tc], [password])
except pypamtest.PamTestError as e:
raise AssertionError(str(e))
self.assertTrue(res is not None)
if warn_pwd_expire == 0: