summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2009-10-12 20:49:23 +1100
committerAndrew Bartlett <abartlet@samba.org>2009-10-21 22:43:51 +1100
commitb73d584a899049442a49d4ce3215678139102ca9 (patch)
tree884b0e71a2ebe19fda671a4fb7d06dd1ffe5a50c /source4
parentb04bdee800dd73417f8885348d90c80dbc20d4a1 (diff)
downloadsamba-b73d584a899049442a49d4ce3215678139102ca9.tar.gz
samba-b73d584a899049442a49d4ce3215678139102ca9.tar.bz2
samba-b73d584a899049442a49d4ce3215678139102ca9.zip
s4:dsdb Fix tests for samba3sam to pass after partitions module changes
This is needed because the new format of the partitions record is a casefolded DN, not a DN and file combination. Andrew Bartlett
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/samdb/ldb_modules/tests/samba3sam.py22
1 files changed, 9 insertions, 13 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/tests/samba3sam.py b/source4/dsdb/samdb/ldb_modules/tests/samba3sam.py
index c61d3973a1..252de85aa1 100644
--- a/source4/dsdb/samdb/ldb_modules/tests/samba3sam.py
+++ b/source4/dsdb/samdb/ldb_modules/tests/samba3sam.py
@@ -52,8 +52,8 @@ class MapBaseTestCase(TestCaseInTempDir):
"@LIST": "rootdse,paged_results,server_sort,asq,samldb,password_hash,operational,objectguid,rdn_name,samba3sam,partition"})
ldb.add({"dn": "@PARTITION",
- "partition": ["%s:%s" % (s4.basedn, s4.url),
- "%s:%s" % (s3.basedn, s3.url)],
+ "partition": ["%s" % (s4.basedn_casefold),
+ "%s" % (s3.basedn_casefold)],
"replicateEntries": ["@ATTRIBUTES", "@INDEXLIST"]})
def setUp(self):
@@ -73,12 +73,13 @@ class MapBaseTestCase(TestCaseInTempDir):
class Target:
"""Simple helper class that contains data for a specific SAM
connection."""
- def __init__(self, file, basedn, dn):
- self.file = os.path.join(tempdir, file)
- self.url = "tdb://" + self.file
+ def __init__(self, basedn, dn):
+ self.db = Ldb(lp=cmdline_loadparm)
self.basedn = basedn
+ self.basedn_casefold = ldb.Dn(self.db, basedn).get_casefold()
self.substvars = {"BASEDN": self.basedn}
- self.db = Ldb(lp=cmdline_loadparm)
+ self.file = os.path.join(tempdir, "%s.ldb" % self.basedn_casefold)
+ self.url = "tdb://" + self.file
self._dn = dn
def dn(self, rdn):
@@ -99,18 +100,15 @@ class MapBaseTestCase(TestCaseInTempDir):
def modify_ldif(self, ldif):
self.db.modify_ldif(self.subst(ldif))
- self.samba4 = Target("samba4.ldb", "dc=vernstok,dc=nl", make_s4dn)
- self.samba3 = Target("samba3.ldb", "cn=Samba3Sam", make_dn)
- self.templates = Target("templates.ldb", "cn=templates", None)
+ self.samba4 = Target("dc=vernstok,dc=nl", make_s4dn)
+ self.samba3 = Target("cn=Samba3Sam", make_dn)
self.samba3.connect()
- self.templates.connect()
self.samba4.connect()
def tearDown(self):
os.unlink(self.ldbfile)
os.unlink(self.samba3.file)
- os.unlink(self.templates.file)
os.unlink(self.samba4.file)
super(MapBaseTestCase, self).tearDown()
@@ -127,7 +125,6 @@ class Samba3SamTestCase(MapBaseTestCase):
super(Samba3SamTestCase, self).setUp()
ldb = Ldb(self.ldburl, lp=cmdline_loadparm)
self.samba3.setup_data("samba3.ldif")
- self.templates.setup_data("provision_samba3sam_templates.ldif")
ldif = read_datafile("provision_samba3sam.ldif")
ldb.add_ldif(self.samba4.subst(ldif))
self.setup_modules(ldb, self.samba3, self.samba4)
@@ -294,7 +291,6 @@ class MapTestCase(MapBaseTestCase):
def setUp(self):
super(MapTestCase, self).setUp()
ldb = Ldb(self.ldburl, lp=cmdline_loadparm)
- self.templates.setup_data("provision_samba3sam_templates.ldif")
ldif = read_datafile("provision_samba3sam.ldif")
ldb.add_ldif(self.samba4.subst(ldif))
self.setup_modules(ldb, self.samba3, self.samba4)