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 ae0a756..6640290 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 01fbf0a..c4b2aee 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 7f10cd1..b36f43b 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)