selftest: Factor out smbtorture4testsuite_cmdarray()
authorVolker Lendecke <vl@samba.org>
Wed, 26 Feb 2020 22:36:32 +0000 (14:36 -0800)
committerJeremy Allison <jra@samba.org>
Thu, 27 Feb 2020 18:07:29 +0000 (18:07 +0000)
This will be used in the libsmbclient tests soon

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
selftest/selftesthelpers.py

index 97db3b8c97fa2253ee079906815760a5f0cb8be6..1fdb2e461e1b5da536b98da2e29eded210475fdc 100644 (file)
@@ -172,17 +172,20 @@ smbtorture4_options = [
     "--format=subunit"
 ] + get_env_torture_options()
 
+def smbtorture4testsuite_cmdarray(name, env, options, target):
+    cmdarray = [ valgrindify(smbtorture4), "$LISTOPT", "$LOADLIST" ]
+    cmdarray += smbtorture4_options
+    cmdarray += [ "--target=%s" % target ]
+    cmdarray += options
+    cmdarray += [ name ]
+    return cmdarray
 
 def plansmbtorture4testsuite(name, env, options, target, modname=None):
     if modname is None:
         modname = "samba4.%s" % name
     if isinstance(options, str):
         options = options.split()
-    cmdarray = [ valgrindify(smbtorture4), "$LISTOPT", "$LOADLIST" ]
-    cmdarray += smbtorture4_options
-    cmdarray += [ "--target=%s" % target ]
-    cmdarray += options
-    cmdarray += [ name ]
+    cmdarray = smbtorture4testsuite_cmdarray(name, env, options, target)
     cmdline = " ".join(cmdarray)
     plantestsuite_loadlist(modname, env, cmdline)