diff options
author | Andreas Schneider <asn@samba.org> | 2018-01-30 16:39:21 +0100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2018-02-15 00:18:28 +0100 |
commit | 298d812ca053811a56e5092fb52bffa60d007650 (patch) | |
tree | 958a24870381dcb5c6ec1de2dbcd57e1f84ede0d /python/samba/tests/dsdb.py | |
parent | ebd88eb44192a28341579e4a4515bae479e7368a (diff) | |
download | samba-298d812ca053811a56e5092fb52bffa60d007650.tar.gz |
python: Generate random test usernames
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'python/samba/tests/dsdb.py')
-rw-r--r-- | python/samba/tests/dsdb.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/python/samba/tests/dsdb.py b/python/samba/tests/dsdb.py index 5782eb3ad5a..791680b4ca5 100644 --- a/python/samba/tests/dsdb.py +++ b/python/samba/tests/dsdb.py @@ -27,6 +27,7 @@ from samba.dcerpc import drsblobs, security from samba import dsdb import ldb import samba +import uuid class DsdbTests(TestCase): @@ -41,17 +42,18 @@ class DsdbTests(TestCase): lp=self.lp) # Create a test user - user_name = "samdb-testuser" + user_name = "dsdb-user-" + str(uuid.uuid4().hex[0:6]) user_pass = samba.generate_random_password(32, 32) user_description = "Test user for dsdb test" base_dn = self.samdb.domain_dn() self.account_dn = "cn=" + user_name + ",cn=Users," + base_dn - delete_force(self.samdb, self.account_dn) self.samdb.newuser(username=user_name, password=user_pass, description=user_description) + # Cleanup (teardown) + self.addCleanup(delete_force, self.samdb, self.account_dn) def test_get_oid_from_attrid(self): oid = self.samdb.get_oid_from_attid(591614) |