s4:torture:smb2: add new lease.upgrade3 test to test the contended upgrade
authorMichael Adam <obnox@samba.org>
Tue, 5 Nov 2013 17:17:58 +0000 (18:17 +0100)
committerDavid Disseldorp <ddiss@samba.org>
Mon, 11 Nov 2013 17:04:47 +0000 (18:04 +0100)
commit97bbd631d8b357e0392209052872be2f67255f29
treedcc28dc9e01cd408fa11785290cb5cc154222cdb
parent363c4ade52b36a986b2e7bd35563459d8fd49485
s4:torture:smb2: add new lease.upgrade3 test to test the contended upgrade

Test what upgrades work when there is another lease already held,
in addition to the lease to be upgraded.

 The summary of the behaviour is this:
 -------------------------------------

 If we have two leases (lease1 and lease2) on the same file,
 then attempt to upgrade lease1 results in a change if and only
 if the requested lease state:
 - is valid,
 - is strictly a superset of lease1, and
 - can held together with lease2.

 In that case, the resuling lease state of the upgraded lease1
 is the state requested in the upgrade. lease2 is not broken
 and remains unchanged.

 Note that this contrasts the case of directly opening with
 an initial requested lease state, in which case you get that
 portion of the requested state that can be shared with the
 already existing leases (or the states that they get broken to).

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Mon Nov 11 18:04:47 CET 2013 on sn-devel-104
source4/torture/smb2/lease.c