adminDescription: """ + attr_name + """
adminDisplayName: """ + attr_name + """
cn: """ + attr_name + """
-attributeId: 1.2.840.""" + str(random.randint(1,100000)) + """.1.5.9940
+attributeId: 1.3.6.1.4.1.7165.4.6.1.""" + str(random.randint(1,100000)) + """
attributeSyntax: 2.5.5.12
omSyntax: 64
instanceType: 4
adminDescription: """ + class_name + """
adminDisplayName: """ + class_name + """
cn: """ + class_name + """
-governsId: 1.2.840.""" + str(random.randint(1,100000)) + """.1.5.9939
+governsId: 1.3.6.1.4.1.7165.4.6.2.""" + str(random.randint(1,100000)) + """
instanceType: 4
objectClassCategory: 1
subClassOf: organizationalPerson
adminDescription: """ + class_name + """
adminDisplayName: """ + class_name + """
cn: """ + class_name + """
-governsId: 1.2.840.""" + str(random.randint(1,100000)) + """.1.5.9939
+governsId: 1.3.6.1.4.1.7165.4.6.2.""" + str(random.randint(1,100000)) + """
instanceType: 4
objectClassCategory: 1
subClassOf: organizationalPerson
adminDescription: """ + class_name + """
adminDisplayName: """ + class_name + """
cn: """ + class_name + """
-governsId: 1.2.840.""" + str(random.randint(1,100000)) + """.1.5.9939
+governsId: 1.3.6.1.4.1.7165.4.6.2.""" + str(random.randint(1,100000)) + """
instanceType: 4
objectClassCategory: 1
subClassOf: organizationalUnit
adminDescription: """ + attr_name + """
adminDisplayName: """ + attr_name + """
cn: """ + attr_name + """
-attributeId: 1.2.840.""" + str(random.randint(1,100000)) + """.1.5.9940
+attributeId: 1.3.6.1.4.1.7165.4.6.1.""" + str(random.randint(1,100000)) + """
attributeSyntax: 2.5.5.12
omSyntax: 64
instanceType: 4
adminDescription: """ + class_name + """
adminDisplayName: """ + class_name + """
cn: """ + class_name + """
-governsId: 1.2.840.""" + str(random.randint(1,100000)) + """.1.5.9939
+governsId: 1.3.6.1.4.1.7165.4.6.2.""" + str(random.randint(1,100000)) + """
instanceType: 4
objectClassCategory: 1
subClassOf: organizationalPerson
objectClass: top
objectClass: attributeSchema
cn: """ + attr_name + """
-attributeId: 1.2.840.""" + str(random.randint(1,100000)) + """.1.5.9940
+attributeId: 1.3.6.1.4.1.7165.4.6.1.1.""" + str(random.randint(1,100000)) + """
attributeSyntax: 2.5.5.14
omSyntax: 127
omObjectClass: \x2A\x86\x48\x86\xF7\x14\x01\x01\x01\x0C
adminDescription: """ + class_name + """
adminDisplayName: """ + class_name + """
cn: """ + class_name + """
-governsId: 1.2.840.""" + str(random.randint(1,100000)) + """.1.5.9939
+governsId: 1.3.6.1.4.1.7165.4.6.2.1.""" + str(random.randint(1,100000)) + """
schemaIdGuid: """ + str(uuid.uuid4()) + """
objectClassCategory: 1
subClassOf: organizationalPerson
objectClass: top
objectClass: attributeSchema
cn: """ + attr_name + """
-attributeId: 1.2.840.""" + str(random.randint(1,100000)) + """.1.5.9940
+attributeId: 1.3.6.1.4.1.7165.4.6.1.2.""" + str(random.randint(1,100000)) + """
attributeSyntax: 2.5.5.7
omSyntax: 127
omObjectClass: \x2A\x86\x48\x86\xF7\x14\x01\x01\x01\x0B
adminDescription: """ + class_name + """
adminDisplayName: """ + class_name + """
cn: """ + class_name + """
-governsId: 1.2.840.""" + str(random.randint(1,100000)) + """.1.5.9939
+governsId: 1.3.6.1.4.1.7165.4.6.2.2.""" + str(random.randint(1,100000)) + """
schemaIdGuid: """ + str(uuid.uuid4()) + """
objectClassCategory: 1
subClassOf: organizationalPerson
obj_dn = "CN=%s,%s" % (obj_name, self.schema_dn)
return (obj_dn, obj_name, obj_ldn)
- def _schema_new_class(self, ldb_ctx, base_name, attrs=None):
+ def _schema_new_class(self, ldb_ctx, base_name, base_int, attrs=None):
(class_dn, class_name, class_ldn) = self._make_obj_names(base_name)
rec = {"dn": class_dn,
"objectClass": ["top", "classSchema"],
"cn": class_name,
"lDAPDisplayName": class_ldn,
- "governsId": "1.2.840." + str(random.randint(1,100000)) + ".1.5.13",
+ "governsId": "1.3.6.1.4.1.7165.4.6.2." \
+ + str((100000 * base_int) + random.randint(1,100000)) + ".1.5.13",
"instanceType": "4",
"objectClassCategory": "1",
"subClassOf": "top",
self._ldap_schemaUpdateNow(ldb_ctx)
return (rec["lDAPDisplayName"], rec["dn"])
- def _schema_new_attr(self, ldb_ctx, base_name, attrs=None):
+ def _schema_new_attr(self, ldb_ctx, base_name, base_int, attrs=None):
(attr_dn, attr_name, attr_ldn) = self._make_obj_names(base_name)
rec = {"dn": attr_dn,
"objectClass": ["top", "attributeSchema"],
"cn": attr_name,
"lDAPDisplayName": attr_ldn,
- "attributeId": "1.2.841." + str(random.randint(1,100000)) + ".1.5.13",
+ "attributeId": "1.3.6.1.4.1.7165.4.6.1." \
+ + str((100000 * base_int) + random.randint(1,100000)) + ".1.5.13",
"attributeSyntax": "2.5.5.12",
"omSyntax": "64",
"instanceType": "4",
def test_class(self):
"""Simple test for classSchema replication"""
# add new classSchema object
- (c_ldn, c_dn) = self._schema_new_class(self.ldb_dc1, "cls-S")
+ (c_ldn, c_dn) = self._schema_new_class(self.ldb_dc1, "cls-S", 0)
# force replication from DC1 to DC2
self._net_drs_replicate(DC=self.dnsname_dc2, fromDC=self.dnsname_dc1, nc_dn=self.schema_dn)
# check object is replicated
c_ldn_last = None
for i in range(1, 6):
base_name = "cls-I-%02d" % i
- (c_ldn, c_dn) = self._schema_new_class(self.ldb_dc1, base_name)
+ (c_ldn, c_dn) = self._schema_new_class(self.ldb_dc1, base_name, i)
c_dn_list.append(c_dn)
if c_ldn_last:
# inherit from last class added
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")
+ (a_ldn, a_dn) = self._schema_new_attr(self.ldb_dc1, "attr-A", 1)
# 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",
+ (c_ldn, c_dn) = self._schema_new_class(self.ldb_dc1, "cls-A", 7,
{"systemMayContain": a_ldn,
"subClassOf": "classSchema"})
# add new classSchema object with value for a_ldb attribute
- (c_ldn, c_dn) = self._schema_new_class(self.ldb_dc1, "cls-B",
+ (c_ldn, c_dn) = self._schema_new_class(self.ldb_dc1, "cls-B", 8,
{"objectClass": ["top", "classSchema", c_ldn],
a_ldn: "test_classWithCustomAttribute"})
# force replication from DC1 to DC2
def test_attribute(self):
"""Simple test for attributeSchema replication"""
# add new attributeSchema object
- (a_ldn, a_dn) = self._schema_new_attr(self.ldb_dc1, "attr-S")
+ (a_ldn, a_dn) = self._schema_new_attr(self.ldb_dc1, "attr-S", 2)
# force replication from DC1 to DC2
self._net_drs_replicate(DC=self.dnsname_dc2, fromDC=self.dnsname_dc1, nc_dn=self.schema_dn)
# check object is replicated
and then check all objects are replicated correctly"""
# add new classSchema object
- (c_ldn, c_dn) = self._schema_new_class(self.ldb_dc1, "cls-A")
+ (c_ldn, c_dn) = self._schema_new_class(self.ldb_dc1, "cls-A", 9)
# add new attributeSchema object
- (a_ldn, a_dn) = self._schema_new_attr(self.ldb_dc1, "attr-A")
+ (a_ldn, a_dn) = self._schema_new_attr(self.ldb_dc1, "attr-A", 3)
# add attribute to the class we have
m = Message.from_dict(self.ldb_dc1,