summaryrefslogtreecommitdiff
path: root/selftest/selftest.py
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2012-03-05 04:05:35 +0100
committerJelmer Vernooij <jelmer@samba.org>2012-03-05 05:42:19 +0100
commit53a147d1c0c54fe94ac21f25088fd874d1300102 (patch)
tree55a72d078a35952894d00e3350c451ea5ccff820 /selftest/selftest.py
parentf26b40a92553863bc0da39918ff19bf21199c608 (diff)
downloadsamba-53a147d1c0c54fe94ac21f25088fd874d1300102.tar.gz
samba-53a147d1c0c54fe94ac21f25088fd874d1300102.tar.bz2
samba-53a147d1c0c54fe94ac21f25088fd874d1300102.zip
selftest.run: Factor out read_testlist_file and open_file_or_pipe.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Mon Mar 5 05:42:19 CET 2012 on sn-devel-104
Diffstat (limited to 'selftest/selftest.py')
-rwxr-xr-xselftest/selftest.py25
1 files changed, 8 insertions, 17 deletions
diff --git a/selftest/selftest.py b/selftest/selftest.py
index 9ca1e45c1d..26c409af45 100755
--- a/selftest/selftest.py
+++ b/selftest/selftest.py
@@ -344,25 +344,16 @@ else:
os.environ["SELFTEST_MAXTIME"] = str(torture_maxtime)
-def open_file_or_pipe(path, mode):
- if path.endswith("|"):
- return os.popen(path[:-1], mode)
- return open(path, mode)
-
available = []
for fn in opts.testlist:
- inf = open_file_or_pipe(fn, 'r')
- try:
- for testsuite in testlist.read_testlist(inf, sys.stdout):
- if not testlist.should_run_test(tests, testsuite):
- continue
- name = testsuite[0]
- if (includes is not None and
- testlist.find_in_list(includes, name) is not None):
- continue
- available.append(testsuite)
- finally:
- inf.close()
+ for testsuite in testlist.read_testlist_file(fn):
+ if not testlist.should_run_test(tests, testsuite):
+ continue
+ name = testsuite[0]
+ if (includes is not None and
+ testlist.find_in_list(includes, name) is not None):
+ continue
+ available.append(testsuite)
if opts.load_list:
restricted_mgr = testlist.RestrictedTestManager.from_path(opts.load_list)