1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

744 Commits

Author SHA1 Message Date
Jeremy Allison
068f4a977f s3: tests: Add regression test for bug 13992.
Subtle extra test. Mark as knownfail for now.

'^ user1$' must appear MORE THAN ONCE, as it can read more than one
share. The previous test found user1, but only once as the bug only
allows reading the security descriptor for one share, and we were
unlucky that the first share security descriptor returned allows
user1 to read from it.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2021-02-02 19:54:34 +00:00
Ralph Boehme
aa1f09cda0 selftest: add a test that verifies unlink works when "force user" is set
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14617

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-01-26 02:55:28 +00:00
Ralph Boehme
32197d21da selftest: add a test for "winbind:ignore domains"
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14602

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-01-21 21:48:30 +00:00
Volker Lendecke
9fa3ce29d6 test: test site-aware DC lookup via "net lookup ldap"
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-12-11 18:29:32 +00:00
Jeremy Allison
16ffa17ee2 s3/script/tests: Ensure all remote test files are removed
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14581

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
2020-12-01 19:06:45 +00:00
Noel Power
6c7dc4959f s3/script/tests: call smbclient deltree to remove remote files
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14581

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-12-01 19:06:45 +00:00
Noel Power
363bfa4e1c s3/script/tests: Make smb_client 'die' behaviour configurable
smb_client behaviour is to die if there is an error. This is
a little heavy handed and make it impossible for example to
use smb_client to run a command that might fail (where such
a failure isn't really an error) E.G. Calling deltree and
the directory doesn't exist

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-12-01 19:06:44 +00:00
Noel Power
99ffa4a982 s3/script/tests: Remove make_path (for remote dir)
LOCALPATH is actually the local path to the share, we should
not need to create the share path (it should already exist)

Note: When we remove the tree located at LOCALPATH we keep the root
      so the share path should always be there

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-12-01 19:06:44 +00:00
Noel Power
4bb3bffa4b s3/script/tests: Fix samba3.blackbox.smbclient_tarmode cleanup
Make sure samba3.blackbox.smbclient_tarmode removes data files
not just before running the test but also after

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-12-01 19:06:44 +00:00
Noel Power
fec1f8faff s3/script: Use smbclient deltree to clean up smbclient_tarmode subdir
Replace rm -rf of local dir (that is hosted remotely)
with smbclient deltree

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-12-01 19:06:44 +00:00
Noel Power
be8dca68f8 s3/script/tests: Use tarmode share for samba3.blackbox.smbclient_tar*
After this change both samba3.blackbox.smbclient_tar &
samba3.blackbox.smbclient_tarmode now use the same dedicated share

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-12-01 19:06:44 +00:00
Noel Power
6cb0a00f4a s3/script/test: Use different testdir for samba3.blackbox.smbclient_tarmode
The other tarmode torture test samba3.blackbox.smbclient_tar now uses a share
'tarmode' which uses the same source path as samba3.blackbox.smbclient_tarmode

Avoid conflicting paths and use a new subdir (of the test share) called
'smbclient_tarmode'

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-12-01 19:06:44 +00:00
Noel Power
4f5a7f11b7 s3/script/tests: Fix 'Unrecognized option(s) passed to mkpath()' error
'keep_root' is an unrecognised option for make_path/mkpath

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-12-01 19:06:44 +00:00
Volker Lendecke
95e235172a torture: Show that recursive ls across dfs is broken
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-11-04 18:55:40 +00:00
Andreas Schneider
9bc9f8ce66 s3:script: Fix test_dfree_quota.sh
source3/script/tests/test_dfree_quota.sh: line 200: [: missing `]'

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2020-10-23 14:09:42 +00:00
Denis Karpelevich
e246976b67 s3:tests: Add tests for 'valid users'.
Extending testsuite for option 'valid/invalid users' from smb.conf.

Signed-off-by: Denis Karpelevich <dkarpele@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Oct 21 01:17:05 UTC 2020 on sn-devel-184
2020-10-21 01:17:05 +00:00
Andreas Schneider
67c437bf11 s3:tests: Improve test_force_close_share test
This fixes the test with fast disks where 20MB transfers are done in
less than a second.

This also cleans up the code to have less sleeping time!

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Oct 19 21:14:21 UTC 2020 on sn-devel-184
2020-10-19 21:14:21 +00:00
Andreas Schneider
e7577ab6cb s3:tests: Add smbclient tests for 'client smb encrypt'
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-10-09 19:16:45 +00:00
David Mulder
a3cd315321 python2 reduction: Merge remaining compat code into common
The remaining compat code (get_string, get_bytes,
cmp) are useful helper routines which we should
simply merge into common (especially since there
is some duplication here).

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>

Autobuild-User(master): David Mulder <dmulder@samba.org>
Autobuild-Date(master): Fri Oct  2 14:49:36 UTC 2020 on sn-devel-184
2020-10-02 14:49:36 +00:00
Volker Lendecke
254a5b034e test3: Add a test showing that smbclient recursive mget is broken
Bug: https://bugzilla.samba.org/show_bug.cgi?id=14517
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-09-30 15:58:39 +00:00
Stefan Metzmacher
b02f1d676f s3:share_mode_lock: remove unused reproducer for bug #14428
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14428

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Aug 31 13:34:17 UTC 2020 on sn-devel-184
2020-08-31 13:34:17 +00:00
Stefan Metzmacher
444f2bedf7 s3:share_mode_lock: reproduce problem with stale disconnected share mode entries
This reproduces the origin of "PANIC: assert failed in get_lease_type()"
(https://bugzilla.samba.org/show_bug.cgi?id=14428).

share_mode_cleanup_disconnected() removes disconnected entries from
leases.tdb and brlock.tdb but not from locking.tdb.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-08-31 11:57:01 +00:00
Stefan Metzmacher
560fe7b38f s3:selftest: also run durable_v2_reconnect_delay_msec in samba3.blackbox.durable_v2_delay
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14428

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-08-31 11:57:01 +00:00
Andreas Schneider
53b6dd9512 s3:tests: Add test for 'valid users = DOMAIN\%U'
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14467

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-08-19 05:21:40 +00:00
Andrew Bartlett
9e212dd15e selftest: Do not let deprecated option warnings muck this test up
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14460

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2020-08-18 00:10:40 +00:00
Andrew Bartlett
d3ff49f485 selftest: Add test for suppression of deprecation warnings
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14460

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2020-08-18 00:10:39 +00:00
Jeremy Allison
12c526f151 s3: scripts: Selfttest. samba3.blackbox.smbclient_iconv.*
Fix missing 'include' in temporary client smb.conf file.

The current temporary generated smb.conf file for the client, "client_cp850_smbconf"
doesn't include the normal client smb.conf file "client.conf".

This means it's missing the:

interfaces = XXXX,YYYY

line we needed to find the server via socketwrapper. Currently this test is finding the server by accident :-).

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): Tue Aug  4 06:30:25 UTC 2020 on sn-devel-184
2020-08-04 06:30:25 +00:00
Volker Lendecke
04eafce653 winbind: Add test for lookuprids cache problem
When reading entries from gencache, wb_cache_rids_to_names() can
return STATUS_SOME_UNMAPPED, which _wbint_LookupRids() does not handle
correctly.

This test enforces this situation by filling gencache with one wbinfo
-R and then erasing the winbindd_cache.tdb. This forces winbind to
enter the domain helper process, which will then read from gencache
filled with the previous wbinfo -R.

Without having the entries cached this does not happen because
wb_cache_rids_to_names() via the do_query: path calls deep inside
calls dcerpc_lsa_lookup_sids_noalloc(), which hides the
STATUS_SOME_UNMAPPED that came in as lsa_LookupSids result value.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14435
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-07-09 20:16:40 +00:00
Jeremy Allison
f206d37f6e s3: selftest: Add samba3.blackbox.aio-outstanding test.
Shows smbd panics if connection is terminated (torn down)
by killing the client with outstanding aio requests in the
queue. As we're closing smbd we should cope with this.

Followup-bugfix for:

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-24 18:53:32 +00:00
Ralph Boehme
32588c023e vfs: remove SMB_VFS_OPEN()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-21 20:38:34 +00:00
Ralph Boehme
8aff66d437 vfs_error_inject: implement SMB_VFS_OPENAT()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-21 20:38:32 +00:00
Volker Lendecke
8e4583f730 test: Show that netfileenum is broken
Bug: https://bugzilla.samba.org/show_bug.cgi?id=14355

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2020-05-14 20:29:38 +00:00
Jeremy Allison
e016671d34 s3: selftest: Add test_smbclient_iconv.sh to check client behavior on bad name conversion.
SMB2 and NT1 fail this, CORE already returns NT_STATUS_INVALID_NETWORK_RESPONSE
on bad conversion.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2020-05-12 19:53:46 +00:00
Amit Kumar
2a7fc40fb3 Add a test for smbclient -l basename
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14345

Signed-off-by: Amit Kumar <amitkuma@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2020-05-07 08:59:31 +00:00
Ralph Boehme
6557777c86 CI: add two tests for shadow_copy2 VFS module
Note that the test "fetch a previous version of a regular file via non-canonical
basepath" doesn't fail by "luck" because it runs into the "creating file"
optimisation in unix_convert().

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-06 10:18:38 +00:00
Jeremy Allison
35be625b09 s3: torture: Add samba3.blackbox.NT1.shadow_copy_torture.
Runs the SMB1 root @GMT-pathname open test.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 19:18:44 +00:00
Jeremy Allison
c3377b4c02 s3: torture: Add call to smbtorture smb2.twrp.openroot
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 19:18:43 +00:00
Jeremy Allison
b338636a1e s3: torture: Call the smbtorture3 SMB2-SACL test.
Calls the test in the previous commit by adding
SeSecurityPrivilege first, running the SMB2-SACL test
then removing SeSecurityPrivilege.

Demonstrates the difference between server behavior
with SEC_FLAG_SYSTEM_SECURITY against SMB1 and SMB2 servers.

Mark as knownfail for now.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-04-21 18:37:39 +00:00
Jeremy Allison
3f7821c98d s3: torture: Run the SMB1-SYSTEM-SECURITY test.
Calls the test in the previous commit by adding
SeSecurityPrivilege first, running the SMB1-SYSTEM-SECURITY
test then removing SeSecurityPrivilege.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-04-21 18:37:39 +00:00
Christof Schmitt
2d5ffed779 test_smbclient_s3: Test four-digit year in smbclient utimes
Modify the test to also set the create_time, and specify the year with
using four digits to test the new codepath.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-04-16 17:27:41 +00:00
Stefan Metzmacher
05d3a909d5 selftest: use 10.53.57.0/8 instead of 127.0.0.1/8
This makes our testing much more realistic and allows
the removal of some knowfail entries.

It also means the testing with network namespaces on Linux
can use the same addresses as our socket wrapper testing.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2020-03-27 09:02:38 +00:00
Jeremy Allison
566658d914 s3: tests: Slight tweak to the force-close share test.
Turns out on a fast desktop machine 10MB is too small,
and by the time we've done the 'sleep 1' to make sure
the smbclient got scheduled and started processing
the 'put' command, it's already done.

Tweak the file size to be 20MB from 10MB. 10MB
seems to work reliably on gitlab-ci and on
sn-devel, but making the put size 20MB makes
sure it's still in flight when we force-close
the share, even on a fast desktop box. 20MB
shouldn't be too burdonsome even on ci VM's.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-18 18:03:28 +00:00
Christof Schmitt
808d6c0c53 selftest: Add test for rpcclient LSA lookup calls
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): Wed Mar 11 09:52:44 UTC 2020 on sn-devel-184
2020-03-11 09:52:44 +00:00
Volker Lendecke
9653a10738 libsmbclient: Put it back to a known, well-working state
For adapting unix extensions in our client libraries, we need a fresh start
with additional APIs. We can't change existing application behaviour.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-03-10 21:25:33 +00:00
Jeremy Allison
bb22be08b0 s3: tests: Add samba3.blackbox.force-close-share
Checks server stays up whilst writing to a force closed share.
Uses existing aio_delay_inject share to delay writes while
we force close the share.

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

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): Sun Mar  8 19:34:14 UTC 2020 on sn-devel-184
2020-03-08 19:34:14 +00:00
Volker Lendecke
7c1abd7e85 selftest: Run smbtorture3 SHORTNAME-TEST without unix extensions
Soon cli_list() will change to SMB_FIND_FILE_UNIX_INFO2 which does not
provide a shortname. For now we lose that as an encrypted test, as for
now it's a SMB1 test which requires unix extensions for
encryption. Hopefully we don't forget to reenable this once the test
is converted to SMB2

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

nonunix
2020-03-03 17:48:37 +00:00
Volker Lendecke
b08643f07f selftest: Fix usage check of test_smbtorture_s3.sh
This needs at least 5 args

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-03-03 17:48:37 +00:00
Volker Lendecke
8c06f1933c test: Fix a copy&paste error
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-03-03 17:48:37 +00:00
Volker Lendecke
7bbba73b30 test: Show that smbd does not handle EINTR from open() correctly
Bug: https://bugzilla.samba.org/show_bug.cgi?id=14285
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-02-20 20:48:29 +00:00
Andreas Schneider
e2ea059e67 s3:tests: Add test for a dropbox with dir mode 0733
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Feb 18 21:07:44 UTC 2020 on sn-devel-184
2020-02-18 21:07:44 +00:00