s4: adding a DsdbTestCase class

Kamen Mazdrashki kamenim at samba.org
Fri Nov 19 12:13:37 MST 2010

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

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 :)

Kamen Mazdrashki

More information about the samba-technical mailing list