summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--selftest/selftesthelpers.py30
-rwxr-xr-xsource3/selftest/tests.py2
-rwxr-xr-xsource4/selftest/tests.py17
3 files changed, 26 insertions, 23 deletions
diff --git a/selftest/selftesthelpers.py b/selftest/selftesthelpers.py
index 66402903b7..40efc1f7ef 100644
--- a/selftest/selftesthelpers.py
+++ b/selftest/selftesthelpers.py
@@ -179,6 +179,15 @@ def planpythontestsuite(env, module, name=None, extra_path=[]):
plantestsuite_idlist(name, env, args)
+def get_env_torture_options():
+ ret = []
+ if not os.getenv("SELFTEST_VERBOSE"):
+ ret.append("--option=torture:progress=no")
+ if os.getenv("SELFTEST_QUICK"):
+ ret.append("--option=torture:quick=yes")
+ return ret
+
+
samba4srcdir = source4dir()
bbdir = os.path.join(srcdir(), "testprogs/blackbox")
configuration = "--configfile=$SMB_CONF_PATH"
@@ -186,26 +195,23 @@ 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()
+smbtorture4_options = [
+ configuration,
+ "--maximum-runtime=$SELFTEST_MAXTIME",
+ "--basedir=$SELFTEST_TMPDIR",
+ "--format=subunit"
+ ] + get_env_torture_options()
-def plansmbtorture4testsuite(name, env, options, modname=None):
+
+def plansmbtorture4testsuite(name, env, options, target, modname=None):
if modname is None:
modname = "samba4.%s" % name
if isinstance(options, list):
options = " ".join(options)
+ options += " " + " ".join(smbtorture4_options + ["--target=%s" % target])
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)
-
-
-def get_env_torture_options():
- ret = []
- if not os.getenv("SELFTEST_VERBOSE"):
- ret.append("--option=torture:progress=no")
- if os.getenv("SELFTEST_QUICK"):
- ret.append("--option=torture:quick=yes")
- return ret
-
-
diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index c4b2aeeba5..f0f0b8fdd3 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -43,7 +43,7 @@ torture_options = [configuration,
'--format=subunit'
]
-torture_options.extend(env_get_torture_options())
+torture_options.extend(get_env_torture_options())
smbtorture4 += " " + " ".join(torture_options)
diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py
index b36f43bb4b..08236c8744 100755
--- a/source4/selftest/tests.py
+++ b/source4/selftest/tests.py
@@ -20,9 +20,16 @@
import os, sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../../selftest"))
+import selftesthelpers
from selftesthelpers import *
import subprocess
+print >>sys.stderr, "OPTIONS %s" % " ".join(smbtorture4_options)
+
+def plansmbtorture4testsuite(name, env, options, modname=None):
+ return selftesthelpers.plansmbtorture4testsuite(name, env, options,
+ target='samba4', modname=modname)
+
samba4srcdir = source4dir()
samba4bindir = bindir()
validate = os.getenv("VALIDATE", "")
@@ -38,16 +45,6 @@ subprocess.call([smbtorture4, "-V"], stdout=sys.stderr)
bbdir = os.path.join(srcdir(), "testprogs/blackbox")
-torture_options = [configuration,
- "--maximum-runtime=$SELFTEST_MAXTIME",
- "--target=samba4",
- "--basedir=$SELFTEST_TMPDIR",
- "--format=subunit"]
-torture_options.extend(get_env_torture_options())
-smbtorture4 += " " + " ".join(torture_options)
-
-print >>sys.stderr, "OPTIONS %s" % " ".join(torture_options)
-
# Simple tests for LDAP and CLDAP
for options in ['-U"$USERNAME%$PASSWORD" --option=socket:testnonblock=true', '-U"$USERNAME%$PASSWORD"', '-U"$USERNAME%$PASSWORD" -k yes', '-U"$USERNAME%$PASSWORD" -k no', '-U"$USERNAME%$PASSWORD" -k no --sign', '-U"$USERNAME%$PASSWORD" -k no --encrypt', '-U"$USERNAME%$PASSWORD" -k yes --encrypt', '-U"$USERNAME%$PASSWORD" -k yes --sign']:
plantestsuite("samba4.ldb.ldap with options %s(dc)" % options, "dc", "%s/test_ldb.sh ldap $SERVER %s" % (bbdir, options))