fixed the updateNow schema test to use a canonical OID
authorAndrew Tridgell <tridge@samba.org>
Mon, 17 Aug 2009 01:12:10 +0000 (11:12 +1000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 17 Aug 2009 01:14:07 +0000 (11:14 +1000)
The expression time.strftime("%s", time.gmtime())[3:] leads to a
string with a leading 0. When added then read back from the prefix map
this leads to a different string, so it is never found.

Use the simpler str(random.randint(a,b)) expression instead

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

index 24c6226ce44161c557b97a606215ff5074125672..af3ad1c2aed5816e2fff1d6e4fc424094b2fedb7 100755 (executable)
@@ -6,6 +6,7 @@ import getopt
 import optparse
 import sys
 import time
+import random
 
 sys.path.append("bin/python")
 sys.path.append("../lib/subunit/python")
@@ -1167,7 +1168,7 @@ cn: """ + class_name + """
 objectCategory: CN=Class-Schema,""" + self.schema_dn + """
 defaultObjectCategory: CN=%s,%s""" % (class_name, self.schema_dn) + """
 distinguishedName: CN=%s,%s""" % (class_name, self.schema_dn) + """
-governsID: 1.2.840.""" + time.strftime("%s", time.gmtime())[3:] + """.1.5.9939
+governsID: 1.2.840.""" + str(random.randint(1,100000)) + """.1.5.9939
 instanceType: 4
 name: """ + class_name + """
 objectClassCategory: 1