[PATCH] samba-tool throws error if there is an empty FSMO role

Rowland Penny repenny241155 at gmail.com
Wed May 4 19:50:08 UTC 2016


On 04/05/16 20:27, Andrew Bartlett wrote:
> On Mon, 2016-05-02 at 20:41 +0100, Rowland Penny wrote:
>
>> So Andrew, how do I write a test for something that tests itself
>> every
>> time it runs ??? and if there are errors, these errors will probably
>> have nothing to do with my code
> Exactly!  The vast majority of errors introduced into Samba,
> particularly into the python code, are not intentional nor present at
> the time that particular code was developed.
>
> I'm quite happy to trust, for the purpose of argument, that at this
> point in time, your patches are OK.
>
>> Or to put it another way, I cannot think how to write a test for
>> fsmo.py
>> that doesn't replicate how I tested it before I sent my patch and
>> there
>> is no point in doing the same test over and over again, on the off
>> chance it will develop an error.
> The purpose of automated testing is to assert that this remains the
> case!
> Additionally, in python, there is no pre-compilation.  That means that
> the only way to guard against errors, such as we have seen in demote,
> where additional arguments are added BY OTHERS to functions called, is
> to run the code, and assert at the very least successful completion.
> Ideally we also assert some meaningful output, against what we expect,
> given the environment it runs in.
> I know it feels really odd writing an assertion in much the same way as
> the code it is testing does internally - but it works, partly because
> the unintentional or helpful fix typically won't also unintentionally
> update the test to mask a breakage.
> Without continuous integration, with such a small team Samba would not
> be what it is today - we would be chasing our tail, endlessly fixing
> our own regressions.
> I hope this clarifies things,
>
> Andrew Bartlett
>

OK, I understand the why, but I will say this very loud, I HAVE NO IDEA 
HOW TO DO THIS! :-)

How do I create two DCs ? how do I provision the first and then join the 
second to the first ? Having done that, how do I then empty FSMO roles ? 
how do I then call fsmo.py ?

This is the way I manually tested fsmo.py after I altered it

Is there an 'idiots' guide to this ?

Rowland




More information about the samba-technical mailing list