diff options
author | Kamen Mazdrashki <kamenim@samba.org> | 2010-12-13 20:15:26 +0200 |
---|---|---|
committer | Kamen Mazdrashki <kamenim@samba.org> | 2010-12-15 00:51:19 +0100 |
commit | 9c78bdfd478ab6229f48de1aa907818151840da4 (patch) | |
tree | aa2ba89f6dbfadc5d383444d4cf6c9d4f12eb8fa | |
parent | dda73b85e6e7102a2de6a020f1271140bf8f3aaf (diff) | |
download | samba-9c78bdfd478ab6229f48de1aa907818151840da4.tar.gz samba-9c78bdfd478ab6229f48de1aa907818151840da4.tar.bz2 samba-9c78bdfd478ab6229f48de1aa907818151840da4.zip |
s4-test/repl_schema: Make sure every object is with unique name
This way, test writer don't have to be careful to choose
unique objects suffix
-rw-r--r-- | source4/torture/drs/python/repl_schema.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source4/torture/drs/python/repl_schema.py b/source4/torture/drs/python/repl_schema.py index 997c94874f..722718e3cb 100644 --- a/source4/torture/drs/python/repl_schema.py +++ b/source4/torture/drs/python/repl_schema.py @@ -53,6 +53,8 @@ class DrsReplSchemaTestCase(samba.tests.TestCase): # prefix for all objects created obj_prefix = None + # current Class or Attribute object id + obj_id = 0 def setUp(self): super(DrsReplSchemaTestCase, self).setUp() @@ -68,7 +70,7 @@ class DrsReplSchemaTestCase(samba.tests.TestCase): # initialize objects prefix if not done yet if self.obj_prefix is None: t = time.strftime("%s", time.gmtime()) - DrsReplSchemaTestCase.obj_prefix = "DrsReplSchema-%s-" % t + DrsReplSchemaTestCase.obj_prefix = "DrsReplSchema-%s" % t # cache some of RootDSE props self.schema_dn = self.info_dc1["schemaNamingContext"][0] @@ -111,7 +113,8 @@ class DrsReplSchemaTestCase(samba.tests.TestCase): def _make_obj_names(self, base_name): '''Try to create a unique name for an object that is to be added to schema''' - obj_name = self.obj_prefix + base_name + self.obj_id += 1 + obj_name = "%s-%d-%s" % (self.obj_prefix, self.obj_id, base_name) obj_ldn = obj_name.replace("-", "") obj_dn = "CN=%s,%s" % (obj_name, self.schema_dn) return (obj_dn, obj_name, obj_ldn) |