def test_pamWithUsernameAndPassword_ok(self): """ When a valid username and password is provided it will return True. """ result = system_users.pamWithUsernameAndPassword( username='******', password='******', service='chevah-pam-test', ) self.assertIsTrue(result)
def test_pamWithUsernameAndPassword_bad_user(self): """ When an invalid username is provided it will return False. """ result = system_users.pamWithUsernameAndPassword( username='******', password='******', service='chevah-pam-test', ) self.assertIsFalse(result)
def test_pamWithUsernameAndPassword(self): """ Check PAM authentication. """ if self.os_name == 'solaris': # PAM is broken on Solaris. raise self.skipTest() result = system_users.pamWithUsernameAndPassword( username=TEST_ACCOUNT_USERNAME, password=TEST_ACCOUNT_PASSWORD, ) self.assertTrue(result)