summaryrefslogtreecommitdiff
path: root/selftest/selftest.py
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2012-03-05 03:39:57 +0100
committerJelmer Vernooij <jelmer@samba.org>2012-03-05 03:39:57 +0100
commitf3f6b8eafa07b8d9e815e023adb8825ce89ef8da (patch)
tree10650e539e9a5840cda105f51069a68b70b415ac /selftest/selftest.py
parentd6924f803904d25a7f9cac2ec69f421d7a5bdeab (diff)
downloadsamba-f3f6b8eafa07b8d9e815e023adb8825ce89ef8da.tar.gz
samba-f3f6b8eafa07b8d9e815e023adb8825ce89ef8da.tar.bz2
samba-f3f6b8eafa07b8d9e815e023adb8825ce89ef8da.zip
selftest.run: Factor out expand_command_run.
Diffstat (limited to 'selftest/selftest.py')
-rwxr-xr-xselftest/selftest.py22
1 files changed, 6 insertions, 16 deletions
diff --git a/selftest/selftest.py b/selftest/selftest.py
index 5c9bd7d13c..5b23be265d 100755
--- a/selftest/selftest.py
+++ b/selftest/selftest.py
@@ -26,7 +26,6 @@ import signal
import shutil
import subprocess
import subunit
-import tempfile
import traceback
import warnings
@@ -42,6 +41,7 @@ from selftest import (
from selftest.run import (
expand_environment_strings,
expand_command_list,
+ expand_command_run,
)
from selftest.target import (
EnvironmentManager,
@@ -606,24 +606,14 @@ else:
"unable to set up environment %s: %s" % (envname, e))
continue
- # Generate a file with the individual tests to run, if the
- # test runner for this test suite supports it.
- if subtests is not None:
- if supports_loadfile:
- (fd, listid_file) = tempfile.mkstemp()
- # FIXME: Remove tempfile afterwards
- f = os.fdopen(fd)
- try:
- for test in subtests:
- f.write(test+"\n")
- finally:
- f.close()
- cmd = cmd.replace("$LOADLIST", "--load-list=%s" % listid_file)
- elif supports_idlist:
- cmd += " ".join(subtests)
+ cmd, tmpf = expand_command_run(cmd, supports_loadfile, supports_idlist,
+ subtests)
run_testsuite(envname, name, cmd)
+ if tmpf is not None:
+ os.remove(tmpf)
+
if opts.resetup_environment:
env_manager.teardown_env(envname)