samba.tests.dsdb is not idempotent

Andrew Bartlett abartlet at
Fri Nov 24 18:57:49 UTC 2017

On Fri, 2017-11-24 at 16:02 +0100, Andreas Schneider wrote:

> Hi Lumír,

> the attached patch cleans up the tests and creates a temporary user instead of 
> tainting the Administrator account!
> This should fix your problem.
> Could a Samba Team member please review the patch and push if OK?

The only part I don't like is the fixed password.  While fine here, I
think it is a habit we should avoid.

diff --git a/python/samba/tests/ b/python/samba/tests/
index d35f3bb..493ea25 100644
--- a/python/samba/tests/
+++ b/python/samba/tests/
@@ -45,7 +45,7 @@ class DsdbTests(TestCase):
         # Create a test user
         user_name = "samdb-testuser"
-        user_pass = "1qazXS at W"
+        user_pass = samba.generate_random_password(32, 32)
         user_description = "Test user for dsdb test"
         base_dn = self.samdb.domain_dn()

If you are OK with the amended patch, then I or you can push it.


Andrew Bartlett

Andrew Bartlett             
Authentication Developer, Samba Team
Samba Developer, Catalyst IT
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-python-tests-Create-a-test-user-for-the-dsdb-test.patch
Type: text/x-patch
Size: 7859 bytes
Desc: not available
URL: <>

More information about the samba-technical mailing list