[PATCH] selftest: create a temporary client env for net ads test

Michael Adam obnox at samba.org
Wed Feb 10 09:58:39 UTC 2016


On 2016-02-10 at 10:06 +0100, Andreas Schneider wrote:
> On Wednesday 10 February 2016 10:29:40 Uri Simchoni wrote:
> > On 02/10/2016 09:13 AM, Andreas Schneider wrote:
> > > On Tuesday 09 February 2016 20:40:18 Uri Simchoni wrote:
> > >> Hi,
> > >> 
> > >> <snip>
> > >> The patch creates a new temporary client env, with a random string as
> > >> host name, so that except for the AD DC which gets to see an account
> > >> added and removed, no other component of the test env is affected by the
> > >> test.
> > > 
> > > Very nice! But shouldn't we handle the hostname and setting the config in
> > > 
> > > selftest/selftest.pl
> > > 
> > >   867 »·······} elsif ($option eq "client") {
> > > 
> > > Do it in the client option or add a new option?
> > > 
> > > <snip>
> > 
> > Doing it at the client conf was nacked by abartlet b/c it taints the
> > client conf. I suppose we can add yet another conf option. Thing is, we
> > need conf per test, and I wouldn't hard-code test-specific stuff in this
> > area of the code.
> > 
> > To be more exact, we need a separate conf, and separate place for tdb's,
> > but the socket wrapper stuff can use same channels as the client option.
> > Therefore I figured we can use the client conf as a template and create
> > a new temporary conf that will not conflict with other envs or confs.
> > 
> > What do you think?
> 
> Feel free to push with my RB+
> 
> However we need to rewrite selftest some day. The current mix we have is ugly 
> and troublesome ...

It is indeed.

A few remarks:

1. Confirming Uri's point that we should not overload the
   test envs' conf to accomodate all test suites but have
   test(suite) specific conf in the envs.

2. The fact that we do not tear down test env after a testsuite
   has run is bad. It taints the envs and test run earlier have
   side effects on tests run later. E.g. look for unix.whoami
   in selftest/knownfail .

   I am currently reworking selftest to always teard down an env
   after a test suite has run and re-set it up when it is next
   needed. There was even already a switch for that but it did
   not work. Here is my current WIP:

   https://git.samba.org/?p=obnox/samba/samba-obnox.git;a=shortlog;h=refs/heads/master-selftest

   It is not fully working yet, but already let me remove three
   lines from knownfail. Will propose for review once I am
   done.

3. Jelmer had started a rewrite of the perl parts of selftest to
   python a few years ago. The files are in the tree, but afaict,
   they are not complete, and it is not used anywhere.

   Not that python is per se more clean -- one can write well
   structured and readable code in perl -- but the current perl
   code is a mess, and if people are more comfortable with
   python, that may be the better solution in the long run.
   Also possibly integrates more nicely with the subunit stuff
   and other python code.

Cheers - Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160210/8e711dac/signature.sig>


More information about the samba-technical mailing list