summaryrefslogtreecommitdiffstats
path: root/source4/torture/smb2
Commit message (Collapse)AuthorAgeFilesLines
* torture/smb2/dir: check create time match findDavid Disseldorp2014-05-231-4/+16
| | | | | | | | | | | This adds a check to ensure that the create time returned in the SMB2 create response matches the value found in the find response. 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 May 23 22:42:24 CEST 2014 on sn-devel-104
* s4:torture/smb2: explicitly use allow_warnings=TrueStefan Metzmacher2014-04-021-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4: smbtorture: Add a proper change_notify going async followed by tdis test.Jeremy Allison2014-03-121-1/+67
| | | | | | | | | | | | [Bug 10344] SessionLogoff on a signed connection with an outstanding notify request crashes smbd. https://bugzilla.samba.org/show_bug.cgi?id=10344 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Mar 12 20:12:58 CET 2014 on sn-devel-104
* s4: smbtorture: Update the torture_smb2_notify_ulogoff test to demonstrate ↵Jeremy Allison2014-03-121-6/+14
| | | | | | | | | | | | | the problem. [Bug 10344] SessionLogoff on a signed connection with an outstanding notify request crashes smbd. https://bugzilla.samba.org/show_bug.cgi?id=10344 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s4:torture/smb2: accept NT_STATUS_RANGE_NOT_LOCKED after smb2_logoff/tdisStefan Metzmacher2014-03-121-11/+13
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: add zero length FSCTL_SRV_COPYCHUNK testDavid Disseldorp2014-02-061-0/+64
| | | | | | | | | | | Windows Server 2012 returns NT_STATUS_INVALID_PARAMETER for FSCTL_SRV_COPYCHUNK requests that include a server-side copy length of zero, in line with MS-SMB2 3.3.5.15.6. We should match this behaviour, so test for it. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:torture:smb2: fix durable-open.reopen4Michael Adam2014-01-301-1/+0
| | | | | | | | | | | | We currently don't support durable handles with delete-on-close: with delete-on-close, we close a durable handle with delete-on-close set upon disconnect. This patch adapts the test to behave accordingly, i.e. don't use delete-on-close... Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:torture:smb2: add new durable-v2-open.reopen1a testMichael Adam2013-12-061-0/+110
| | | | | | | | | | | | | | | - 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
* s4:torture:smb2: add new durable-open.reopen1a testMichael Adam2013-12-061-0/+100
| | | | | | | | | | | | - 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>
* s4-torture: Make sure the handles are not used uninitialized.Andreas Schneider2013-12-061-1/+7
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* torture: test get/set compression ioctl permissionsDavid Disseldorp2013-11-221-0/+128
| | | | | | | | | | | | | 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
* torture: split open from test_setup_create_fillDavid Disseldorp2013-11-221-12/+32
| | | | | Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: attempt to set compression via SetInfoDavid Disseldorp2013-11-221-2/+101
| | | | | | | | 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>
* torture: test dir non-inherit in compress_inherit_disableDavid Disseldorp2013-11-221-8/+35
| | | | | | | | | | | 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>
* s4-torture: Relax time checking in CHECK_NTTIME.Andreas Schneider2013-11-121-1/+1
| | | | | | | | | 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>
* s4:torture:smb2: add new lease.upgrade3 test to test the contended upgradeMichael Adam2013-11-111-0/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* s4:torture:smb2: add comment explaining lease upgrade in the non-contended caseMichael Adam2013-11-111-0/+11
| | | | | | | | | | | | | | | 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>
* torture: Add smb2.rename.rename_dir_benchVolker Lendecke2013-11-041-0/+375
| | | | | | | | | 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>
* torture: add FSCTL_SRV_COPYCHUNK_WRITE access testDavid Disseldorp2013-10-251-2/+51
| | | | | | | | | | | 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
* torture: Add smb2.oplock.levelII501 testVolker Lendecke2013-10-241-1/+256
| | | | | | | | 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
* torture: Add oplock break to l2/none testsVolker Lendecke2013-10-231-0/+83
| | | | | | | | | 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>
* s4:torture: add smb2.session.reauth6 : test failing reauthMichael Adam2013-10-151-0/+103
| | | | | | | | | | | | | | | 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
* torture: Extend the smb2.oplock.doc1 testVolker Lendecke2013-10-111-6/+28
| | | | | | | 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>
* torture: Remove an unused variableVolker Lendecke2013-10-061-1/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* torture: Continue buffer check after NOT_IMPLEMENTED infolevelsVolker Lendecke2013-10-061-0/+3
| | | | | | | | | 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>
* s4:torture:smb2: add durable-v2-open.reopen2cMichael Adam2013-10-051-0/+75
| | | | | | | | | | - 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>
* s4:torture:smb2: add durable-v2-open.reopen2bMichael Adam2013-10-051-0/+91
| | | | | | | | | | - 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>
* s4:torture:smb2: add durable-v2-open.create-blobMichael Adam2013-10-051-0/+108
| | | | | | | | | | | 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>
* s4:torture:smb2: extend the durable-open.reopen2 testMichael Adam2013-10-051-18/+83
| | | | | | | | | | 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>
* s4:torture:smb2: extend the durable-v2-open.reopen2 testMichael Adam2013-10-051-4/+44
| | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s4:torture:smb2: add a durable-open.reopen-lease-v2 testMichael Adam2013-10-051-0/+238
| | | | | | | | 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>
* s4:torture:smb2: add durable-v2-open.reopen2-lease-v2Michael Adam2013-10-051-0/+245
| | | | | | | | | 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>
* s4:torture:smb2: add smb2_lease_v2_create() wrapper to ↵Michael Adam2013-10-051-0/+16
| | | | | | | | | | 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>
* s4:torture:smb2: add durable-v2-open.reopen2-leaseMichael Adam2013-10-051-0/+247
| | | | | | | | 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>
* s4:torture:smb2: add durable-open.reopen2-lease testMichael Adam2013-10-051-0/+238
| | | | | | | | 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>
* s4:torture:smb2: fix durable-open lease tests to pass against windows.Michael Adam2013-10-051-2/+8
| | | | | | | | 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>
* s4:torture:smb2: add smbcli_options argument to torture_smb2_connection_ext()Michael Adam2013-10-053-13/+46
| | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:torture:smb2: fix a comment in the durable-open.lock-oplock testMichael Adam2013-10-051-1/+1
| | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s4:torture: remove and useless variable and assignment in smb2.session.reauth5Michael Adam2013-09-211-3/+1
| | | | | | | | 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
* torture: Add buffercheck testsVolker Lendecke2013-08-291-18/+226
| | | | | | | | | | | | | 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
* torture: Split the fsinfo check into a separate testVolker Lendecke2013-08-231-2/+8
| | | | | | | | 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
* torture: Split the buffercheck into a separate testVolker Lendecke2013-08-231-2/+9
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: Change smb2.getinfo into a suiteVolker Lendecke2013-08-232-2/+11
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb2: Fix opening the rootdirectory, part 2Volker Lendecke2013-08-231-1/+1
| | | | | | | | | | | | | | | 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>
* torture: Remove an unused variableVolker Lendecke2013-08-231-3/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: support Windows 2k8 response for compress_invalid_bufDavid Disseldorp2013-08-151-4/+6
| | | | | | | | | 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>
* torture: add more [no-]compress-on-open ioctl testsDavid Disseldorp2013-08-151-1/+144
| | | | | | | | | | | | 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>
* torture: add file_attribs arg to file create helperDavid Disseldorp2013-08-151-24/+23
| | | | | | | 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>
* torture: add compressed file attribute ioctl testDavid Disseldorp2013-08-151-0/+53
| | | | | | | | 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>
* torture: check for filesystem compression capabilityDavid Disseldorp2013-08-151-18/+59
| | | | | | | | | 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>