summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamenim@samba.org>2010-09-29 03:02:11 +0300
committerKamen Mazdrashki <kamenim@samba.org>2010-10-03 01:24:56 +0300
commit6bc7c015fb510756dce4ada4831ca094a5d07a61 (patch)
tree255804ceff934e2b2ab46a59f91738e863b11de0 /source4
parent98e4d2702aa98d0cf89d3240276f2b5d6e841d45 (diff)
downloadsamba-6bc7c015fb510756dce4ada4831ca094a5d07a61.tar.gz
samba-6bc7c015fb510756dce4ada4831ca094a5d07a61.tar.bz2
samba-6bc7c015fb510756dce4ada4831ca094a5d07a61.zip
s4-test-fsmo.py: Use common implementation for connect_samdb()
Connections are restricted to LDAP only (remote), as this test can't be run against local LDBs
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/drs/python/fsmo.py24
1 files changed, 2 insertions, 22 deletions
diff --git a/source4/torture/drs/python/fsmo.py b/source4/torture/drs/python/fsmo.py
index 27107c1f6a..bafff94024 100644
--- a/source4/torture/drs/python/fsmo.py
+++ b/source4/torture/drs/python/fsmo.py
@@ -54,10 +54,10 @@ class DrsFsmoTestCase(samba.tests.TestCase):
# connect to DCs singleton
if self.ldb_dc1 is None:
DrsFsmoTestCase.dc1 = get_env_var("DC1")
- DrsFsmoTestCase.ldb_dc1 = connect_samdb(self.dc1)
+ DrsFsmoTestCase.ldb_dc1 = samba.tests.connect_samdb(self.dc1, ldap_only=True)
if self.ldb_dc2 is None:
DrsFsmoTestCase.dc2 = get_env_var("DC2")
- DrsFsmoTestCase.ldb_dc2 = connect_samdb(self.dc2)
+ DrsFsmoTestCase.ldb_dc2 = samba.tests.connect_samdb(self.dc2, ldap_only=True)
# fetch rootDSEs
if self.info_dc1 is None:
@@ -158,23 +158,3 @@ def get_env_var(var_name):
if not var_name in os.environ.keys():
raise AssertionError("Please supply %s in environment" % var_name)
return os.environ[var_name]
-
-def connect_samdb(samdb_url):
- ldb_options = []
- if not "://" in samdb_url:
- if os.path.isfile(samdb_url):
- samdb_url = "tdb://%s" % samdb_url
- else:
- samdb_url = "ldap://%s:389" % samdb_url
- # use 'paged_search' module when connecting remotely
- if samdb_url.lower().startswith("ldap://"):
- ldb_options = ["modules:paged_searches"]
-
- return SamDB(url=samdb_url,
- lp=samba.tests.env_loadparm(),
- session_info=system_session(),
- credentials=samba.tests.cmdline_credentials,
- options=ldb_options)
-
-
-