torture: Add smb2.rename.rename_dir_bench

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>
Fix bug #10229 - No access check verification on stream files.

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

We need to check if the requested access mask
could be used to open the underlying file (if
it existed), as we're passing in zero for the
access mask to the base filename.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@suse.de>
Add regression test for bug #10229 - No access check verification on stream files.

Checks against a file with attribute READONLY, and
a security descriptor denying WRITE_DATA access.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@suse.de>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Nov  4 23:10:10 CET 2013 on sn-devel-104
initial commit of the new tarmode test script.

This script will hopefully replace and improve test_smbclient_tarmode.sh.
Right now it only does normal and incremental tests.

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
test_smbclient_tarmode.pl: add proper argument parsing for configuration.

documentation is included in the script in POD format.

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
test_smbclient_tarmode.pl: improve incremental test

instead of using archived and non-archived files for the test, use
archive and various flags (system, hidden, readonly).

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
test_smbclient_tarmode.pl: add test for reset mode

add a new test for the reset mode which can be triggered via `-a` or
`tarmode reset`.

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
test_smbclient_tarmode.pl: add test for "newer than" (`N` flag)

add test for the N FILE flag which makes smbclient only backup files
newer or as new as FILE.

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
test_smbclient_tarmode.pl: refactored file related function to a File package

all the localpath(), remotepath() and all file related functions were
getting out of hand. The tests are now simpler to write.

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
test_smbclient_tarmode.pl: add nested dirs test

add a test to check that the backup handles nested directories.

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
test_smbclient_tarmode.pl: remove unused functions

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
test_smbclient_tarmode.pl: add first extraction test

* add normal extraction test
* add (or bring back)
  - File::list() -- return list of File in a path
  - File::tree() -- same but recursive
  - File::walk() -- high order function to iterate on a File hierarchy
* compute md5 sum when not cached
* add check_remote(), will be useful for all extraction tests
* fix consecutive slashes bug in some File::xxxpath()

At this point, the script can replace the old
test_smbclient_tarmode.sh in terms of features.

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
test_smbclient_tarmode.pl: add option to choose and run a single test

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
test_smbclient_tarmode.pl: add tests for X and I.

Found a bug while doing so. X doesn't exclude file path.

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
test_smbclient_tarmode.pl: add extraction test for I and X.

* add test for xI and xX
* fix bug in check_remote(): print filename instead of ref
* replace hash by list in test_extraction_normal()

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
test_smbclient_tarmode.pl: add test for creation w/ filelist

* add test_creation_list()
* add parameter to File::new_local() to provide file content

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
test_smbclient_tarmode.pl: add test for xF

Add test for extracting from a file list.

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
test_smbclient_tarmode.pl: add a clean option to erase the local path

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
test_smbclient_tarmode.pl: add a first simple wildcard test

* File::list() now takes an absolute path
* check_remote() now takes the dir to check
* added an optional File destructor
* added cleanpath() to remove unecessary slashes
* File::new_remote() can take an absolute path
* File->{dir} is now absolute from the localpath

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
test_smbclient_tarmode.pl: add tests for wildcard pattern (cI, cX, cF, xF).

* add some test for wildcard pattern and r switch, when possible (-r
  is very buggy)
* change default DIR to "tar_test_dir"
* add tests for attributes (nohidden, nosystem which are undocumented)

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>