summaryrefslogtreecommitdiffstats
path: root/source4/dsdb/tests/python/ldap_schema.py
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-11-18 16:06:46 +0100
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-11-18 17:03:20 +0000
commit4c666f3e0ada47c793ecdec0e5c3dd0441a69080 (patch)
tree1c02a3252fdcadfeb5456b5c158171acafeb9801 /source4/dsdb/tests/python/ldap_schema.py
parentb7dab4692200dd7f3bbc600560648b8e0ec47e70 (diff)
downloadsamba-4c666f3e0ada47c793ecdec0e5c3dd0441a69080.tar.gz
samba-4c666f3e0ada47c793ecdec0e5c3dd0441a69080.tar.xz
samba-4c666f3e0ada47c793ecdec0e5c3dd0441a69080.zip
s4:dsdb python tests - use "ldb.domain_dn"
By inspiration of Nadya's patches
Diffstat (limited to 'source4/dsdb/tests/python/ldap_schema.py')
-rwxr-xr-xsource4/dsdb/tests/python/ldap_schema.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/source4/dsdb/tests/python/ldap_schema.py b/source4/dsdb/tests/python/ldap_schema.py
index a296b8daaf3..168cea39d34 100755
--- a/source4/dsdb/tests/python/ldap_schema.py
+++ b/source4/dsdb/tests/python/ldap_schema.py
@@ -22,7 +22,7 @@ from ldb import ERR_UNWILLING_TO_PERFORM
from ldb import ERR_CONSTRAINT_VIOLATION
from ldb import Message, MessageElement, Dn
from ldb import FLAG_MOD_REPLACE
-from samba import Ldb
+from samba.samdb import SamDB
from samba.dsdb import DS_DOMAIN_FUNCTION_2003
from subunit.run import SubunitTestRunner
@@ -60,17 +60,11 @@ class SchemaTests(unittest.TestCase):
self.assertEquals(len(res), 1)
return res[0]["schemaNamingContext"][0]
- def find_basedn(self, ldb):
- res = ldb.search(base="", expression="", scope=SCOPE_BASE,
- attrs=["defaultNamingContext"])
- self.assertEquals(len(res), 1)
- return res[0]["defaultNamingContext"][0]
-
def setUp(self):
super(SchemaTests, self).setUp()
self.ldb = ldb
+ self.base_dn = ldb.domain_dn()
self.schema_dn = self.find_schemadn(ldb)
- self.base_dn = self.find_basedn(ldb)
def test_generated_schema(self):
"""Testing we can read the generated schema via LDAP"""
@@ -583,7 +577,7 @@ 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 = SamDB(host, credentials=creds, session_info=system_session(), lp=lp, options=ldb_options)
runner = SubunitTestRunner()
rc = 0