summaryrefslogtreecommitdiff
path: root/source4/torture/smb2
Commit message (Collapse)AuthorAgeFilesLines
* torture: Add test for channel sequence number handlingVolker Lendecke2018-01-141-0/+97
| | | | | | | | | | | | We run into an assert when the csn wraps Bug: https://bugzilla.samba.org/show_bug.cgi?id=13215 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Sun Jan 14 14:47:15 CET 2018 on sn-devel-144
* torture4: Fix typosVolker Lendecke2018-01-141-10/+10
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* torture: Fix CID 1426987 Incorrect expression (UNUSED_VALUE)Volker Lendecke2017-12-281-1/+1
| | | | | | | | 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): Thu Dec 28 02:22:04 CET 2017 on sn-devel-144
* s4:torture: add smb2.session.expire2 testStefan Metzmacher2017-12-211-0/+362
| | | | | | | | | | This demonstrates the interaction of NT_STATUS_NETWORK_SESSION_EXPIRED and various SMB2 opcodes. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13197 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: Fix a typoVolker Lendecke2017-12-211-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
* s4: torture: Fix race condition in test_smb2_kernel_oplocks8.Jeremy Allison2017-12-011-2/+14
| | | | | | | | | | | | | | | | | | The child process gets the kernel lease and then notifies the parent process to continue by writing a byte up a pipe. It then sets the alarm and calls pause() to wait for the parent process to contact the smbd and get it to trigger the break request using an open call. It is possible for the parent to run and trigger the break request after the child has written to the pipe, but *before* the child calls pause(). We then miss the signal notifying the child to break the lease. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13121 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* torture: Use torture_assert{,_int_equal}_goto() in smb2.kernel-oplocksAndrew Bartlett2017-11-301-8/+8
| | | | | | | This allows this test to be added as flapping. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* s4-torture: fix type of enum in various placesUri Simchoni2017-11-242-5/+5
| | | | | Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4-torture: fix file time checksUri Simchoni2017-11-221-1/+1
| | | | | | | | | NTTIME is an unsigned quantity. When comparing two of them, first calculate a signed difference, then take absolute value. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4: torture: Ensure kernel oplock test can't hang in pause().Jeremy Allison2017-11-161-0/+67
| | | | | | | | | | | | Use an alarm to break out of waiting for a signal. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13121 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Nov 16 22:27:06 CET 2017 on sn-devel-144
* s4: torture: kernel oplocks. Add smb2.kernel-oplocks.kernel_oplocks8Jeremy Allison2017-11-111-0/+236
| | | | | | | | | | | | | Test if the server blocks whilst waiting on a kernel lease held by a non-smbd process. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13121 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Sat Nov 11 20:12:26 CET 2017 on sn-devel-144
* s4: torture: kernel_oplocks. Create a regression test case for bug #13058.Jeremy Allison2017-11-101-0/+117
| | | | | | | | | | | | | | | | | It implements the following test case: 1. client of smbd-1 opens the file and sets the oplock. 2. client of smbd-2 tries to open the file. open() fails(EAGAIN) and open is deferred. 3. client of smbd-1 sends oplock break request to the client. 4. client of smbd-1 closes the file. 5. client of smbd-1 opens the file and sets the oplock. 6. client of smbd-2 calls defer_open_done(), sees that the file lease was not changed and does not reschedule open. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13058 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* s4: torture: Add smb2 FIND_and_set_DOC test case.Ralph Wuerthner2017-11-051-0/+66
| | | | | | | | | | | | | | Regression tests doing an SMB2_find followed by a set delete on close and then close on a directory. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13118 Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Sun Nov 5 12:31:12 CET 2017 on sn-devel-144
* torture: Add testcase for compound CREATE-WRITE-CLOSE requestChristof Schmitt2017-09-221-0/+73
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13047 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4-torture: move lease break handler outside the lease testsuite.Günther Deschner2017-09-194-313/+382
| | | | | | | | | | | Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Pair-Programmed-With: Jose A. Rivera <jarrpa@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Tue Sep 19 09:36:40 CEST 2017 on sn-devel-144
* s4/torture: make --unclist active with smb2 testcasesPeter Somogyi2017-08-301-0/+27
| | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12985 Signed-off-by: Peter Somogyi <psomogyi@hu.ibm.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Wed Aug 30 00:16:51 CEST 2017 on sn-devel-144
* s4/torture: add a test for rename change notification with inotify enabledRalph Boehme2017-08-262-0/+159
| | | | | | | | | | | | | This is already fixed in master by 5eccc2fd0072409f166c63e6876266f926411423~10..5eccc2fd0072409f166c63e6876266f926411423. Bug: https://bugzilla.samba.org/show_bug.cgi?id=12903 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Aug 26 05:05:08 CEST 2017 on sn-devel-144
* lib: tevent: Use system <tevent.h>, not internal header path (except in ↵Jeremy Allison2017-08-162-2/+2
| | | | | | | self-test). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s4/torture: additional tests for kernel-oplocksRalph Boehme2017-08-091-0/+185
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
* s4/torture: reproducer for kernel oplocks issue with streamsRalph Boehme2017-08-091-0/+161
| | | | | | | | | | | | | test_smb2_kernel_oplocks3() wouldn't have failed without the patches, I'm just adding it to have at least one test that tests with 2 clients. All other tests use just one client. test_smb2_kernel_oplocks4() is the reproducer. Bug: https://bugzilla.samba.org/show_bug.cgi?id=12791 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
* torture: Add sharemode tests for SMB2Christof Schmitt2017-07-263-0/+615
| | | | | | | | | | | | There are two pieces: Test access with different sharemodes through SMB and verify access, and also provide tests that can be used with file systems enforcing share modes outside of Samba. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jul 26 09:30:31 CEST 2017 on sn-devel-144
* s4/torture: test fetching a resume key twiceRalph Boehme2017-07-031-0/+63
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s4/torture: more tests for copy-chunk across sharesRalph Boehme2017-07-031-0/+166
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s4/torture: add a test for copy-chunk across sharesRalph Boehme2017-07-031-0/+85
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s4/torture: pass destination tree to test_setup_copy_chunkRalph Boehme2017-07-031-28/+30
| | | | | | | No change in behaviour, will be used in subsequent commits. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s4/torture: add a leases test with stat openRalph Boehme2017-05-281-0/+67
| | | | | | | | | | | | | | | | | | | | This test passes against Windows 2016 but currently fails against Samba for some reason. The test does the following: 1. A stat open on a file, then 2. a second open with a RWH-lease request Windows grants a RWH-lease in step 2, while Samba only grants a R-lease. Go figure... Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Ralph Boehme <slow@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Sun May 28 18:52:52 CEST 2017 on sn-devel-144
* s4/torture: test for bug 12798Ralph Boehme2017-05-281-0/+82
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12798 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Ralph Boehme <slow@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4/torture: smb2.ioctl: add copy-chunk test with stream to smb2.ioctlRalph Boehme2017-05-171-0/+150
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=12787 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* s4/torture: smb2.ioctl: add src and dst path args to test_setup_copy_chunkRalph Boehme2017-05-171-12/+50
| | | | | | | | | | Just let the caller pass in the paths, no change in behaviour. A new test in a subsequent commit will use it to pass paths to streams. Bug: https://bugzilla.samba.org/show_bug.cgi?id=12787 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* s4: torture: Remove use of local variables that are simply mirroring ↵Jeremy Allison2017-05-125-17/+13
| | | | | | | | | | popt_get_cmdline_credentials(). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri May 12 00:37:29 CEST 2017 on sn-devel-144
* s4: popt: Global replace of cmdline_credentials -> ↵Jeremy Allison2017-05-116-23/+24
| | | | | | | | | | | popt_get_cmdline_credentials(). Add one use of popt_set_cmdline_credentials(). Fix 80 column limits when cmdline_credentials changes to popt_get_cmdline_credentials(). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* torture/ioctl: expect dup_extents(dest=compressed) to passDavid Disseldorp2017-05-101-3/+8
| | | | | | | | | | The MS-FSCC spec doesn't mention anything about dup-extents against compressed files. This can't be tested against Windows, as ReFS doesn't support compression, but COW clones of compressed files work on Btrfs. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* torture/ioctl: fix dup_extents destination truncateDavid Disseldorp2017-05-101-1/+1
| | | | | | | | The dup_extents_compressed_dest test fails to correctly truncate the dup_extents destination. Fix it. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* s4: torture: Add a TALLOC_CTX * to torture_smb2_getinfo_init().Jeremy Allison2017-05-052-3/+3
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* s4: torture: Add a TALLOC_CTX * to torture_smb2_streams_init().Jeremy Allison2017-05-052-3/+3
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* s4: torture: Add a TALLOC_CTX * to torture_smb2_session_init().Jeremy Allison2017-05-052-3/+3
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* s4: torture: Add a TALLOC_CTX * to torture_smb2_scan_init().Jeremy Allison2017-05-052-3/+3
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* s4: torture: Add a TALLOC_CTX * to torture_smb2_replay_init().Jeremy Allison2017-05-052-3/+3
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* s4: torture: Add a TALLOC_CTX * to torture_smb2_rename_init().Jeremy Allison2017-05-052-3/+3
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* s4: torture: Add a TALLOC_CTX * to torture_smb2_read_init().Jeremy Allison2017-05-052-3/+3
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* s4: torture: Add a TALLOC_CTX * to torture_smb2_oplocks_init(), ↵Jeremy Allison2017-05-052-6/+6
| | | | | | | torture_smb2_kernel_oplocks_init(). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* s4: torture: Add a TALLOC_CTX * to torture_smb2_notify_disabled_init().Jeremy Allison2017-05-052-3/+5
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* s4: torture: Add a TALLOC_CTX * to torture_smb2_notify_init().Jeremy Allison2017-05-052-3/+3
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* s4: torture: Add a TALLOC_CTX * to torture_smb2_lock_init().Jeremy Allison2017-05-052-3/+3
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* s4: torture: Add a TALLOC_CTX * to torture_smb2_lease_init().Jeremy Allison2017-05-052-3/+3
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* s4: tortute: Add a TALLOC_CTX * to torture_smb2_ioctl_init().Jeremy Allison2017-05-052-3/+3
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* s4: torture: Add TALLOC_CTX * to torture_smb2_durable_v2_open_init().Jeremy Allison2017-05-052-3/+4
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* s4: torture: Add TALLOC_CTX * to ↵Jeremy Allison2017-05-052-6/+7
| | | | | | | torture_smb2_durable_open_disconnect_init(), torture_smb2_durable_open_init() Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* s4: torture: Add a TALLOC_CTX * to torture_smb2_dir_init().Jeremy Allison2017-05-052-3/+3
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* s4: torture: Add a TALLOC_CTX * to torture_smb2_doc_init().Jeremy Allison2017-05-052-3/+3
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>