1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-30 13:18:05 +03:00
Commit Graph

479 Commits

Author SHA1 Message Date
Michael Adam
5173322007 s4:torture:smb2: add new durable-v2-open.reopen1a test
- open session1 on tcp connection conn1
- open a durable handle on a session1
- do a session reconnect on a new tcp connection conn2
- doing a durable reconnect on session1 gives
  USER_SESSION_DELETED
- doing a durable reconnect on session2 succeeds

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): Fri Dec  6 15:59:15 CET 2013 on sn-devel-104
2013-12-06 15:59:15 +01:00
Michael Adam
a46059d534 s4:torture:smb2: add new durable-open.reopen1a test
- open session1 on tcp connection conn1
- open a durable handle on a session1
- do a session reconnect on a new tcp connection conn2
- doing a durable reconnect on session1 gives
  USER_SESSION_DELETED
- doing a durable reconnect on session2 succeeds

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-12-06 14:01:34 +01:00
Andreas Schneider
13e33ab98e s4-torture: Make sure the handles are not used uninitialized.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-06 01:14:09 +01:00
David Disseldorp
cb353a34dd torture: test get/set compression ioctl permissions
Windows Server 2012[r2] exhibits some strange behaviour with regard
to handling the compression fsctls.
[READ/WRITE]_ATTR permissions are not required for the corresponding
get/set compression ioctls. WRITE_DATA is required for set compression.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Nov 22 19:57:48 CET 2013 on sn-devel-104
2013-11-22 19:57:48 +01:00
David Disseldorp
aa197c18c4 torture: split open from test_setup_create_fill
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-11-22 08:56:45 -08:00
David Disseldorp
2b435ad4b4 torture: attempt to set compression via SetInfo
Doing so should give a successful SetInfo response, however the
attribute should not be set in subsequent GetInfo / ioctl responses.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-11-22 08:56:45 -08:00
David Disseldorp
7dd05f55a8 torture: test dir non-inherit in compress_inherit_disable
Also add a note reguarding Windows 2008GM copy-chunk note:
Windows 2008GM (non-R2) fails the copy-chunk src=dest overlap test, as
it appears to use a different chunk copy algorithm to 208R2.
Takeaway advice is to avoid using copy-chunk when the source and
destination ranges overlap in the same file.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-11-22 08:56:45 -08:00
Andreas Schneider
4cf8f10500 s4-torture: Relax time checking in CHECK_NTTIME.
NTTIME has a nanosecond resolution. We should be tolerate if the system
is busy writing and reading the value. To reproduce this problem just
run the test under valgrind.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-11-12 17:33:12 +01: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
4061954990 torture: Add smb2.rename.rename_dir_bench
This is a little benchmark test excercising parallel directory renames. With
lots of open files directory renames get pretty slow against some SMB server
implementations.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-11-04 12:06:05 -08:00
David Disseldorp
68427f1e97 torture: add FSCTL_SRV_COPYCHUNK_WRITE access test
Check that FSCTL_SRV_COPYCHUNK_WRITE succeeds when the copy-chunk target
is opened with SEC_RIGHTS_FILE_WRITE only.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Oct 25 22:48:59 CEST 2013 on sn-devel-104
2013-10-25 22:48:59 +02:00
Volker Lendecke
2d51424569 torture: Add smb2.oplock.levelII501 test
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Thu Oct 24 16:15:50 CEST 2013 on sn-devel-104
2013-10-24 16:15:50 +02:00
Volker Lendecke
9d3e3a736c torture: Add oplock break to l2/none tests
The level we have to break to depends on the create disposition of the
second opener. If it's overwriting, break to none. If it's not, break
to level2.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-23 11:51:19 +02:00
Michael Adam
f50b6da7d5 s4:torture: add smb2.session.reauth6 : test failing reauth
This attempts reauth with invalid creds, hence
triggering the error path in the reauth code.
This invalidates the session and subsequente requests
on that connection fail.

https://bugzilla.samba.org/show_bug.cgi?id=10208

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Oct 15 22:50:27 CEST 2013 on sn-devel-104
2013-10-15 22:50:27 +02:00
Volker Lendecke
672c228310 torture: Extend the smb2.oplock.doc1 test
If delete_on_close is set, there is no oplock break. Check that.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-11 15:07:37 -07:00
Volker Lendecke
3a72cdb33a torture: Remove an unused variable
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-06 13:56:24 +02:00
Volker Lendecke
960bd9a584 torture: Continue buffer check after NOT_IMPLEMENTED infolevels
Patch from the SDC plugfest. Not every implementation supports every
infolevel, and we want to be able to test buffersize error behaviour
for all supported infolevels

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-06 13:56:15 +02:00
Michael Adam
7b624cf856 s4:torture:smb2: add durable-v2-open.reopen2c
- create durable with v1 request
- reconnect with v2 reconnect request
==> fails

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-05 14:04:08 +02:00
Michael Adam
ba05f705a1 s4:torture:smb2: add durable-v2-open.reopen2b
- connect with durable v2
- reconnect with durable v1
=> succeeds

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-05 14:04:08 +02:00
Michael Adam
0ecfe1755e s4:torture:smb2: add durable-v2-open.create-blob
test various combinations of durable create and reconnect
request blobs, according to
MS-SMB2, 3.3.5.9.12:
"Handling the SMB2_CREATE_DURABLE_HANDLE_RECONNECT_V2 Create Context"

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-05 14:04:08 +02:00
Michael Adam
bd3b922a45 s4:torture:smb2: extend the durable-open.reopen2 test
Add tests for:
- filename and many other things don't matter in reconnect
- additionally specified DHnQ request blob is ignored.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-05 14:04:08 +02:00
Michael Adam
6fc5661640 s4:torture:smb2: extend the durable-v2-open.reopen2 test
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-05 14:04:08 +02:00
Michael Adam
d8cd54962b s4:torture:smb2: add a durable-open.reopen-lease-v2 test
like durable-open.reopen2-lease but with v2 lease requets

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-05 14:04:08 +02:00
Michael Adam
43c4a65f91 s4:torture:smb2: add durable-v2-open.reopen2-lease-v2
lease v2 variant of the reopen2 test.
Test various success and failure cases.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-05 14:04:08 +02:00
Michael Adam
5647287a42 s4:torture:smb2: add smb2_lease_v2_create() wrapper to smb2_lease_v2_create_share()
that sets share all. similar to smb2_lease_create()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-05 14:04:08 +02:00
Michael Adam
d4f4d08d6c s4:torture:smb2: add durable-v2-open.reopen2-lease
lease v1 variant of the reopen2 test

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-05 14:04:08 +02:00
Michael Adam
1f14747094 s4:torture:smb2: add durable-open.reopen2-lease test
lease-variant of the reopen2 test

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-05 14:04:08 +02:00
Michael Adam
6c6643c364 s4:torture:smb2: fix durable-open lease tests to pass against windows.
Fix is: reconnect with same client-guid as on the first connection.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-05 14:04:07 +02:00
Michael Adam
a31ea15203 s4:torture:smb2: add smbcli_options argument to torture_smb2_connection_ext()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-05 14:04:07 +02:00
Michael Adam
14e3f4bd3b s4:torture:smb2: fix a comment in the durable-open.lock-oplock test
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-05 14:04:07 +02:00
Michael Adam
d5eb3b225c s4:torture: remove and useless variable and assignment in smb2.session.reauth5
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Sep 21 08:00:02 CEST 2013 on sn-devel-104
2013-09-21 08:00:02 +02:00
Volker Lendecke
6e3650edd3 torture: Add buffercheck tests
Make sure we get the smb2 infolevel fixed portions right

I could not find correct #defines for the infolevels

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10106
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Aug 29 01:27:11 CEST 2013 on sn-devel-104
2013-08-29 01:27:11 +02:00
Volker Lendecke
3ddb77f7d8 torture: Split the fsinfo check into a separate test
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Aug 23 20:53:12 CEST 2013 on sn-devel-104
2013-08-23 20:53:12 +02:00
Volker Lendecke
e1edffc807 torture: Split the buffercheck into a separate test
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-23 09:48:51 -07:00
Volker Lendecke
8f96d48971 torture: Change smb2.getinfo into a suite
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-23 09:48:48 -07:00
Volker Lendecke
ad8a1e2a6e libsmb2: Fix opening the rootdirectory, part 2
smb2_push_o16s16_blob is wrong for the blob.data==NULL case. It does
not do the same magic that the rest of the routine does with regards to
padding_fix.  padding_fix is wrong in its own respect, with a 0-length
blob we end up with a negative padding fix. It's wrong, but it seems
to work.

Why am I doing this? I want to make smb2.getinfo work against
w2k12. smb2_util_roothandle() always gives NT_STATUS_INVALID_PARAMETER
without this and the preceding fix.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-23 09:48:44 -07:00
Volker Lendecke
971b39bb10 torture: Remove an unused variable
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-23 09:48:37 -07:00
David Disseldorp
e0bda35cf5 torture: support Windows 2k8 response for compress_invalid_buf
Windows Server 2012 returns NT_STATUS_INVALID_USER_BUFFER, Windows
Server 2008r2 returns NT_STATUS_INVALID_PARAMETER. Don't fail the test
if either status is returned.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-15 13:40:49 -07:00
David Disseldorp
2c7c3fd2d6 torture: add more [no-]compress-on-open ioctl tests
compress_create_with_attr: Specifies the FILE_ATTRIBUTE_COMPRESSED
attribute at create time, then checks the created file.

compress_inherit_disable: Creates under a compressed directory, a file
with the NTCREATEX_OPTIONS_NO_COMPRESSION option. Then checks that the
newly created file doesn't inherit the parent compression state.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-15 13:40:45 -07:00
David Disseldorp
337a94f756 torture: add file_attribs arg to file create helper
Allows for the testing of file creation with FILE_ATTRIBUTE_COMPRESSED.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-15 13:40:41 -07:00
David Disseldorp
0ad2ca98ce torture: add compressed file attribute ioctl test
After marking a file for compression via FSCTL_SET_COMPRESSION, the
FILE_ATTRIBUTE_COMPRESSED flag should be present. Test for this.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-15 13:40:37 -07:00
David Disseldorp
e1b45869de torture: check for filesystem compression capability
Only run the compression tests if the compression capability is returned
by the server in response to an SMB2_QUERY_INFO(FS attribute info)
request.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-15 13:40:34 -07:00
David Disseldorp
f47ff9d227 torture: extend FSCTL_[GET/SET]_COMPRESSION tests
Check for inheritance of compression attributes from parent directories.
Also, test error handling for invalid requests.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-15 13:40:17 -07:00
David Disseldorp
d944841211 torture: add smb2 FSCTL_[GET/SET]_COMPRESSION test
This test simply creates a file and checks the compression state before
and after FSCTL_SET_COMPRESSION(COMPRESSION_FORMAT_DEFAULT).

The test expects the compression state to be COMPRESSION_FORMAT_LZNT1
after set, conforming to Windows Server behaviour.

If the server responds to the first FSCTL_GET_COMPRESSION request with
NT_STATUS_NOT_SUPPORTED or NT_STATUS_INVALID_DEVICE_REQUEST, then the
test is skipped. This allows it to run during selftest.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Aug  9 22:03:39 CEST 2013 on sn-devel-104
2013-08-09 22:03:38 +02:00
David Disseldorp
86c79f1ab3 torture: split out ioctl test file creation helper
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-09 11:09:46 -07:00
Andreas Schneider
bf5bc723da torture: Don't segfault in smb2.session on error.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-07-02 12:30:43 -07:00
Christian Ambach
392b01f53c s4:torture fix a build break on AIX
Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu May  9 08:05:12 CEST 2013 on sn-devel-104
2013-05-09 08:05:12 +02:00
Richard Sharpe
76bffc27a3 Tests processing an oplock break within a compound SMB2 request.
Signed-off-by: Richard Sharpe <realrichardsharpe@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Richard Sharpe <sharpe@samba.org>
Autobuild-Date(master): Tue May  7 19:45:36 CEST 2013 on sn-devel-104
2013-05-07 19:45:36 +02: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