summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/tests/python
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-11-18 13:27:50 +1100
committerAndrew Tridgell <tridge@samba.org>2009-11-20 11:34:38 +1100
commit2e46df492ccbfd327e2d37e3951ec995a09c9a7e (patch)
tree740a449c165b214df21c65d91ed10838c4bad4e2 /source4/lib/ldb/tests/python
parent5cd8b0e8f728db4f03e66ca9994d3c234e2ac944 (diff)
downloadsamba-2e46df492ccbfd327e2d37e3951ec995a09c9a7e.tar.gz
samba-2e46df492ccbfd327e2d37e3951ec995a09c9a7e.tar.bz2
samba-2e46df492ccbfd327e2d37e3951ec995a09c9a7e.zip
s4-ldb: allow ldap.py test suite to run directly against a file
This makes it much easier to debug (as you can break in the ldb modules by running gdb on /usr/bin/python)
Diffstat (limited to 'source4/lib/ldb/tests/python')
-rwxr-xr-xsource4/lib/ldb/tests/python/ldap.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/source4/lib/ldb/tests/python/ldap.py b/source4/lib/ldb/tests/python/ldap.py
index a77a7777df..ed8e663ac8 100755
--- a/source4/lib/ldb/tests/python/ldap.py
+++ b/source4/lib/ldb/tests/python/ldap.py
@@ -8,6 +8,7 @@ import sys
import time
import random
import base64
+import os
sys.path.append("bin/python")
sys.path.append("../lib/subunit/python")
@@ -1981,7 +1982,10 @@ name: """ + object_name + """
self.delete_force(self.ldb, "cn=%s,cn=Users,%s" % (object_name, self.base_dn))
if not "://" in host:
- host = "ldap://%s" % host
+ if os.path.isfile(host):
+ host = "tdb://%s" % host
+ else:
+ host = "ldap://%s" % host
ldb = Ldb(host, credentials=creds, session_info=system_session(), lp=lp)
gc_ldb = Ldb("%s:3268" % host, credentials=creds,