s4/dsdb/pytest/ldap_schema: remove duplicate test
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Thu, 11 Oct 2018 04:00:46 +0000 (17:00 +1300)
committerNoel Power <npower@samba.org>
Thu, 25 Oct 2018 19:45:59 +0000 (21:45 +0200)
The tests differ in two lines, thus:

     def test_subClassOf(self):
     -        """ Testing usage of custom child schamaClass
     +        """ Testing usage of custom child classSchema

[...]

   -governsId: 1.3.6.1.4.1.7165.4.6.2.6.3.""" + str(random.randint(1, 100000)) + """
   +governsId: 1.3.6.1.4.1.7165.4.6.2.6.7.""" + str(random.randint(1, 100000)) + """

with the governsId OID changed because it was noticed they were colliding.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
source4/dsdb/tests/python/ldap_schema.py

index d2465f7ae0ed5fca72dc56eab0f886c568de8bd6..6153852a59fd687587a9c6d9f06f071185bf9dba 100755 (executable)
@@ -1265,64 +1265,6 @@ governsId: """ + governsID + """.1
             (enum, estr) = e24.args
             self.assertEquals(enum, ERR_CONSTRAINT_VIOLATION)
 
-    def test_subClassOf(self):
-        """ Testing usage of custom child classSchema
-        """
-
-        class_name = "my-Class" + time.strftime("%s", time.gmtime())
-        class_ldap_display_name = class_name.replace("-", "")
-
-        ldif = """
-dn: CN=%s,%s""" % (class_name, self.schema_dn) + """
-objectClass: top
-objectClass: classSchema
-adminDescription: """ + class_name + """
-adminDisplayName: """ + class_name + """
-cn: """ + class_name + """
-governsId: 1.3.6.1.4.1.7165.4.6.2.6.7.""" + str(random.randint(1, 100000)) + """
-instanceType: 4
-objectClassCategory: 1
-subClassOf: organizationalUnit
-systemFlags: 16
-systemOnly: FALSE
-"""
-        self.ldb.add_ldif(ldif)
-
-        # Search for created objectclass
-        res = []
-        res = self.ldb.search("cn=%s,%s" % (class_name, self.schema_dn), scope=SCOPE_BASE,
-                              attrs=["lDAPDisplayName", "defaultObjectCategory",
-                                     "schemaIDGUID", "distinguishedName"])
-        self.assertEquals(len(res), 1)
-        self.assertEquals(res[0]["lDAPDisplayName"][0], class_ldap_display_name)
-        self.assertEquals(res[0]["defaultObjectCategory"][0], res[0]["distinguishedName"][0])
-        self.assertTrue("schemaIDGUID" in res[0])
-
-        ldif = """
-dn:
-changetype: modify
-add: schemaUpdateNow
-schemaUpdateNow: 1
-"""
-        self.ldb.modify_ldif(ldif)
-
-        object_name = "org" + time.strftime("%s", time.gmtime())
-
-        ldif = """
-dn: OU=%s,%s""" % (object_name, self.base_dn) + """
-objectClass: """ + class_ldap_display_name + """
-ou: """ + object_name + """
-instanceType: 4
-"""
-        self.ldb.add_ldif(ldif)
-
-        # Search for created object
-        res = []
-        res = self.ldb.search("ou=%s,%s" % (object_name, self.base_dn), scope=SCOPE_BASE, attrs=["dn"])
-        self.assertEquals(len(res), 1)
-        # Delete the object
-        delete_force(self.ldb, "ou=%s,%s" % (object_name, self.base_dn))
-
 
 class SchemaTests_msDS_IntId(samba.tests.TestCase):