summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--selftest/selftesthelpers.py13
-rwxr-xr-xsource3/selftest/tests.py18
-rwxr-xr-xsource4/selftest/tests.py13
3 files changed, 19 insertions, 25 deletions
diff --git a/selftest/selftesthelpers.py b/selftest/selftesthelpers.py
index 45170304e5..b22330ae0a 100644
--- a/selftest/selftesthelpers.py
+++ b/selftest/selftesthelpers.py
@@ -183,3 +183,16 @@ samba4srcdir = source4dir()
bbdir = os.path.join(srcdir(), "testprogs/blackbox")
configuration = "--configfile=$SMB_CONF_PATH"
+smbtorture4 = binpath("smbtorture4")
+smbtorture4_testsuite_list = subprocess.Popen([smbtorture4, "--list-suites"], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate("")[0].splitlines()
+
+def plansmbtorture4testsuite(name, env, options, modname=None):
+ if modname is None:
+ modname = "samba4.%s" % name
+ if isinstance(options, list):
+ options = " ".join(options)
+ cmdline = "%s $LISTOPT %s %s" % (valgrindify(smbtorture4), options, name)
+ plantestsuite_loadlist(modname, env, cmdline)
+
+def smbtorture4_testsuites(prefix):
+ return filter(lambda x: x.startswith(prefix), smbtorture4_testsuite_list)
diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index 7168bfd327..05a14f9514 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -22,7 +22,6 @@ import os, sys
sys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), "../../selftest")))
from selftesthelpers import *
import subprocess
-smb4torture = binpath("smbtorture4")
samba3srcdir = srcdir() + "/source3"
configuration = "--configfile=$SMB_CONF_PATH"
scriptdir=os.path.join(samba3srcdir, "../script/tests")
@@ -48,17 +47,12 @@ torture_options.append("--format=subunit")
if os.getenv("SELFTEST_QUICK"):
torture_options.append("--option=torture:quick=yes")
-smb4torture_testsuite_list = subprocess.Popen([smb4torture, "--list-suites"], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate("")[0].splitlines()
+smbtorture4 += " " + " ".join(torture_options)
-smb4torture += " " + " ".join(torture_options)
-
-sub = subprocess.Popen("%s --version 2> /dev/null" % smb4torture, stdout=subprocess.PIPE, stdin=subprocess.PIPE, shell=True)
+sub = subprocess.Popen("%s --version 2> /dev/null" % smbtorture4, stdout=subprocess.PIPE, stdin=subprocess.PIPE, shell=True)
sub.communicate("")
-smb4torture_possible = (sub.returncode == 0)
-
+smbtorture4_possible = (sub.returncode == 0)
-def smb4torture_testsuites(prefix):
- return filter(lambda x: x.startswith(prefix), smb4torture_testsuite_list)
def plansmbtorturetestsuite(name, env, options, description=''):
target = "samba3"
@@ -67,8 +61,8 @@ def plansmbtorturetestsuite(name, env, options, description=''):
else:
modname = "%s.%s %s" % (target, name, description)
- cmdline = "%s $LISTOPT %s --target=%s %s" % (valgrindify(smb4torture), options, target, name)
- if smb4torture_possible:
+ cmdline = "%s $LISTOPT %s --target=%s %s" % (valgrindify(smbtorture4), options, target, name)
+ if smbtorture4_possible:
plantestsuite_loadlist(modname, env, cmdline)
@@ -283,7 +277,7 @@ raw = ["raw.acls", "raw.chkpath", "raw.close", "raw.composite", "raw.context", "
"raw.bench-oplock", "raw.bench-lock", "raw.bench-open", "raw.bench-tcon",
"raw.samba3checkfsp", "raw.samba3closeerr", "raw.samba3oplocklogoff", "raw.samba3badnameblob"]
-smb2 = smb4torture_testsuites("smb2.")
+smb2 = smbtorture4_testsuites("smb2.")
rpc = ["rpc.authcontext", "rpc.samba3.bind", "rpc.samba3.srvsvc", "rpc.samba3.sharesec",
"rpc.samba3.spoolss", "rpc.samba3.wkssvc", "rpc.samba3.winreg",
diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py
index bbfeaac6f1..7f10cd1652 100755
--- a/source4/selftest/tests.py
+++ b/source4/selftest/tests.py
@@ -25,8 +25,6 @@ import subprocess
samba4srcdir = source4dir()
samba4bindir = bindir()
-smbtorture4 = binpath("smbtorture4")
-smbtorture4_testsuite_list = subprocess.Popen([smbtorture4, "--list-suites"], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate("")[0].splitlines()
validate = os.getenv("VALIDATE", "")
if validate:
validate_list = [validate]
@@ -36,17 +34,6 @@ else:
nmblookup = binpath('nmblookup4')
smbclient = binpath('smbclient4')
-def plansmbtorture4testsuite(name, env, options, modname=None):
- if modname is None:
- modname = "samba4.%s" % name
- if isinstance(options, list):
- options = " ".join(options)
- cmdline = "%s $LISTOPT %s %s" % (valgrindify(smbtorture4), options, name)
- plantestsuite_loadlist(modname, env, cmdline)
-
-def smbtorture4_testsuites(prefix):
- return filter(lambda x: x.startswith(prefix), smbtorture4_testsuite_list)
-
subprocess.call([smbtorture4, "-V"], stdout=sys.stderr)
bbdir = os.path.join(srcdir(), "testprogs/blackbox")