"{ errors: { {info}{list} } infos: { {info}{list} } }")
class PyPamTestRunTest(unittest.TestCase):
+ def __init__(self, *args, **kwargs):
+ super(PyPamTestRunTest, self).__init__(*args, **kwargs)
+
+ self.PAM_AUTH_ERR = 7
+ if ("BSD" in platform.system()):
+ self.PAM_AUTH_ERR = 9
+
def test_run(self):
neo_password = "secret"
tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE)
def test_run_failed_auth(self):
neo_password = "not-the-secret"
- rv = 7 # PAM_AUTH_ERR
-
- # On SRV4 the PAM_AUTH_ERR is 9
- if ("BSD" in platform.system()):
- rv = 9
- tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE, expected_rv=rv)
+ tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE, expected_rv=self.PAM_AUTH_ERR)
res = pypamtest.run_pamtest("neo", "matrix_py", [tc], [ neo_password ])
def test_run_chatty_auth(self):