summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatoliy Atanasov <anatoliy.atanasov@postpath.com>2010-11-18 17:11:55 +0200
committerAnatoliy Atanasov <anatoliy.atanasov@postpath.com>2010-11-18 16:16:27 +0000
commitb388951eea2bb8f609e3a5eae5092e4c0fefc30b (patch)
tree63dd4d124d12f9212b3db56f4c14af1fcab98001
parent92e8fd0513e0b7dd3523c1c5cab066231a38470d (diff)
downloadsamba-b388951eea2bb8f609e3a5eae5092e4c0fefc30b.tar.gz
samba-b388951eea2bb8f609e3a5eae5092e4c0fefc30b.tar.bz2
samba-b388951eea2bb8f609e3a5eae5092e4c0fefc30b.zip
s4/ldap: ldap_syntaxes.py cleanup
Autobuild-User: Anatoliy Atanasov <anatoliy.atanasov@postpath.com> Autobuild-Date: Thu Nov 18 16:16:27 UTC 2010 on sn-devel-104
-rw-r--r--source4/dsdb/tests/python/ldap_syntaxes.py20
1 files changed, 3 insertions, 17 deletions
diff --git a/source4/dsdb/tests/python/ldap_syntaxes.py b/source4/dsdb/tests/python/ldap_syntaxes.py
index abec467de8..f5d2dcba16 100644
--- a/source4/dsdb/tests/python/ldap_syntaxes.py
+++ b/source4/dsdb/tests/python/ldap_syntaxes.py
@@ -19,13 +19,9 @@ import samba.getopt as options
from samba.auth import system_session
from ldb import SCOPE_ONELEVEL, SCOPE_BASE, SCOPE_SUBTREE, LdbError
from ldb import ERR_NO_SUCH_OBJECT
-from ldb import ERR_UNWILLING_TO_PERFORM
from ldb import ERR_CONSTRAINT_VIOLATION
from ldb import ERR_INVALID_ATTRIBUTE_SYNTAX
from ldb import ERR_ENTRY_ALREADY_EXISTS
-from ldb import Message, MessageElement, Dn
-from ldb import FLAG_MOD_REPLACE
-from samba import Ldb
from samba.ndr import ndr_pack, ndr_unpack
from samba.dcerpc import security
@@ -33,6 +29,8 @@ from samba.dcerpc import security
from subunit.run import SubunitTestRunner
import unittest
+import samba.tests
+
parser = optparse.OptionParser("ldap [options] <host>")
sambaopts = options.SambaOptions(parser)
parser.add_option_group(sambaopts)
@@ -399,19 +397,7 @@ name: """ + object_name + """
self.assertEquals(num, ERR_CONSTRAINT_VIOLATION)
pass
-if not "://" in host:
- if os.path.isfile(host):
- host = "tdb://%s" % host
- else:
- host = "ldap://%s" % host
-
-ldb_options = []
-if host.startswith("ldap://"):
- # user 'paged_search' module when connecting remotely
- ldb_options = ["modules:paged_searches"]
-
-ldb = Ldb(host, credentials=creds, session_info=system_session(), lp=lp, options=ldb_options)
-
+ldb = samba.tests.connect_samdb(host, credentials=creds, session_info=system_session(), lp=lp)
runner = SubunitTestRunner()
rc = 0
if not runner.run(unittest.makeSuite(SyntaxTests)).wasSuccessful():