[PATCH] samba-tool: Adding/removing none-existent users to/from groups doesn't fail

Michael Adam obnox at samba.org
Fri Oct 17 17:47:37 MDT 2014


On 2014-10-18 at 01:22 +0200, Marc Muehlfeld wrote:
> Hello Michael,
> 
> thanks for looking at my patch.
> 
> 
> Am 17.10.2014 um 12:08 schrieb Michael Adam:
> > FYI: failed autobuild twice for me
> > 
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [1656/1688 in 1h40m22s] 
> > samba4.blackbox.group.py UNEXPECTED(failure): 
> > samba4.blackbox.group.py.group addmembers(none) REASON: 
> > _StringException: _StringException: ERROR(exception): Failed to
> > add members "newuser,newuser1" to group "dsg" - Unable to find 
> > "newuser". Operation cancelled. File 
> > "bin/python/samba/netcmd/group.py", line 217, in run 
> > add_members_operation=True) File "bin/python/samba/samdb.py", line 
> > 263, in add_remove_group_members raise Exception('Unable to find 
> > "%s". Operation cancelled.' % member)
> > 
> > FAILED (1 failures, 0 errors and 0 unexpected successes in 0 
> > testsuites) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > 
> > Apparently it was premature?
> 
> 
> I haven't fully understood how the test stuff works. So please excuse,
> if the following is a stupid though or wrong. :-)
> 
> 
> I'm thinking, the test is wrong:
> 
> 
> The failed test is in source4/setup/tests/blackbox_group.sh. In this
> file, first two user accounts are created ('testuser' and 'testuser1'):
> 
> testit "user add" $samba_tool user create $CONFIG --given-name="User"
> --surname="Tester" --initial="UT" testuser testp at ssw0Rd
> testit "user add" $samba_tool user create $CONFIG --given-name="User1"
> --surname="Tester" --initial="UT" testuser1 testp at ssw0Rd
> 
> 
> Then later the users 'newuser' and 'newuser' should be added to
> different groups:
> testit "group addmembers" $samba_tool group addmembers $CONFIG dsg
> newuser,newuser1
> ...
> 
> 
> 
> Do I understand this test right, when I think, that it creates
> accounts and then tries to add (other) non existend accounts to the
> groups? In that case, my enhancement did what it should - it prints an
> error and quit. :-)

Your analysis seems perfectly correct: your improvement has
uncovered an error in the test. The names were apparently
intended to be the same (creating and adding).

> Is this correct? Then I would try to fix the test.

Yeah, please!

Cheers - Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20141018/a7976920/attachment.pgp>


More information about the samba-technical mailing list