Makes the test suite play nice with others during CI.

https://fedorahosted.org/freeipa/ticket/6000

--
Martin^3 Babinsky
From c3443cd12e6fdb9e2903ffff3c5395146114d5f7 Mon Sep 17 00:00:00 2001
From: Martin Babinsky <mbabi...@redhat.com>
Date: Mon, 27 Jun 2016 13:44:17 +0200
Subject: [PATCH] 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
---
 ipatests/test_ipaserver/test_serverroles.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/ipatests/test_ipaserver/test_serverroles.py b/ipatests/test_ipaserver/test_serverroles.py
index ef8cca3d978ddb0fec131c0d23dd8cf4816f5bd0..370e86dde3f7cc5e204dcb6488a59162c551637d 100644
--- a/ipatests/test_ipaserver/test_serverroles.py
+++ b/ipatests/test_ipaserver/test_serverroles.py
@@ -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
 
 
-- 
2.5.5

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to