summaryrefslogtreecommitdiff
path: root/source4/torture/drs/python
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamenim@samba.org>2010-12-09 04:42:13 +0200
committerKamen Mazdrashki <kamenim@samba.org>2010-12-15 00:51:19 +0100
commit13790757620827eed73a81462386d269bdfa0fa7 (patch)
tree9e598850e83ce3cbbf12bc9eb41aec741d4b85e3 /source4/torture/drs/python
parent79e1a71e5673de5d2e5bf78c7c2adbcd59bbc004 (diff)
downloadsamba-13790757620827eed73a81462386d269bdfa0fa7.tar.gz
samba-13790757620827eed73a81462386d269bdfa0fa7.tar.bz2
samba-13790757620827eed73a81462386d269bdfa0fa7.zip
s4-test/repl_schema: New test to test a classSchema with custom attribute
Create new Attribute and a Class, that has value for newly created attribute. This should check code path that searches for AttributeID_id in Schema cacheThis test. It also tests how we replicate a leaf classSchema that inherits from a new classSchema with attribute added - tests both dsdb_attribute_drsuapi_to_ldb() and _dsdb_syntax_OID_obj_drsuapi_to_ldb() syntax handler
Diffstat (limited to 'source4/torture/drs/python')
-rw-r--r--source4/torture/drs/python/repl_schema.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/source4/torture/drs/python/repl_schema.py b/source4/torture/drs/python/repl_schema.py
index 9bb12a2bb1..6e31dc8c1c 100644
--- a/source4/torture/drs/python/repl_schema.py
+++ b/source4/torture/drs/python/repl_schema.py
@@ -207,6 +207,30 @@ class DrsReplSchemaTestCase(samba.tests.TestCase):
for c_dn in c_dn_list:
self._check_object(c_dn)
+ def test_classWithCustomAttribute(self):
+ """Create new Attribute and a Class,
+ that has value for newly created attribute.
+ This should check code path that searches for
+ AttributeID_id in Schema cache"""
+ # add new attributeSchema object
+ (a_ldn, a_dn) = self._schema_new_attr(self.ldb_dc1, "attr-A")
+ # add a base classSchema class so we can use our new
+ # attribute in class definition in a sibling class
+ (c_ldn, c_dn) = self._schema_new_class(self.ldb_dc1, "cls-A",
+ {"systemMayContain": a_ldn})
+ # add new classSchema object with value for a_ldb attribute
+ (c_ldn, c_dn) = self._schema_new_class(self.ldb_dc1, "cls-B",
+ {"objectClass": ["top", "classSchema", c_ldn],
+ a_ldn: "test_classWithCustomAttribute"})
+ #(c_ldn, c_dn) = self._schema_new_class(self.ldb_dc1, "cls-B",
+ # {"systemMayContain": a_ldn,
+ # a_ldn: "test_classWithCustomAttribute"})
+ # force replication from DC1 to DC2
+ self._net_drs_replicate(DC=self.dnsname_dc2, fromDC=self.dnsname_dc1, nc_dn=self.schema_dn)
+ # check objects are replicated
+ self._check_object(c_dn)
+ self._check_object(a_dn)
+
def test_attribute(self):
"""Simple test for attributeSchema replication"""
# add new attributeSchema object