python tests broken (Re: s4:samldb LDB module - "member" trigger)

Stefan (metze) Metzmacher metze at
Wed Nov 3 08:58:03 MDT 2010


> Metze mentioned this patch to me on IRC as he chases down some
> performance issues, and I wanted to comment on it.  He may make further
> comments once he finishes pinning down his issue. 
> The problem I have with the patch is that it seems very inefficient, and
> I wondered if you had considered the O() notation complexity of this
> validation.
> For every member being added, you now do a search on the entry for that
> member, rather than just let ldb_tdb complain about the duplicate
> attribute when we eventually store it.  Why is this?  If an member
> attribute gains 100 members, you now do 100 searches of the DB just to
> check that they are not already there.  The cost of that search is
> rougly proportional to the number of members already being added -
> particularly if done one at at a time, so this seems to be O(n^2). 
> And similarly, whey trying to determine if the member attribute would
> conflict with a primaryGroupID, why not first (and only once) read the
> sid of the entry, and then compare with the primaryGroupID of the
> target?
> Surely this would be faster than dereferencing the member attribute,
> only to form up a SID and compare it with our own DN?

I fixed the problem, but I can't verify my changes with make test.;a=commitdiff;h=61a818143ba777

I discovered that 21 of 30 python tests are broken, currently!
The piping through filter-subunit just ignores the errors...

This patch add the logic to let us notice the errors again.;a=commitdiff;h=4aa453ca538e77d

Most tests fail with:

[25/30 in 1m46s, 18 errors] samba4.ldap.acl.python(fl2008r2dc)
Traceback (most recent call last):
line 12, in <module>
    samba.ensure_external_module("subunit", "subunit/python")
line 319, in ensure_external_module
line 128, in <module>
    from testtools import content, content_type, ExtendedToOriginalDecorator
ImportError: No module named testtools

Jelmer can please take a look at this and fix it?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the samba-technical mailing list