s4: adding a DsdbTestCase class

Jelmer Vernooij jelmer at samba.org
Sat Nov 20 06:45:21 MST 2010


On Fri, 2010-11-19 at 21:13 +0200, Kamen Mazdrashki wrote:
> On Fri, Nov 19, 2010 at 17:48, Nadezhda Ivanova <nivanova at samba.org> wrote:
> > Hi Jelmer and team,
> > In the testsuites in dsdb/tests there is a practise currently that each test
> > suite defines its own methods, even if they are the same as the ones used in
> > other testsuites, such as delete_force, get_domain_sid and a few others. To
> > avoid this, I suggest adding a DsdbTestCase class to samba.tests that
> > contains these methods, and all the testsuites that use them to inherit it,
> > as is the case with BlackboxTestCase and others. I have added the class
> > here:
> >
> > http://gitweb.samba.org/?p=nivanova/samba.git;a=commit;h=4bf20e6948133c3a53b91da6c18bf597220082c5
> >
> As previously discussed, I am not quite sure this is the right way
> wrap up those methods.
> Wrapping helpers in a TestCase classes will lead to a multiple
> inheritance pretty soon.
> 
> What about implementing utility classes to wrap up methods?
> For instance:
> class DomainHelpers
>  + init(SamDb)
>  + get_sid
>  + set_minPwdAge
>  + dnsname
> .....
> etc
> 
> class DirectoryService
>  + init(SamDb)
>  + set_dsheuristics
>  + get_dsheuristics

> Other way may be to add those methods to SamDb class, but
> this will make it quite big and hard to read. (not to mention it is
> not good practice to have everything in just one place :)
Yeah, these seem generic enough to be on the SamDB class. Having that
class become too big would be a worry, but I think that's a separate
problem, which we will have to solve at some point in the future
anyway. 

Cheers,

Jelmer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20101120/4fd282c9/attachment.pgp>


More information about the samba-technical mailing list