def test_check_credentials_with_wrong_cafile(opt_adcs): dir_path = os.path.dirname(os.path.realpath(__file__)) ca_bundle = '%s/test_dummy-ca-cert.pem' % dir_path with pytest.raises(SSLError) as excinfo: certsrv.check_credentials(opt_adcs, 'username', 'password', cafile=ca_bundle)
def test_check_wrong_credentials(opt_adcs): assert certsrv.check_credentials(opt_adcs, 'wronguser', 'wrongpassword') == False
def test_check_credentials(opt_adcs, opt_username, opt_password): assert certsrv.check_credentials(opt_adcs, opt_username, opt_password)
def test_check_credentials_with_wrong_cafile(opt_adcs): dir_path = os.path.dirname(os.path.realpath(__file__)) ca_bundle = '%s/test_dummy-ca-cert.pem' % dir_path with pytest.raises(URLError) as excinfo: certsrv.check_credentials(opt_adcs, 'username', 'password', cafile=ca_bundle) assert excinfo.value.reason.reason == 'CERTIFICATE_VERIFY_FAILED'
def test_check_wrong_credentials_with_ntlm(opt_adcs): assert certsrv.check_credentials(opt_adcs, 'wronguser', 'wrongpassword', auth_method='ntlm') == False
def test_check_credentials_with_ntlm(opt_adcs, opt_username, opt_password): assert certsrv.check_credentials(opt_adcs, opt_username, opt_password, auth_method='ntlm')