mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-08-15 15:35:01 -05:00
test_serverroles: ensure that test API is initialized with correct ldap_uri
This ensures that the serverroles test works also when run together with other iaserver test suites. https://fedorahosted.org/freeipa/ticket/6000 Reviewed-By: Lenka Doudova <ldoudova@redhat.com>
This commit is contained in:
committed by
Martin Basti
parent
f7cc15f099
commit
a79d45ad79
@@ -469,12 +469,17 @@ class MockMasterTopology(object):
|
||||
@pytest.fixture(scope='module')
|
||||
def mock_api(request):
|
||||
test_api = create_api(mode=None)
|
||||
test_api.bootstrap(in_server=True, in_tree=True)
|
||||
test_api.bootstrap(in_server=True, ldap_uri=api.env.ldap_uri)
|
||||
test_api.finalize()
|
||||
|
||||
if not test_api.Backend.ldap2.isconnected():
|
||||
test_api.Backend.ldap2.connect()
|
||||
|
||||
def finalize():
|
||||
test_api.Backend.ldap2.disconnect()
|
||||
|
||||
request.addfinalizer(finalize)
|
||||
|
||||
return test_api
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user