summaryrefslogtreecommitdiff
path: root/source4/dsdb/tests/python/ldap.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.py
parentb7dab4692200dd7f3bbc600560648b8e0ec47e70 (diff)
downloadsamba-4c666f3e0ada47c793ecdec0e5c3dd0441a69080.tar.gz
samba-4c666f3e0ada47c793ecdec0e5c3dd0441a69080.tar.bz2
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.py')
-rwxr-xr-xsource4/dsdb/tests/python/ldap.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/source4/dsdb/tests/python/ldap.py b/source4/dsdb/tests/python/ldap.py
index 00cc450109..fb191c623a 100755
--- a/source4/dsdb/tests/python/ldap.py
+++ b/source4/dsdb/tests/python/ldap.py
@@ -27,6 +27,7 @@ from ldb import Message, MessageElement, Dn
from ldb import FLAG_MOD_ADD, FLAG_MOD_REPLACE, FLAG_MOD_DELETE
from ldb import timestring
from samba import Ldb
+from samba.samdb import SamDB
from samba.dsdb import (UF_NORMAL_ACCOUNT,
UF_WORKSTATION_TRUST_ACCOUNT,
UF_PASSWD_NOTREQD, UF_ACCOUNTDISABLE, ATYPE_NORMAL_ACCOUNT,
@@ -66,12 +67,6 @@ class BasicTests(unittest.TestCase):
except LdbError, (num, _):
self.assertEquals(num, ERR_NO_SUCH_OBJECT)
- 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 find_configurationdn(self, ldb):
res = ldb.search(base="", expression="", scope=SCOPE_BASE, attrs=["configurationNamingContext"])
self.assertEquals(len(res), 1)
@@ -101,7 +96,7 @@ class BasicTests(unittest.TestCase):
super(BasicTests, self).setUp()
self.ldb = ldb
self.gc_ldb = gc_ldb
- self.base_dn = self.find_basedn(ldb)
+ self.base_dn = ldb.domain_dn()
self.configuration_dn = self.find_configurationdn(ldb)
self.schema_dn = self.find_schemadn(ldb)
self.domain_sid = self.find_domain_sid()
@@ -2638,7 +2633,7 @@ if not "://" in host:
else:
host = "ldap://%s" % host
-ldb = Ldb(host, credentials=creds, session_info=system_session(), lp=lp)
+ldb = SamDB(host, credentials=creds, session_info=system_session(), lp=lp)
if not "tdb://" in host:
gc_ldb = Ldb("%s:3268" % host, credentials=creds,
session_info=system_session(), lp=lp)