Пример #1
0
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)
Пример #2
0
def test_check_wrong_credentials(opt_adcs):
    assert certsrv.check_credentials(opt_adcs, 'wronguser', 'wrongpassword') == False
Пример #3
0
def test_check_credentials(opt_adcs, opt_username, opt_password):
    assert certsrv.check_credentials(opt_adcs, opt_username, opt_password)
Пример #4
0
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'
Пример #5
0
def test_check_wrong_credentials_with_ntlm(opt_adcs):
    assert certsrv.check_credentials(opt_adcs, 'wronguser', 'wrongpassword', auth_method='ntlm') == False
Пример #6
0
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')