[PATCHES] idmap_rfc2307 with test

Andrew Bartlett abartlet at samba.org
Fri Mar 1 17:35:04 MST 2013


On Sat, 2013-03-02 at 10:29 +1100, Andrew Bartlett wrote:
> On Sat, 2013-03-02 at 08:42 +1100, Andrew Bartlett wrote:
> > On Fri, 2013-03-01 at 13:48 -0700, Christof Schmitt wrote:
> > > On Fri, Mar 01, 2013 at 03:33:33PM +1100, Andrew Bartlett wrote:
> > > > On Thu, 2013-02-21 at 14:41 -0700, Christof Schmitt wrote:
> > > > > Here is an updated version of the idmap_rfc2307 module. The patches
> > > > > apply to current master. The first five patches eliminate some code
> > > > > duplication and allow the reuse of some ad and ldap code.  The last
> > > > > patch implements a testcase for the new idmap module.
> > > > 
> > > > I wanted to push this (except the LD_LIBRARY_PATH patch, which I don't
> > > > think is required, or should be better justified), but even with that I
> > > > got:
> > > 
> > > I thought, that i had to add the path to the idmap module, so that
> > > winbind can load it. But it seems that it is not required, the test
> > > also works without the LD_LIBRAR_PATH change. So this patch is not
> > > required and can be dropped.
> > 
> > Thanks.  Indeed, we load modules using dlopen() so we don't need this. 
> > 
> > > > initialize_winbindd_cache: clearing cache and re-creating with version
> > > > number 2
> > > > [1/2 in 0s] idmap.rfc2307
> > > > SAMBADOMAIN\Administrator resolved to 100000
> > > > UNEXPECTED(failure): idmap.rfc2307.test 100000 -eq
> > > > 2000000(s3member_rfc2307)
> > > > REASON: _StringException: _StringException:
> > > > SAMBADOMAIN\Domain Users resolved to 100003
> > > > UNEXPECTED(failure): idmap.rfc2307.test 100003 -eq
> > > > 2000001(s3member_rfc2307)
> > > > REASON: _StringException: _StringException:
> > > > command: /data/samba/git/samba-push/source3/../nsswitch/tests/test_idmap_rfc2307.sh $DOMAIN Administrator 2000000 "Domain Users" 2000001 ou=idmap,dc=samba,dc=example,dc=com 2>&1 | /data/samba/git/samba-push/selftest/filter-subunit --fail-on-empty --prefix="idmap.rfc2307." --suffix="(s3member_rfc2307)"
> > > > expanded
> > > > command: /data/samba/git/samba-push/source3/../nsswitch/tests/test_idmap_rfc2307.sh SAMBADOMAIN Administrator 2000000 "Domain Users" 2000001 ou=idmap,dc=samba,dc=example,dc=com 2>&1 | /data/samba/git/samba-push/selftest/filter-subunit --fail-on-empty --prefix="idmap.rfc2307." --suffix="(s3member_rfc2307)"
> > > > ERROR: Testsuite[idmap.rfc2307]
> > > > REASON: Exit code was 1
> > > > 
> > > > 
> > > > Does this pass for you, and what do you think the issue is?
> > > 
> > > Yes, this passes for me:
> > > 
> > > $ make test TESTS=idmap.rfc2307
> > > ...
> > > initialize_winbindd_cache: clearing cache and re-creating with version
> > > number 2
> > > [1/1 in 0s] idmap.rfc2307
> > > smbd child process 6677 exited with value 0
> > > nmbd child process 6673 exited with value 0
> > > winbindd child process 6674 exited with value 0
> > > samba: EOF on stdin - terminating
> > > 
> > > ALL OK (8 tests in 1 testsuites)
> > > 
> > > A summary with detailed information can be found in:
> > >   ./st/summary
> > > 'testonly' finished successfully (1m30.698s)
> > > 
> > > It almost looked like the idmap_rfc2307 module has not been loaded and
> > > the standard id mapping method returns different ids. Not sure why
> > > this would happen. I only tested this on my Laptop, i can try to find
> > > another machine to test again.
> > 
> > It looks like that would happen if I didn't run ./configure before
> > testing.  I've done that, and it looks better now. 
> > 
> > This is now in autobuild.
> 
> Some more challenges:
> 
> called with: SAMBADOMAIN Administrator 2000000 Domain Users 2000001
> ou=idmap,dc=samba,dc=example,dc=com
> UNEXPECTED(failure): idmap.rfc2307.add ldap prefix(s3member_rfc2307)
> REASON: _StringException: _StringException: ltdb: tdb(./st/dc/private/sam.ldb): tdb_open_ex: could not open file ./st/dc/private/sam.ldb: No such file or directory
> 
> Unable to open tdb './st/dc/private/sam.ldb'
> Failed to connect to './st/dc/private/sam.ldb' with backend 'tdb': Unable to open tdb './st/dc/private/sam.ldb'
> Failed to connect to ./st/dc/private/sam.ldb - Unable to open tdb './st/dc/private/sam.ldb'
> 
> The tests fail autobuild (you can run an autobuild locally
> with ./script/autobuild.py), because you assume ./st. 
> 
> 
> We want the ability to change that in the future, so you need to use
> things like the PREFIX variable to find the files, or connect to the DB
> over LDAP (this we prefer because it makes it easier to run the same
> test against a real windows DC).  (The path in autobuild is ./bin/ab to
> trip up this kind of mistake).
> 
> Can you fix that up for me, and re-submit?

Also please delete the objects added once the test is over, and delete
them before the test starts.  This will allow the test to be run
multiple times in 'make testenv' without difficulty, when debugging
issues.

Andrew Bartlett

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org




More information about the samba-technical mailing list