[PATCH] s4-drs: replmd_delete implementation

Eduardo Lima eduardoll at gmail.com
Sun Dec 20 16:06:54 MST 2009


Hi Tridge,

I installed W2K8 R2 and now I'm doing some deletion tests.

First of all, although I don't need this to test the deletion, I could not
vampire samba to the W2K8-R2's functional level? Do I need to do extra
steps? I noticed that the script to enable Recycle Bin only works on
W2K8-R2's functional level.

These are the points that I was in doubt:

When Recycle Bin is deactivated, the object is transformed into a tombstone.
Can a tombstone be reverted to a live object?

When Recycle Bin is activated and after deleting an object, is it possible
to force the object to be transformed into a Recycled Object? I would like
to do this test on Windows to see the Recycled Object and confirm the
changes that Windows does.

How can I transform the Deleted Object back into a live object? The only way
is removing the isDeleted attribute and modifying the DN by hand?

The implementation of the test case should go in
lib/ldb/tests/python/ldap.py? I suppose I'm going to use the ldb object's
delete operation, right?

How deep the test case should test? For example, the test should check if,
after the delete operation, the DN has changed to cn=oldcn\0DEL:OBJECTGUID,
if all the attributes that are marked to be preserved exists and the others
don't exist or the test just need to check if the object was moved to the
Deleted Objects partition and has the isDeleted attribute?

On Monday I'm planning to start playing with python to see how I can do the
operations with python.

Thanks!

--
Eduardo Lima
Sent from Campinas, SP, Brazil

On Thu, Dec 17, 2009 at 23:27, <tridge at samba.org> wrote:

> Hi Eduardo,
>
>  > What should I do now? Is there other steps that I could implement on the
>  > delete procedure or it's better to start a new task? Maybe create some
>  > routines to test the replmd_delete function?
>
> There is certainly plenty more to do related to handling deletions
> correctly! You are also welcome to look through the DRS todo list and
> pick something else, but if you want to continue to work on the delete
> code then I don't think you will run out of things to do soon.
>
> As you suggest, probably the most important thing for us next is a
> some test cases.
>
> Even better would be tests that also exercise the recycle bin
> capabilities of w2k8-r2. Do you have the R2 version of w2k8 to test
> against?
>
> I've just committed a script in source4/scripting/bin/enablerecyclebin
> that makes it a bit easier to enable the recycle bin on a W2K8-R2
> box. If you have w2k8-r2, then you could try the script, but remember
> to take a snapshot beforehand, so you can easily switch between
> windows with and without the recycle bin enabled (if you use
> virtualbox 3.1, then the branched snapshots makes it easy to switch
> between states like this).
>
> I think we need some python based test scripts that delete and
> un-delete objects, and check that backlinks are appropriately
> preserved, and that all of the attributes are changed
> appropriately. We'll then want to add these test scripts to our 'make
> test', once all of the changes in the drs-linked-attribs branch are
> merged into master.
>
> To develop these tests I'd suggest you first do testing manually
> (using ldbdel, ldbmodify, ldbsearch, ldbrename etc), testing against
> both windows and samba. That will hopefully give you some ideas on how
> to develop automated tests. Then you'd start to develop python scripts
> that do the actual testing.
>
> We also need to add code to do the regular scans for objects that need
> to move between the various deletion states. First off, read carefully
> through section 3.1.1.1.6 of the MS-ADTS document. That explains the
> various states that deleted objects go through, and what attributes
> control those states. We'll need a function that runs every N minutes
> (where N is configurable) which scans for deleted objects that need to
> move to the next stage. I think this should probably go in
> dsdb/kcc/deleted_states.c, although you could also argue that it
> should be a new task.
>
> The deleted_states.c code would do a subtree search under the "Deleted
> Objects" container of each partition, and look for objects that:
>
>  1) are deleted, and have passed the deleted lifetime. These need to
>  be made into recycled objects
>
>  2) are recycled and have passed the recycled lifetime. These need to
>  be tombstoned
>
>  3) are tombstoned, and have passed the tombstone lifetime. These
>  need to be removed.
>
> There are still heaps of bugs related to deletion of objects in s4,
> especially in relation to linked attributes. Andrew and I will be
> working on those over the next few days, but it would really help us
> if you could do some testing in parallel and let us know what you
> find, plus start writing some tests.
>
> Cheers, Tridge
>


More information about the samba-technical mailing list