diff options
author | Andrew Bartlett <abartlet@samba.org> | 2023-04-06 08:54:02 +1200 |
---|---|---|
committer | Jule Anger <janger@samba.org> | 2023-04-11 15:09:10 +0000 |
commit | e9e902f7393ef4f4cb3f1cc69acde402c761c2d4 (patch) | |
tree | 41f5f268a007a8e487578b15a016821bd9d607be | |
parent | 7fe8a7d710d939c8db0f107e6fd3cf7f0da128c8 (diff) | |
download | samba-e9e902f7393ef4f4cb3f1cc69acde402c761c2d4.tar.gz |
dsdb/tests: Move SD modification on class-created objects to classSetUp
These modifications persist, so should be done at the class level,
not in the test.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15351
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
(cherry picked from commit e1c0c2066c2f29bb614e3386b796eec3cb289aea)
-rw-r--r-- | source4/dsdb/tests/python/large_ldap.py | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/source4/dsdb/tests/python/large_ldap.py b/source4/dsdb/tests/python/large_ldap.py index 0da79da6f73..ff172eecf70 100644 --- a/source4/dsdb/tests/python/large_ldap.py +++ b/source4/dsdb/tests/python/large_ldap.py @@ -146,6 +146,14 @@ class LargeLDAPTest(samba.tests.TestCase): "sAMAccountName": user_name, "jpegPhoto": b'a' * (2 * 1024 * 1024)}) + ace = "(OD;;RP;{6bc69afa-7bd9-4184-88f5-28762137eb6a};;S-1-%d)" % x + dn = ldb.Dn(cls.ldb, "cn=" + user_name + "," + str(cls.ou_dn)) + + # add an ACE that denies access to the above random attr + # for a not-existing user. This makes each SD distinct + # and so will slow SD parsing. + cls.sd_utils.dacl_add_ace(dn, ace) + @classmethod def tearDownClass(cls): # Remake the connection for tear-down (old Samba drops the socket) @@ -290,16 +298,6 @@ class LargeLDAPTest(samba.tests.TestCase): session_info=system_session(lp), lp=lp) - for x in range(200): - user_name = self.USER_NAME + format(x, "03") - ace = "(OD;;RP;{6bc69afa-7bd9-4184-88f5-28762137eb6a};;S-1-%d)" % x - dn = ldb.Dn(self.ldb, "cn=" + user_name + "," + str(self.ou_dn)) - - # add an ACE that denies access to the above random attr - # for a not-existing user. This makes each SD distinct - # and so will slow SD parsing. - self.sd_utils.dacl_add_ace(dn, ace) - # Create a large search expression that will take a long time to # evaluate. expression = f'(jpegPhoto=*X*)' * 1000 |