summaryrefslogtreecommitdiffstats
path: root/source3/selftest/tests.py
diff options
context:
space:
mode:
authorAurélien Aptel <aurelien.aptel@gmail.com>2013-08-07 16:34:22 +0200
committerAndreas Schneider <asn@samba.org>2014-02-19 18:22:29 +0100
commit95f9e60ef70a1925a463038f41476400b8990d5c (patch)
tree4fa17b625af07e3a295340b9ba3e5f32a2e65a1a /source3/selftest/tests.py
parent92356e1524b97abc7e8f8fb5c7e625dc200de277 (diff)
downloadsamba-95f9e60ef70a1925a463038f41476400b8990d5c.tar.gz
samba-95f9e60ef70a1925a463038f41476400b8990d5c.tar.xz
samba-95f9e60ef70a1925a463038f41476400b8990d5c.zip
s3: add --with-libarchive to build configuration
* skip tar tests if disabled * print error message when using disabled command * autodetection of libarchive Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com> [ddiss@samba.org: rebased against makefile cleanup] Reviewed-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3/selftest/tests.py')
-rwxr-xr-xsource3/selftest/tests.py42
1 files changed, 33 insertions, 9 deletions
diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index 9676b741418..b8f477a8494 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -201,15 +201,39 @@ for env in ["s3dc"]:
# encrypted
plantestsuite("samba3.blackbox.smbclient_s3.crypt (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$USERNAME', '$PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', smbclient3, wbinfo, net, configuration, "-e"])
- # Test smbclient/tarmode
- plantestsuite("samba3.blackbox.smbclient_tarmode (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_tarmode.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', '$LOCAL_PATH', '$PREFIX', smbclient3, configuration])
-
- # Test suite for new smbclient/tar with libarchive (GSoC 13)
- plantestsuite("samba3.blackbox.smbclient_tar (%s)" % env, env,
- [os.path.join(samba3srcdir, "script/tests/test_smbclient_tarmode.pl"),
- '-n', '$SERVER', '-i', '$SERVER_IP', '-s', 'tmp',
- '-u', '$USERNAME', '-p', '$PASSWORD', '-l', '$LOCAL_PATH', '-d', '$PREFIX',
- '-b', smbclient3, '--subunit', '--', configuration])
+
+ #
+ # tar command tests
+ #
+
+ # find config.h
+ try:
+ config_h = os.environ["CONFIG_H"]
+ except KeyError:
+ config_h = os.path.join(samba4bindir, "default/include/config.h")
+
+ # see if libarchive is supported
+ f = open(config_h, 'r')
+ try:
+ have_libarchive = ("HAVE_LIBARCHIVE 1" in f.read())
+ finally:
+ f.close()
+
+ # tar command enabled only if built with libarchive
+ if have_libarchive:
+ # Test smbclient/tarmode
+ plantestsuite("samba3.blackbox.smbclient_tarmode (%s)" % env, env,
+ [os.path.join(samba3srcdir, "script/tests/test_smbclient_tarmode.sh"),
+ '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD',
+ '$LOCAL_PATH', '$PREFIX', smbclient3, configuration])
+
+ # Test suite for new smbclient/tar with libarchive (GSoC 13)
+ plantestsuite("samba3.blackbox.smbclient_tar (%s)" % env, env,
+ [os.path.join(samba3srcdir, "script/tests/test_smbclient_tarmode.pl"),
+ '-n', '$SERVER', '-i', '$SERVER_IP', '-s', 'tmp',
+ '-u', '$USERNAME', '-p', '$PASSWORD', '-l', '$LOCAL_PATH',
+ '-d', '$PREFIX', '-b', smbclient3,
+ '--subunit', '--', configuration])
#TODO encrypted against member, with member creds, and with DC creds
plantestsuite("samba3.blackbox.net.misc", "s3dc:local",