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

Rowland Penny repenny241155 at gmail.com
Mon May 9 18:04:44 UTC 2016


On 05/05/16 18:22, Andrew Bartlett wrote:
> On Thu, 2016-05-05 at 15:05 +0100, Rowland Penny wrote:
>> OK, so I re-read all Andrews posts, decided to try to do what he
>> said,
>> set up the testenv and see what happens with the stock fsmo.py.
>> He said:
>>
>> If you run "SELFTEST_TESTENV=fl2000dc:local make testenv"
>>
>> Then you can play in that environment.
>>
>> so I tried that and it wouldn't work, but the error message told what
>> was wrong, I wasn't in the root dir of the Samba tarball.
>>
>> Moved there and tried again:
>> SELFTEST_TESTENV=fl2000dc:local make testenv
>>
>> and got this:
>>
>> Waf: Leaving directory `/usr/src/samba/samba-4.4.3/bin'
>> 'build' finished successfully (4m12.098s)
>> ERROR: You must use --enable-selftest to enable selftest
>> Makefile:27: recipe for target 'testenv' failed
>> make: *** [testenv] Error 1
>>
>> So from this, I think I will need to do this:
>>
>> Download Samba tarball
>> Unpack tarball
>> cd into directory created
>> run './configure --enable-selftest' along with any other configure
>> options I require
>> make
>> SELFTEST_TESTENV=fl2000dc:local make testenv
>>
>> Is this correct ??
> Pretty much.  I would check out git master instead, as that is what you
> will be patching, and run ./configure.developer rather than ./configure
> --enable-selftest (due to other reported bugs I've not yet dug into,
> and we don't want to get into here), but otherwise, that is correct.
>
> Thanks!
>
> Andrew Bartlett
>

OK, I have tried, but I just don't understand how the tests are supposed 
to work, it looks like 'selftest.pl' calls various other scripts and 
runs a test script that ultimately tests something (in my case, 
fsmo.py). writing a script to actually run 'samba-tool fsmo show' should 
be fairly easy, but the bits in-between are defeating me. it doesn't 
help that whilst looking in the various 'selftest' directories, I am 
finding perl, python and bash scripts. I can understand the last two, 
but perl, well this is a foreign language to me and I don't speak any 
foreign languages :-)

Is there an idiots guide to writing Samba tests ??? The idiot being me :-D

Rowland




More information about the samba-technical mailing list