1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00
Commit Graph

45 Commits

Author SHA1 Message Date
Jeremy Allison
75dff778c5 s4: smbtorture: leases - show stat opens grant leases and can be broken.
https://bugzilla.samba.org/show_bug.cgi?id=11102

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Feb 19 23:10:43 CET 2015 on sn-devel-104
2015-02-19 23:10:43 +01:00
Jeremy Allison
accb6b4fb8 s4: torture: leases. Simple lease_v2 rename test "v2_rename".
Proves that renaming files can break handle leases.

With the previous patches we now pass this.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2014-12-05 18:37:10 +01:00
Stefan Metzmacher
8c323f20dc s4:torture:smb2: let smb2.lease.[v2_]complex1 check the R->NONE breaks
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-12-04 05:45:09 +01:00
Jeremy Allison
99f9eee657 s4:torture:smb2: Add smb2.lease.v2_breaking3 test.
This verifies the epoch handling in the multi step break.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-12-04 05:45:09 +01:00
Jeremy Allison
c5b481a8d5 s4:torture:smb2: Add test that shows the client can respond to a lease break over a different connection.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-12-04 05:45:09 +01:00
Jeremy Allison
c6a5eab369 s4: torture: leases - Add test for leases and blocking locks.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Nov 27 19:08:24 CET 2014 on sn-devel-104
2014-11-27 19:08:24 +01:00
Jeremy Allison
62c6c79011 s4: smb2 : torture: Add new dynamic_share leases test.
Depends on new share "dynamic_share" being set up containing an %R
in the path= statement.

Shows we will break leases and fail to grant new ones
if we get a lease_key+client guid pair match on files
with different fileid's, as can happen on dynamic shares.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-11-27 16:45:06 +01:00
Jeremy Allison
f76c7c7404 s3: leases - torture test for timeout of responding to lease break request.
Passes against W2K12.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-11-27 16:45:06 +01:00
Stefan Metzmacher
ea25f0d32a s4:torture/smb2: smb2.lease.breaking6 test
The client is allowed to downgrade a lease to a lower value
than required.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-27 16:45:06 +01:00
Stefan Metzmacher
6494597c04 s4:torture/smb2: smb2.lease.breaking5 test
This is like breaking4, but with an initial "R" lease instead
of "RH".

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-27 16:45:06 +01:00
Stefan Metzmacher
b3a985ab66 s4:torture/smb2: smb2.lease.breaking4 test
This demonstrates that a confliciting open with NTCREATEX_DISP_OVERWRITE
isn't delayed by a "RH" lease, even if a lease is in 'breaking' mode.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-27 16:45:06 +01:00
Stefan Metzmacher
8d16a2e367 s4:torture/smb2: smb2.lease.breaking3 test
This demonstrates a race case where the client reuses a lease,
while the server already sent a break.

The open succeeds with SMB2_LEASE_FLAG_BREAK_IN_PROGRESS being set.

This is more complex that smb2.lease.breaking[1-2] as it generates breaks
from RWH => RH => R => NONE.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-27 16:45:06 +01:00
Stefan Metzmacher
5a652dbb92 s4:torture/smb2: smb2.lease.breaking2 test
This demonstrates that a conflicting open with NTCREATEX_DISP_OVERWRITE
breaks a lease to NONE.

It also shows which error codes are generated for unexpected lease break acks.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-27 16:45:06 +01:00
Stefan Metzmacher
a7a59b16a4 s4:torture/smb2: smb2.lease.breaking1 test
This demonstrates a race case where the client reuses a lease,
while the server already sent a break.

The open succeeds with SMB2_LEASE_FLAG_BREAK_IN_PROGRESS being set.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-27 16:45:06 +01:00
Stefan Metzmacher
0c239d3209 s4:torture/smb2: make it possible to skip the automatic ack of lease breaks.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-27 16:45:06 +01:00
Stefan Metzmacher
c18c84ca6c s4:torture/smb2: add smb2.lease.v2_epoch[2|3] tests
They demonstrate that the lease version (v1 or v2) is selected
by the first open. All following opens using the other version
still get the lease version of the first open.

This implies that the server has to remember the lease version
more globaly.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-27 16:45:05 +01:00
Stefan Metzmacher
45c98b8069 s4:torture/smb2: add smb2.lease.[v2_]complex1 tests
These tests verify the lease state is consistent between two connections
with the same client_guid.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-27 16:45:05 +01:00
Stefan Metzmacher
90c886e965 s4:torture/smb2: pass the expected flags to CHECK_LEASE()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-27 16:45:05 +01:00
Stefan Metzmacher
a9d46264ab s4:torture/smb2: don't check the lease break connection against samba3
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-27 16:45:05 +01:00
Stefan Metzmacher
c0f2b46d69 s4:torture/smb2: always verify the v2 lease epoch.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-27 16:45:05 +01:00
Stefan Metzmacher
8fa2fb7dde s4:torture/smb2: verify lease_flags in CHECK_LEASE_BREAK()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-27 16:45:05 +01:00
Stefan Metzmacher
2742257be6 s4:torture/smb2: lease per test fnames
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-27 16:45:05 +01:00
Stefan Metzmacher
34926bd4bd s4:torture/smb2: make lease tests more reliable by calling torture_wait_for_lease_break()
They now work against w2k8r2, w2012, w2012r2.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-27 16:45:05 +01:00
Stefan Metzmacher
683b956948 s4:torture/smb2: skip lease tests if the server doesn't support them
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-27 16:45:05 +01:00
Volker Lendecke
21d09dc7b8 torture4: Add trivial epoch test
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Jul  7 18:36:37 CEST 2014 on sn-devel-104
2014-07-07 18:36:37 +02:00
Volker Lendecke
8b9f96e83b torture4: Add smb2.lease.nobreakself
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-07-07 16:08:12 +02:00
Volker Lendecke
b597d47241 torture4: Add a test to break a handle twice
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-07-07 16:08:12 +02:00
Volker Lendecke
296739d655 torture4: Make sure we copy the parent_lease_key
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-07-07 16:08:12 +02:00
Michael Adam
97bbd631d8 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
2013-11-11 18:04:47 +01:00
Michael Adam
363c4ade52 s4:torture:smb2: add comment explaining lease upgrade in the non-contended case
The summary of the behaviour is this:
-------------------------------------
An uncontended lease upgrade results in a change
if and only if the requested lease state is
- valid, and
- strictly a superset of the lease state already held.

In that case the resulting lease state is the one
requested in the upgrade.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-11-11 16:09:38 +01:00
Volker Lendecke
b7765fe63f torture: Only test leases if supported
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>

Autobuild-User(master): Richard Sharpe <sharpe@samba.org>
Autobuild-Date(master): Sat Apr 27 18:09:37 CEST 2013 on sn-devel-104
2013-04-27 18:09:36 +02:00
Stefan Metzmacher
d496ccdb90 s4:torture/smb2: add v2 lease requests
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2013-04-18 15:11:48 +02:00
Michael Adam
4746edc55d s4:torture:smb2: move the smb2_create_*() utility functions from lease.c to util.c for re-use 2011-11-09 01:02:08 +01:00
Michael Adam
3078c27be1 s4:torture:smb2: lease: oplock_level is uint8_t, not uint32_t or int 2011-11-09 01:02:08 +01:00
Michael Adam
7f1920801b s4:torture:smb2: move oplock() from lease.c to smb2_util_oplock_level() in util.c for re-use 2011-11-09 01:02:08 +01:00
Michael Adam
4ea5ac04b2 s4:torture:smb2: use common smb2_util_lease_state() in the lease tests 2011-11-09 01:02:08 +01:00
Michael Adam
9fe4709a4b s4:torture:smb2: fix illegal write/uninitialized data bug in the lease.multibreak test 2011-11-09 01:02:08 +01:00
Michael Adam
b76bd39b6f s4:torture:smb2: lease.update2: some more reasonable struct names and a comment 2011-11-09 01:02:08 +01:00
Michael Adam
06f4672d23 s4:torture:smb2: add a new durable-open.upgrade2 test to test all upgrade combinations
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Tue Nov  1 04:58:03 CET 2011 on sn-devel-104
2011-11-01 04:58:03 +01:00
Michael Adam
de967f22fc s4:torture: test also break semantics between batch-oplocks and leases
This must have been a typo (listing EXCLUSIVE twice).
But BATCH and EXCLUSIVE oplocks apparently share the
same break semantics with respect to leases.
2011-10-30 18:41:20 +01:00
Jelmer Vernooij
35fbc7bbda s4-smbtorture: Make test names lowercase and dot-separated.
This is consistent with the test names used by selftest, should
make the names less confusing and easier to integrate with other tools.

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Dec 11 04:16:13 CET 2010 on sn-devel-104
2010-12-11 04:16:13 +01:00
Björn Jacke
2b254c814b s3/s4: merge msleep and smb_msleep
the merged variant is renamed to smb_msleep as some platforms already have a
msleep function.
2010-09-16 21:38:20 +02:00
Andrew Tridgell
84d0047377 s4-torture: ran minimal_includes.pl over source4/torture
This reduces compile time somewhat.
2009-10-20 16:04:46 +11:00
Zach Loafman
91e75ea8f6 s4:torture/smb2: Add torture tests for lease breaks, durable opens. 2009-04-01 08:30:25 -07:00
Zach Loafman
12a8ed07b4 s4:torture/smb2: Add torture tests for leases. 2009-03-28 01:01:47 -07:00