s4:ldap_schema.py - Move generated attributes check
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Sun, 3 Jan 2010 18:43:52 +0000 (19:43 +0100)
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Tue, 5 Jan 2010 19:55:32 +0000 (20:55 +0100)
Make more clear that they're created before the "schemaUpdateNow".

source4/lib/ldb/tests/python/ldap_schema.py

index 0a31db82f7d3f43f1170e6a1a532ddb09d5eca3b..9dd9240414052bc74b41bd9ca0b0888af8be9aad 100755 (executable)
@@ -132,6 +132,13 @@ systemOnly: FALSE
 """
         self.ldb.add_ldif(ldif)
 
+        # Search for created attribute
+        res = []
+        res = self.ldb.search("cn=%s,%s" % (attr_name, self.schema_dn), scope=SCOPE_BASE, attrs=["*"])
+        self.assertEquals(len(res), 1)
+        self.assertEquals(res[0]["lDAPDisplayName"][0], attr_ldap_display_name)
+        self.assertTrue("schemaIDGUID" in res[0])
+
         class_name = "test-Class" + time.strftime("%s", time.gmtime())
         class_ldap_display_name = class_name.replace("-", "")
 
@@ -154,6 +161,14 @@ 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=["*"])
+        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
@@ -179,21 +194,6 @@ name: """ + object_name + """
 """
         self.ldb.add_ldif(ldif)
 
-        # Search for created attribute
-        res = []
-        res = self.ldb.search("cn=%s,%s" % (attr_name, self.schema_dn), scope=SCOPE_BASE, attrs=["*"])
-        self.assertEquals(len(res), 1)
-        self.assertEquals(res[0]["lDAPDisplayName"][0], attr_ldap_display_name)
-        self.assertTrue("schemaIDGUID" in res[0])
-
-        # Search for created objectclass
-        res = []
-        res = self.ldb.search("cn=%s,%s" % (class_name, self.schema_dn), scope=SCOPE_BASE, attrs=["*"])
-        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])
-
         # Search for created object
         res = []
         res = self.ldb.search("cn=%s,cn=Users,%s" % (object_name, self.base_dn), scope=SCOPE_BASE, attrs=["*"])