summaryrefslogtreecommitdiff
path: root/source3/torture
Commit message (Collapse)AuthorAgeFilesLines
* s3:torture: convert LOCK9 into LOCK9A and LOCK9BStefan Metzmacher2019-09-091-12/+26
| | | | | | | | | | | | | | LOCK9A is the original test (with a timeout of -1) and LOCK9B is the same but with timeout of 10 seconds. LOCK9B is needed to demonstrate a server bug in the next commits. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit ac28eec3e4af710feab3be3d4b25bfbe38294431)
* s3:torture: fix the timeout alarm handling on LOCK9Stefan Metzmacher2019-09-091-1/+1
| | | | | | | | | | | | | | | smbXcli_conn_disconnect(alarm_cli->conn, NT_STATUS_OK) means existing requests are not finished with an error, but instead just keep dangling arround. Pass NT_STATUS_LOCAL_DISCONNECT in order to fail the cli_lock32() call after getting SIGALARM. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit e18c8ced8e7a872deb118191595425ef6b826bfa)
* tests/ldap: Use TLDAP to check the extended DN returnGarming Sam2019-08-071-0/+155
| | | | | | | | | | | | | | | | | | | | | | | | Tests commit 9f6b87d3f6cc9930d75c1f8d38ad4f5a37da34ab To run: make test TESTS="samba3.smbtorture_s3.plain.TLDAP" Reverting the above commit makes this test fail: 'GUID format in control (no hyphens) doesn't match output tldap_search with extended dn (no val) failed: LDAP error 0 (TLDAP_SUCCESS), TEST TLDAP FAILED!' This behaviour couldn't be tested via LDB libraries because they never deal with the underlying DN string. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> BUG: https://bugzilla.samba.org/show_bug.cgi?id=14029 Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Aug 1 06:20:28 UTC 2019 on sn-devel-184 (adapted from commit 464fef34d1d047d73be347cd446b74e0f5eb2370)
* tests/tldap: Actually check the paging return codeGarming Sam2019-08-071-0/+23
| | | | | | | | | | | The test never worked correctly because the code was overlooked. It was also the case that the connection was never authenticated, and so an LDAP BIND call has now been added. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> BUG: https://bugzilla.samba.org/show_bug.cgi?id=14029 (cherry picked from commit 85a7b594c56f7729bdfa194fee9299a08f6b4785)
* s3: torture: Ensure we can always get a POSIX ACL on a directory handle.Jeremy Allison2019-06-261-0/+127
| | | | | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jun 26 19:31:28 UTC 2019 on sn-devel-184
* s3: torture: Add POSIX-ACL-OPLOCK test to check interaction of posix ACL ↵Jeremy Allison2019-06-241-0/+209
| | | | | | | | | | | | operations with an oplocked Windows handle. (Spoiler alert, it breaks the oplock :-). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Jun 24 20:05:34 UTC 2019 on sn-devel-184
* s3: torture: Fix a debug typo.Jeremy Allison2019-06-241-1/+1
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: smbd: Ensure open for security descriptor access actually opens an fd.Jeremy Allison2019-06-241-1/+21
| | | | | | | | | | Change test to check two things: 1) Open a symlink for SD read or write access should fail. 2) Request attribute open. Getsd/Setsd on this handle should fail. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* torture3: Test cancelling locking&x with ntcancelVolker Lendecke2019-06-201-0/+204
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture3: Run a blocking lock&x call with a subsequent readVolker Lendecke2019-06-201-0/+390
| | | | | | | | | | | Samba aborts the read&x after a blocked, but eventually successful locking&x call. Both Windows and source4/ntvfs do the read properly, source3/smbd does not. With later code, this will become possible much easier. Lets see if it's worth it given that we've got away with this forever. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture3: Test blocking posix locksVolker Lendecke2019-06-201-0/+281
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture3: Test LOCKINGX_CANCEL without locksVolker Lendecke2019-06-201-0/+56
| | | | | | | Tested against W2012R2 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture3: Add a test to block a locking&readVolker Lendecke2019-06-201-0/+171
| | | | | | | | Right now we fail this with smbd, we return LOCK_NOT_GRANTED instead of FILE_LOCK_CONFLICT. This will change with later commits. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:torture: Use GnuTLS MD5Andreas Schneider2019-05-211-8/+11
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3: torture: Fix return valuesRikard Falkeborn2019-05-191-5/+5
| | | | | | | | | | | | | | | | Torture tests should return true on success and false on failure. Returning -1 is the same as returning true and returning 0 is the same as returning false. Change the return values to true and false to fix the return values. Detected by the help of cppcheck. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Reviewed-by: Ralph Böhme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sun May 19 18:48:01 UTC 2019 on sn-devel-184
* torture: Add test for talloc size accounting in memcacheChristof Schmitt2019-04-061-1/+69
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13865 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): Sat Apr 6 06:08:42 UTC 2019 on sn-devel-144
* libsmb: Rename InfoType from [MS-SMB2] according to the specVolker Lendecke2019-04-011-7/+7
| | | | | | | This makes it easier to find this via internet search Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Change cli_posix_readlink to return talloc'ed targetVolker Lendecke2019-03-271-4/+4
| | | | | | | | | | | | | | | | This is a deviation from the Posix readlink function that from my point of view makes this function easier to use. In Posix, probably the assumption is that readlink is cheap, so someone under memory constraints could just start with a small buffer and incrementally increase the buffer size. For us, it's a network round-trip, and we have the luxury of [mt]alloc, which the syscall kernel interface does not have. 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): Wed Mar 27 12:31:37 UTC 2019 on sn-devel-144
* s3:torture: Improve the debug message outputAndreas Schneider2019-03-211-2/+4
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:torture: Move the init of the locking out of the loopAndreas Schneider2019-03-211-4/+5
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* utils: Use cli_hardlink instead of cli_nt_hardlinkVolker Lendecke2019-03-201-2/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Fix typos in "valid"Michael Hanselmann2019-03-201-1/+1
| | | | | | | | s/vald/valid/ Signed-off-by: Michael Hanselmann <public@hansmi.ch> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* torture3: Fix an error messageVolker Lendecke2019-03-181-1/+3
| | | | | | | We tried to open "dname", not "fname" Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Remove "struct sid_parse_ret" againVolker Lendecke2019-03-121-4/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib: Make sid_parse return the parsed lengthVolker Lendecke2019-03-121-3/+7
| | | | | | | | | Use a temporary struct as a return value to make the compiler catch all callers. If we just changed bool->ssize_t, this would just generate a warning. struct sid_parse_ret will go away in the next commit Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* torture: Add tests for idmap cacheVolker Lendecke2019-02-283-0/+127
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org> Bug: https://bugzilla.samba.org/show_bug.cgi?id=13813
* pdbtest: Use dom_sid_str_bufVolker Lendecke2019-02-271-4/+9
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: torture: Add additional POSIX mkdir tests.Jeremy Allison2019-02-251-0/+102
| | | | | | | | | | | | | | | | | Ensure that if POSIX_foo exists as a file we return the correct error code NT_STATUS_OBJECT_PATH_NOT_FOUND if we try and traverse it as a directory. Also ensure creation/deletion of POSIX_foo/foo fails for directories and files with NT_STATUS_OBJECT_PATH_NOT_FOUND if the directory POSIX_foo/ doesn't exist. knownfail is back :-). BUG: https://bugzilla.samba.org/show_bug.cgi?id=13803 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: smbtorture3: Add POSIX-MKDIR test for posix_mkdir case sensitive bug.Jeremy Allison2019-02-241-0/+103
| | | | | | | | | | | | | | | | | | | | | | Test does: mkdir POSIX_foo mkdir POSIX_Foo mkdir POSIX_foo/Foo mkdir POSIX_foo/foo mkdir POSIX_Foo/Foo mkdir POSIX_Foo/foo Which should pass a SMB1 POSIX extensions server as posix mkdir should always be case sensitive no matter what the share is set to. Mark as knownfail for now. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13803 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* torture3: Extend read3 for the "messaging target re-inits" failureVolker Lendecke2019-02-141-20/+24
| | | | | | | | | | Do ping_pong a hundred times, re-initializing the msg_ctx every time. https://bugzilla.samba.org/show_bug.cgi?id=13786 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:torture: Use C99 initializer for torture_opsAndreas Schneider2019-01-281-152/+611
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s3:torture: Use C99 initializer for cmd_set in vfstestAndreas Schneider2019-01-281-4/+9
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s3:torture: Use C99 initializer for cmd_set in cmd_vfsAndreas Schneider2019-01-281-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s3:torture: Use C99 initializer for poptOption in vfstestAndreas Schneider2019-01-281-4/+21
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s3:torture: call per_thread_cwd_check() in vfstest.c main()Stefan Metzmacher2019-01-111-0/+2
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* selftest: Remove test_ntlm_auth.py helperSamuel Cabrero2018-12-191-335/+0
| | | | | | Signed-off-by: Samuel Cabrero <scabrero@suse.de> Reviewed-by: Noel Power <npower@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* PY3: change shebang to python3 in misc dirsJoe Guo2018-12-141-1/+1
| | | | | | | | Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org> Autobuild-User(master): Noel Power <npower@samba.org> Autobuild-Date(master): Fri Dec 14 18:00:40 CET 2018 on sn-devel-144
* s3:libsmb: pass impersonation_level to cli_ntcreate_send()Stefan Metzmacher2018-12-136-9/+16
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Tim Beale <timbeale@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* torture3: Use dom_sid_str_bufVolker Lendecke2018-12-111-1/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3/torture: PY3 port samba.ntlm_authNoel Power2018-11-141-30/+29
| | | | | | | Use bytes in test rather than str Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* wbclient: Send the client process name talking to winbindAndreas Schneider2018-11-121-0/+4
| | | | | | | This is for better debugging messages. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* selftest: Test hide new files timeoutVolker Lendecke2018-11-093-0/+175
| | | | | | | | 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 Nov 9 03:49:55 CET 2018 on sn-devel-144
* gencache: Remove transaction-based tdbVolker Lendecke2018-11-061-2/+0
| | | | | | | | | | | | | | | | | | | | | At more than one large site I've seen significant problems due to gencache_stabilize. gencache_stabilize was mainly introduced to survive machine crashes with the cache still being in place. Given that most installations crash rarely and this is still a cache, this safety is overkill and causes real problems. With the recent changes to tdb, we should be safe enough to run on completely corrupted databases and properly detect errors. A further commit will introduce code that wipes the gencache.tdb if such a corruption is detected. There is one kind of corruption that we don't properly handle: Orphaned space in the database. I don't have a good idea yet how to handle this in a graceful and efficient way during normal operations, but maybe this idea pops up at some point. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:torture: Rename the test file and remove it if it existsAndreas Schneider2018-10-271-1/+4
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:torture: Don't use the same testdir twiceAndreas Schneider2018-10-271-5/+5
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Remove gencache.h from proto.hVolker Lendecke2018-10-192-0/+2
| | | | | | | | | | It's a pain to recompile the world if gencache.h changes Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Oct 19 18:52:50 CEST 2018 on sn-devel-144
* lib: Move the "expired" for gencache_parse calculation into gencache.cVolker Lendecke2018-10-161-1/+3
| | | | | | | | | | Make it more robust 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): Tue Oct 16 21:20:19 CEST 2018 on sn-devel-144
* namemap_cache: Absorb the expired calculation into namemap_cache.cVolker Lendecke2018-10-161-9/+18
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: Rename server_messaging_context() to global_messaging_context()Christof Schmitt2018-09-074-5/+5
| | | | | | | | | | | This reflects that the messaging context is also used outside of the server processes. The command used for the rename: find . -name '*.[hc]' -print0 | xargs -0 sed -i 's/server_messaging_context/global_messaging_context/' Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: Rename server_event_context() to global_event_context()Christof Schmitt2018-09-072-3/+3
| | | | | | | | | | | This reflects that the event context is also used outside of the server processes. The command used for the rename: find . -name '*.[hc]' -print0 | xargs -0 sed -i 's/server_event_context/global_event_context/' Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>