selftest: Assemble smbtorture arguments as a list
authorVolker Lendecke <vl@samba.org>
Wed, 26 Feb 2020 22:07:54 +0000 (14:07 -0800)
committerJeremy Allison <jra@samba.org>
Thu, 27 Feb 2020 18:07:29 +0000 (18:07 +0000)
I'm planning to mess with libsmbclient tests calling into
smbtorture4. For this it will be much more convenient to have the
arguments available as a higher-level data structure than just a
string.

Checked by "diff" on the testlist before and after -- no change.

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

index 1afabf3cdcad2de15abe4440ac6c583728e691d6..97db3b8c97fa2253ee079906815760a5f0cb8be6 100644 (file)
@@ -176,10 +176,14 @@ smbtorture4_options = [
 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]) + " " + options
-    cmdline = "%s $LISTOPT $LOADLIST %s %s" % (valgrindify(smbtorture4), options, name)
+    if isinstance(options, str):
+        options = options.split()
+    cmdarray = [ valgrindify(smbtorture4), "$LISTOPT", "$LOADLIST" ]
+    cmdarray += smbtorture4_options
+    cmdarray += [ "--target=%s" % target ]
+    cmdarray += options
+    cmdarray += [ name ]
+    cmdline = " ".join(cmdarray)
     plantestsuite_loadlist(modname, env, cmdline)