diff options
| author | Joseph Sutton <josephsutton@catalyst.net.nz> | 2022-08-25 20:21:01 +1200 |
|---|---|---|
| committer | Ralph Boehme <slow@samba.org> | 2022-08-25 13:55:47 +0000 |
| commit | f99fb9aa120c5a7d499bff717b812d81ddd7e9f1 (patch) | |
| tree | 5ed1e1a046d85deb4948cf5a5babf9c94ff5bc8f /python | |
| parent | 672ec6135f9ae3d7b5439523a4f456c19fb03a88 (diff) | |
| download | samba-f99fb9aa120c5a7d499bff717b812d81ddd7e9f1.tar.gz samba-f99fb9aa120c5a7d499bff717b812d81ddd7e9f1.tar.bz2 samba-f99fb9aa120c5a7d499bff717b812d81ddd7e9f1.zip | |
python:tests: Allocate OID range for testing to avoid collisions
sid_strings.py used the same OID range as ldap_schema.py, which
occasionally led to test failures when the same OID was generated twice.
Using a different range, and making use of the expected RID if we have
it, should reduce the likelihood of collisions.
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Aug 25 13:55:47 UTC 2022 on sn-devel-184
Diffstat (limited to 'python')
| -rw-r--r-- | python/samba/tests/sid_strings.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/python/samba/tests/sid_strings.py b/python/samba/tests/sid_strings.py index ece35c12bfc..71b7756d235 100644 --- a/python/samba/tests/sid_strings.py +++ b/python/samba/tests/sid_strings.py @@ -88,11 +88,17 @@ class SidStringTests(TestCase): class_dn = f'CN={class_name},{self.schema_dn}' + governs_id = f'1.3.6.1.4.1.7165.4.6.2.9.{random_suffix}' + if expected_sid is not None: + # Append the RID to our OID to ensure more uniqueness. + rid = expected_sid.rsplit('-', 1)[1] + governs_id += f'.{rid}' + ldif = f''' dn: {class_dn} objectClass: classSchema cn: {class_name} -governsId: 1.3.6.1.4.1.7165.4.6.2.6.3.{random_suffix} +governsId: {governs_id} subClassOf: top possSuperiors: domainDNS defaultSecurityDescriptor: O:{code} |
