[PATCH] Port of dsdb, dsdb_dns and samdb Python modules

Andrew Bartlett abartlet at samba.org
Wed Feb 7 22:37:57 UTC 2018


On Wed, 2018-02-07 at 08:42 +0100, Andreas Schneider wrote:
> On Wednesday, 31 January 2018 08:33:44 CET Andreas Schneider via samba-
> technical wrote:
> > On Wednesday, 31 January 2018 00:31:34 CET Andrew Bartlett via
> > samba-technical
> > wrote:
> > > On Tue, 2018-01-30 at 19:35 +0100, Lumir Balhar via samba-technical
> > > 
> > > wrote:
> > > >          # Create a test user
> > > > 
> > > > -        user_name = "samdb-testuser"
> > > > +        user_name = "dsdb-user-" + str(uuid.uuid4())
> > > > 
> > > >          user_pass = samba.generate_random_password(32, 32)
> > > >          user_description = "Test user for dsdb test"
> > > 
> > > Please don't do this (at least not with a UUID).  The issue with this
> > > pattern is that Samba doesn't currently enforce length constraints but
> > > if used against windows that breaks.  (Yes, we should enforce the
> > > length constraints).
> > 
> > Ok, I've changed it to:
> > 
> > user_name = "dsdb-user-" + str(uuid.uuid4().hex[0:6])
> > 
> > to only use 6 random chars and added addCleanup() too. We should do that for
> > every test!
> 
> Ping!

I don't think :

+    def addClenaup(self):
+        delete_force(self.samdb, self.account_dn)

Does what you think it does.  (it also isn't spelt correctly)

See for example how this is done in
source4/dsdb/tests/python/password_lockout.py

     self.addCleanup(delete_force, self.ldb, userdn)

Thanks,

Andrew Bartlett   

-- 
Andrew Bartlett
https://samba.org/~abartlet/
Authentication Developer, Samba Team         https://samba.org
Samba Development and Support, Catalyst IT   
https://catalyst.net.nz/services/samba







More information about the samba-technical mailing list