From 6590bb0b77c641f0d4686b39c713c1405ffb64f5 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 6 Sep 2021 08:52:21 +1200 Subject: [PATCH] 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 Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Mon Sep 6 02:32:51 UTC 2021 on sn-devel-184 --- python/samba/tests/dsdb_schema_attributes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/samba/tests/dsdb_schema_attributes.py b/python/samba/tests/dsdb_schema_attributes.py index bb4603d4703..d9b538d4af4 100644 --- a/python/samba/tests/dsdb_schema_attributes.py +++ b/python/samba/tests/dsdb_schema_attributes.py @@ -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) -- 2.11.4.GIT