summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamenim@samba.org>2010-09-29 15:51:11 +0300
committerKamen Mazdrashki <kamenim@samba.org>2010-10-03 01:24:57 +0300
commit83a15155ebb3399117ce0da7d4e0faa1b72199f9 (patch)
tree66d85c3a282dacbf1df0b72f341b9578a92f6e76 /source4
parent2a23f0d524298c2cc78f36a2f5b45560ec36747f (diff)
downloadsamba-83a15155ebb3399117ce0da7d4e0faa1b72199f9.tar.gz
samba-83a15155ebb3399117ce0da7d4e0faa1b72199f9.tar.bz2
samba-83a15155ebb3399117ce0da7d4e0faa1b72199f9.zip
s4-test-dsdb_schema_info.py: Simplify connection SamDB
by using samba.tests.connect_samdb() helper
Diffstat (limited to 'source4')
-rwxr-xr-xsource4/dsdb/tests/python/dsdb_schema_info.py22
1 files changed, 3 insertions, 19 deletions
diff --git a/source4/dsdb/tests/python/dsdb_schema_info.py b/source4/dsdb/tests/python/dsdb_schema_info.py
index 893cd4cdfb..1d259958d6 100755
--- a/source4/dsdb/tests/python/dsdb_schema_info.py
+++ b/source4/dsdb/tests/python/dsdb_schema_info.py
@@ -193,22 +193,6 @@ systemOnly: FALSE
########################################################################################
-if not "DC_SERVER" in os.environ.keys():
- raise AssertionError("Please supply TARGET_DC in environment")
-ldb_url = os.environ["DC_SERVER"]
-
-ldb_options = []
-if not "://" in ldb_url:
- if os.path.isfile(ldb_url):
- ldb_url = "tdb://%s" % ldb_url
- else:
- ldb_url = "ldap://%s" % ldb_url
-# use 'paged_search' module when connecting remotely
-if ldb_url.lower().startswith("ldap://"):
- ldb_options = ["modules:paged_searches"]
-
-ldb = SamDB(url=ldb_url,
- lp=samba.tests.env_loadparm(),
- session_info=system_session(),
- credentials=samba.tests.cmdline_credentials,
- options=ldb_options)
+
+ldb_url = samba.tests.env_get_var_value("DC_SERVER")
+ldb = samba.tests.connect_samdb(ldb_url)