summaryrefslogtreecommitdiff
path: root/source3/selftest
Commit message (Collapse)AuthorAgeFilesLines
* s4: torture Add a test for smbc_readdirplus2()Jeremy Allison2019-10-301-1/+2
| | | | | | Signed-off-by: Puran Chand <pchand@vmware.com> Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* dbwrap_watch: Test cleanup of dead watchersVolker Lendecke2019-10-181-0/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* selftest: s3: add a test for spnego downgrade from krb5 to ntlmIsaac Boukris2019-10-121-0/+4
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14106 Signed-off-by: Isaac Boukris <iboukris@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3: torture: Add MS-FSA style terminating '/' and '\\' test - SMB2-PATH-SLASH.Jeremy Allison2019-10-021-0/+1
| | | | | | | | | | | [MS-FSA] 2.1.5.1 Server Requests an Open of a File. Checks how to behave on both files and directories. Tested against Windows 10 server - passes. Currently smbd fails this. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* torture3: Remove cleanup3Volker Lendecke2019-09-171-4/+0
| | | | | | | This goes directly into the database, for which the format changes Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:torture: add a file-id related testRalph Boehme2019-09-101-0/+2
| | | | | | | | | | Note I'm using the share vfs_fruit_xattr because I need a share with both a streams and a acl_* VFS object. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14121 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:selftest: add delay_inject:brl_lock_windows testingStefan Metzmacher2019-09-091-0/+4
| | | | | | | | | | 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> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Mon Sep 9 15:42:45 UTC 2019 on sn-devel-184
* s4:torture/smb2: add smb2.samba3misc.localposixlock1Stefan Metzmacher2019-09-091-1/+1
| | | | | | | | | | This demonstrates that the SMB2 code path doesn't do any retry for local posix locks. 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>
* s3:torture: convert LOCK9 into LOCK9A and LOCK9BStefan Metzmacher2019-09-091-1/+2
| | | | | | | | | | | | | 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>
* s3/4: libsmbclient test. Test using smbc_telldir/smbc_lseekdir with ↵Jeremy Allison2019-09-031-1/+2
| | | | | | | | | | | | | | | | | smbc_readdir/smbc_readdirplus/smbc_getdents. Ensure that for file access you can mix any of these three access methods for directory entries and the returned names/structs stay in sync across telldir/seekdir changes. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14094 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): Tue Sep 3 17:31:29 UTC 2019 on sn-devel-184
* torture: beginning of a mdssvc RPC service test-suiteRalph Boehme2019-08-081-0/+3
| | | | | | | Yikes! Most tests fail atm. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: SMB1 unlink needs delay for a stream's SHARING_VIOLATIONVolker Lendecke2019-08-081-0/+1
| | | | | | | | | | Survives against W2k12R2 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 8 01:05:38 UTC 2019 on sn-devel-184
* torture3: Add oplock5 kernel-oplock testVolker Lendecke2019-07-301-0/+13
| | | | | | | | | Show that the current smb1 server does not properly retry a nonblocking open of a kernel-oplocked file Bug: https://bugzilla.samba.org/show_bug.cgi?id=14060 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* selftest: Start implementing unit test for nfs4_aclsChristof Schmitt2019-07-231-0/+4
| | | | | | | | | | | | | | | Existing smbtorture tests set and query ACLs through SMB, only working with the DACLs in the Security Descriptors, but never check the NFSv4 ACL representation. This patch introduces a unit test to verify the mapping between between Security Descriptors and NFSv4 ACLs. As the mapping code queries id mappings, the id mapping cache is first primed with the mappings used by the tests and those mappings are removed again during teardown. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14032 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s4/torture: add a vfs_fruit unconversion testRalph Boehme2019-07-121-0/+10
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:tests: Add test for manual smbtorture zero-dataChristof Schmitt2019-07-051-0/+3
| | | | | | | | | | Ensure that these tests keep working. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Jul 5 05:02:12 UTC 2019 on sn-devel-184
* selftest: add a test that itime is not set when setting DOS attrsRalph Boehme2019-07-011-0/+2
| | | | | | | | 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): Mon Jul 1 23:21:07 UTC 2019 on sn-devel-184
* vfs_fruit: make "fruit:zero_file_id" a per share optionRalph Boehme2019-07-011-1/+1
| | | | | | | | Now that File-ID calculation goes through the VFS, we can nicely make a per-share option out of it. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: torture: Ensure we can always get a POSIX ACL on a directory handle.Jeremy Allison2019-06-261-0/+1
| | | | | | | | 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/+1
| | | | | | | | | | | | 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
* torture3: Test cancelling locking&x with ntcancelVolker Lendecke2019-06-201-0/+1
| | | | | 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/+1
| | | | | | | | | | | 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-1/+3
| | | | | 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/+1
| | | | | | | 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/+1
| | | | | | | | 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>
* tests: add a test for guest authenticationRalph Boehme2019-06-051-0/+5
| | | | | | | | | | | | | | This verifies that smbd always adds BUILTIN\Guests to the guest token which is required for guest authentication. Currently the guest token depends on the on-disk configured group mappings. If there's an existing group mapping for BUILTIN\Guests, but LOCALSAM\Guest is not a member, the final guest token won't contain BUILTIN\Guests. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13944 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Run samba3.srvsvc tests covering more of the srvsvc serverAndrew Bartlett2019-05-241-1/+4
| | | | | | | | | | Found by LCOV. Some of the failures should be fixed by setting "restrict anonymous = 2" as requested by bug 12775 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* selftest: Add more testing of wkssvc in source3Andrew Bartlett2019-05-241-1/+3
| | | | | | | | The samba3.wkssvc test is not as comprehensive, but rpc.wkssvc needs to run against the ad_member environment to get past a builtin administrators check. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* Run test for initshutdownAndrew Bartlett2019-05-241-1/+2
| | | | | | | | | The test already existed but was not run. Found by LCOV Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* selftest: run vfs.fruit test against a share that deletes empty resource forksRalph Boehme2019-05-231-0/+1
| | | | | | | | | | | | | | | This reveals a bug in the AppleDouble conversion code: the conversion code that unlinks an empty resource fork AppleDouble sidecar file ("._file") gets triggered as part of open_file_ntcreate(..., "file:AFP_AfpResource", ...): after SMB_VFS_OPEN() has been called with O_CREAT, what created the file, we call SMB_VFS_FSTAT() on the just created filehandle. This ends up in ad_convert(), finds the resource fork empty and thus deletes the file. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13958 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: net: Test of fuzzer problems with net rpc registry import.Jeremy Allison2019-05-151-0/+1
| | | | | | | | | | | | Found by Michael Hanselmann using fuzzing tools BUG: https://bugzilla.samba.org/show_bug.cgi?id=13842 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed May 15 23:08:58 UTC 2019 on sn-devel-184
* s3/lib: add a tevent_glib_glue subsystem testRalph Boehme2019-04-241-0/+3
| | | | | | | Tests adapted from glib2 glib/tests/mainloop.c. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* selftest: Pass trusted domain information to idmap_ad testChristof Schmitt2019-04-241-1/+1
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13903 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:tests: Add test for smbstatus and smbstatus --resolve_uidsAndreas Schneider2019-03-271-1/+5
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13793 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Mar 27 14:33:35 UTC 2019 on sn-devel-144
* selftest: test vfs_nfs4acl_xattr in nfs modeRalph Boehme2019-03-181-0/+2
| | | | | | | | The same tests as for the other modes xdr and ndr are marked as knownfail. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: Add tests for idmap cacheVolker Lendecke2019-02-281-0/+1
| | | | | | 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
* s3: smbtorture3: Add POSIX-MKDIR test for posix_mkdir case sensitive bug.Jeremy Allison2019-02-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
* s3: tests: Add regression test for smbd crash on share force group change ↵Jeremy Allison2019-01-251-0/+4
| | | | | | | | | | | with existing connection. Mark as known fail for now. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13690 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* libcli/dns: Add resolv.conf parsingVolker Lendecke2019-01-151-0/+4
| | | | | | | | | | | Right now this only looks at the nameserver setting. It is initally made for asynchronous AD DC lookup routines, where we don't need the "search", "domain" and other settings. When we convert general "net", "smbclient" and others to use this, we might either add "domain" handling to this code or look at something like c-ares which already does it. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* selftest: Test sids-to-xids with one failing sidVolker Lendecke2019-01-081-0/+5
| | | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Volker Lendecke <vl@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* tests/ntlm_auth: Port ntlm_auth_krb5 tests to pythonSamuel Cabrero2018-12-191-5/+0
| | | | | | | | Port ntlm_auth_krb5 bash script tests to python Signed-off-by: Samuel Cabrero <scabrero@suse.de> Reviewed-by: Noel Power <npower@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:torture/smb2/session: Fix expire testsJustin Stephenson2018-12-121-1/+3
| | | | | | | | | | | | | | | | | | | | When run with MIT kerberos, the smb2 session expire tests fail when run against the ad_member test environment. The krb5 library initializes values from the private krb5.conf profile st/ad_member/lockdir/smb_krb5/krb5.conf.ADDOMAIN, this file does not contain a defined clockskew setting. The expire tests require a low clockskew value that is set in st/ad_member/lib/krb5.conf. This patch disables the creation of the private krb5.conf for the ad_member_idmap_rid testenv, and runs the smb2.session tests against ad_member_idmap_rid instead of ad_member. Signed-off-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Wed Dec 12 12:51:24 CET 2018 on sn-devel-144
* s3:tests: Test for users connecting to their 'homes' shareAndreas Schneider2018-12-051-0/+1
| | | | | | | | | This adds a test for CVE-2009-2813. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13699 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* Add simple tests for net rpc share allowedusersOlly Betts2018-11-301-0/+5
| | | | | | Signed-off-by: Olly Betts <olly@survex.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* New testcase samba3.blackbox.net_rpc_join_credsOlly Betts2018-11-301-0/+4
| | | | | | | | Tests that you can now use a credentials file with net. Signed-off-by: Olly Betts <olly@survex.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:script/tests: add a test for VSS write behaviourRalph Boehme2018-11-271-1/+2
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13688 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:selftest: also run smb2.session torture testsuite against ad_memberRalph Boehme2018-11-131-0/+1
| | | | | | | | | | | | | | The next commit adds a subtest to the smb2.session testsuite that requires Kerberos (ad_dc would work), but where neither SMB2 server or client must require signing (ad_dc, being an AD DC, requires signing). The ad_member environment supports Kerberos with the SMB2 server not mandating signing, that'll do. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13661 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:selftest: split "raw.session" and "smb2.session"Ralph Boehme2018-11-131-1/+6
| | | | | | | | | The next commit is going to add a testsuite to "smb2.session". Bug: https://bugzilla.samba.org/show_bug.cgi?id=13661 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* selftest: Test hide new files timeoutVolker Lendecke2018-11-091-0/+12
| | | | | | | | 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
* nsswitch:tests: Pass the envname to the scriptAndreas Schneider2018-11-081-2/+2
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>