[PATCH] s4-drs: Synchronous Implementation of generated ParentGUID - ToDo List ParentGUID fix

tridge at samba.org tridge at samba.org
Mon Nov 16 23:28:30 MST 2009


Hi Fernando,

 > > The changes in construct_parent_guid() looks mostly good. It would be
 > > a bit neater to move the code that puts a objectGUID into a message
 > > into a new helper function in dsdb/common/util.c, perhaps called
 > > dsdb_msg_add_guid().
 > >   
 > That's Ok! I'm going to do it!

great, thanks!

 > I've already tried to remove it ... it seems that ldbrename still work,
 > but I have to test it more carefully (that's why I got a little afraid
 > and didn't remove it yet in this patch ...). This bring me a little
 > doubt: Does ldbrename only changes the object's dn?

ldbrename just does a rename, which just asks for a change in the DN,
but we have quite a few modules which hook the rename call and change
something else. If you look in dsdb/samdb/ldb_modules and look for all
the modules that have a ".rename" entry in their ldb_module_ops
structure then you can see what these various hooks do.

 > I only tested it on ldbrename... Is there another way I should test
 > to ensure it really works?

At minimum you should run 'make test'. It takes quite a while
(probably 20 minutes or so), and you should check that it doesn't get
any more errors with your patch than without it.

If anything fails, then it will put the name of the failing test and
the command it ran in a file called "summary". You can run individual
tests like this:

  make test TESTS=name

where 'name' is a substring of one of the test names. That is useful
for repeatedly running a test.

It is also very common to expand the set of tests in the Samba
testsuite when you write new code. If you think that perhaps the
existing tests might not be adequate, then you can add new tests.

One common place to add new tests for the sort of code you are writing
is in lib/ldb/tests/python/ldap.py. You can run that test suite
against a windows server and compare results with what Samba gives.

You might like to add some parentguid tests in there. There are some
already (in test_parentGUID()) but feel free to add some more
tests. 

One common approach is to add tests for bugs as you find them. For
example, you could add a test in ldap.py that tests the example I gave
that did not work correctly with your first patch (the example using
'parentguid' and 'createtimestamp').

This ensures that when bugs are fixed that they don't occur again,
which is usually a good thing :-)

You should also run your code through valgrind. For example, you can
run ldbrename under valgrind to check that you haven't added any
memory errors into the objectclass module with your changes.

Cheers, Tridge


More information about the samba-technical mailing list