selftest/selftesthelpers: Share environment handling for extra smbtorture options.
authorJelmer Vernooij <jelmer@samba.org>
Fri, 26 Oct 2012 21:12:54 +0000 (13:12 -0800)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 27 Oct 2012 13:16:18 +0000 (05:16 -0800)
selftest/selftesthelpers.py
source3/selftest/tests.py
source4/selftest/tests.py

index ae0a756823008ecf76337628280bba060aa31bd8..66402903b78ae144cb19b73e46b5a1aedd29b83d 100644 (file)
@@ -198,3 +198,14 @@ def plansmbtorture4testsuite(name, env, options, modname=None):
 
 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
+
+
index 01fbf0aee5ad876431cfd4d5b109ae0a87cd054b..c4b2aeeba5a5588d70f3040e6e89aa72f26b8bff 100755 (executable)
@@ -33,18 +33,17 @@ ntlm_auth = binpath('ntlm_auth3')
 dbwrap_tool = binpath('dbwrap_tool')
 vfstest = binpath('vfstest')
 
-torture_options = [configuration, "--maximum-runtime=$SELFTEST_MAXTIME",
-                   "--basedir=$SELFTEST_TMPDIR",
+torture_options = [configuration,
+                   '--maximum-runtime=$SELFTEST_MAXTIME',
+                   '--basedir=$SELFTEST_TMPDIR',
                    '--option="torture:winbindd_netbios_name=$SERVER"',
                    '--option="torture:winbindd_netbios_domain=$DOMAIN"',
                    '--option=torture:sharedelay=100000',
-                   '--option=torture:writetimeupdatedelay=500000' ]
+                   '--option=torture:writetimeupdatedelay=500000',
+                   '--format=subunit'
+                   ]
 
-if not os.getenv("SELFTEST_VERBOSE"):
-    torture_options.append("--option=torture:progress=no")
-torture_options.append("--format=subunit")
-if os.getenv("SELFTEST_QUICK"):
-    torture_options.append("--option=torture:quick=yes")
+torture_options.extend(env_get_torture_options())
 
 smbtorture4 += " " + " ".join(torture_options)
 
index 7f10cd16522674ff7dfaf523e53e736591b7524d..b36f43bb4b1df45ad77c55d384b77d79451e9572 100755 (executable)
@@ -38,12 +38,12 @@ 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"]
-if not os.getenv("SELFTEST_VERBOSE"):
-    torture_options.append("--option=torture:progress=no")
-torture_options.append("--format=subunit")
-if os.getenv("SELFTEST_QUICK"):
-    torture_options.append("--option=torture:quick=yes")
+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)