selftest: Require libarchive for --enable-selftest
authorAndrew Bartlett <abartlet@samba.org>
Thu, 10 May 2018 02:00:54 +0000 (14:00 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 15 May 2018 04:31:03 +0000 (06:31 +0200)
This avoids one more case where tests can go missing by removing the conditional.

(Yes, this has happend for other tests in the past).

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue May 15 06:31:03 CEST 2018 on sn-devel-144

source3/selftest/tests.py
source3/wscript

index 5ebebb5d14fad187d32338a9af405b74b1013100..1e1f97efa4059ae7e3e77eb6b355df7f37456f61 100755 (executable)
@@ -54,7 +54,6 @@ try:
 finally:
     f.close()
 
-have_libarchive = ("HAVE_LIBARCHIVE" in config_hash)
 have_linux_kernel_oplocks = ("HAVE_KERNEL_OPLOCKS_LINUX" in config_hash)
 have_inotify = ("HAVE_INOTIFY" in config_hash)
 have_ldwrap = ("HAVE_LDWRAP" in config_hash)
@@ -295,31 +294,29 @@ for env in ["fileserver"]:
     # tar command tests
     #
 
-    # tar command enabled only if built with libarchive
-    if have_libarchive:
-        # Test smbclient/tarmode
-        plantestsuite("samba3.blackbox.smbclient_tarmode.NT1", env,
-                      [os.path.join(samba3srcdir, "script/tests/test_smbclient_tarmode.sh"),
-                       '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD',
-                       '$LOCAL_PATH/tarmode', '$PREFIX', smbclient3, configuration, "-mNT1"])
-        plantestsuite("samba3.blackbox.smbclient_tarmode.SMB3", env,
-                      [os.path.join(samba3srcdir, "script/tests/test_smbclient_tarmode.sh"),
-                       '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD',
-                       '$LOCAL_PATH/tarmode', '$PREFIX', smbclient3, configuration, "-mSMB3"])
-
-        # Test suite for new smbclient/tar with libarchive (GSoC 13)
-        plantestsuite("samba3.blackbox.smbclient_tar.NT1", 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/tarmode',
-                       '-d', '$PREFIX', '-b', smbclient3,
-                       '--subunit', '--', configuration, '-mNT1'])
-        plantestsuite("samba3.blackbox.smbclient_tar.SMB3", 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/tarmode',
-                       '-d', '$PREFIX', '-b', smbclient3,
-                       '--subunit', '--', configuration, '-mSMB3'])
+    # Test smbclient/tarmode
+    plantestsuite("samba3.blackbox.smbclient_tarmode.NT1", env,
+                  [os.path.join(samba3srcdir, "script/tests/test_smbclient_tarmode.sh"),
+                   '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD',
+                   '$LOCAL_PATH/tarmode', '$PREFIX', smbclient3, configuration, "-mNT1"])
+    plantestsuite("samba3.blackbox.smbclient_tarmode.SMB3", env,
+                  [os.path.join(samba3srcdir, "script/tests/test_smbclient_tarmode.sh"),
+                   '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD',
+                   '$LOCAL_PATH/tarmode', '$PREFIX', smbclient3, configuration, "-mSMB3"])
+
+    # Test suite for new smbclient/tar with libarchive (GSoC 13)
+    plantestsuite("samba3.blackbox.smbclient_tar.NT1", 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/tarmode',
+                   '-d', '$PREFIX', '-b', smbclient3,
+                   '--subunit', '--', configuration, '-mNT1'])
+    plantestsuite("samba3.blackbox.smbclient_tar.SMB3", 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/tarmode',
+                   '-d', '$PREFIX', '-b', smbclient3,
+                   '--subunit', '--', configuration, '-mSMB3'])
 
 plantestsuite("samba3.blackbox.net_usershare", "fileserver:local", [os.path.join(samba3srcdir, "script/tests/test_net_usershare.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', smbclient3])
 
index 7a1c579ef671eefd7b1dbca5cebc6f1ade20fa26..633a3655b211b5b5b9e1cba59b9cc29f9dd9d93f 100644 (file)
@@ -228,6 +228,10 @@ main() {
                        "build without libarchive support. "
                        "libarchive support is required for the smbclient "
                        "tar-file mode")
+    elif conf.CONFIG_GET('ENABLE_SELFTEST'):
+        raise Utils.WafError('libarchive library required for '
+                             '--enable-selftest')
+
 
     # check for DMAPI libs
     if Options.options.with_dmapi == False: