1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

selftest: Add prefix to new schema attributes to avoid flapping dsdb_schema_attributes

If two of these unit tests run in the same second they could
select the same name, as the name was only based on the time
and a common prefix.

As observed by Jeremy Allison.  Thanks for the report!

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14819

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Sep  6 02:32:51 UTC 2021 on sn-devel-184
This commit is contained in:
Andrew Bartlett 2021-09-06 08:52:21 +12:00 committed by Jeremy Allison
parent ae57d22e45
commit 6590bb0b77

View File

@ -87,7 +87,7 @@ systemOnly: FALSE
def test_AddIndexedAttribute(self):
# create names for an attribute to add
(attr_name, attr_ldap_name, attr_dn) = self._make_obj_names("schemaAttributes-Attr-")
(attr_name, attr_ldap_name, attr_dn) = self._make_obj_names("schemaAttributes-IdxAttr-")
ldif = self._make_attr_ldif(attr_name, attr_dn, 1,
"searchFlags: %d" % samba.dsdb.SEARCH_FLAG_ATTINDEX)
@ -111,7 +111,7 @@ systemOnly: FALSE
def test_AddUnIndexedAttribute(self):
# create names for an attribute to add
(attr_name, attr_ldap_name, attr_dn) = self._make_obj_names("schemaAttributes-Attr-")
(attr_name, attr_ldap_name, attr_dn) = self._make_obj_names("schemaAttributes-UnIdxAttr-")
ldif = self._make_attr_ldif(attr_name, attr_dn, 2)
# add the new attribute
@ -134,7 +134,7 @@ systemOnly: FALSE
def test_AddTwoIndexedAttributes(self):
# create names for an attribute to add
(attr_name, attr_ldap_name, attr_dn) = self._make_obj_names("schemaAttributes-Attr-")
(attr_name, attr_ldap_name, attr_dn) = self._make_obj_names("schemaAttributes-2IdxAttr-")
ldif = self._make_attr_ldif(attr_name, attr_dn, 3,
"searchFlags: %d" % samba.dsdb.SEARCH_FLAG_ATTINDEX)