s4: torture: Add a new lock test to show that the Samba SMB1 multi-lock implementatio...
authorJeremy Allison <jra@samba.org>
Mon, 7 Jul 2014 18:00:13 +0000 (11:00 -0700)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 8 Jul 2014 08:16:59 +0000 (10:16 +0200)
commitc324b9f03f85d724dfde8e85f08d5f20fa2796ac
tree557351bb59e77896ffc4fb48a2f00eeef25c38e2
parentc6baacd7f0b798692dba2af9a02fe9de67bb73f8
s4: torture: Add a new lock test to show that the Samba SMB1 multi-lock implementation is (currently) correct.

Needed as there was a proposal to re-architect
our multi-lock to dispense with lock order precedence,
which isn't how Windows does it (unfortunately,
as the new code would have been cleaner :-).
Tested against the Win2k12 SMB1 implementation.

This test is designed to show that
lock precedence on the server is based
on the order received, not on the ability
to grant. For example:

A blocked lock request containing 2 locks
will be satified before a subsequent blocked
lock request over one of the same regions,
even if that region is then unlocked. E.g.

(a) lock 100->109, 120->129 (granted)
(b) lock 100->109, 120-129 (blocks)
(c) lock 100->109          (blocks)
(d) unlock 100->109

lock (c) will not be granted as lock (b)
will take precedence.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jul  8 10:16:59 CEST 2014 on sn-devel-104
source4/torture/raw/lock.c