summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2012-10-26 17:31:40 -0800
committerJelmer Vernooij <jelmer@samba.org>2012-10-27 16:57:49 +0200
commit13269923585888912e2433c15c0ca010a9897595 (patch)
treedb383dca2efb341dd6c555f96b44fecea1cafd94
parent8d397b69bb29b7a464b610bc46cedd6be01b2455 (diff)
downloadsamba-13269923585888912e2433c15c0ca010a9897595.tar.gz
samba-13269923585888912e2433c15c0ca010a9897595.tar.bz2
samba-13269923585888912e2433c15c0ca010a9897595.zip
selftesthelpers: Fix detection of tap2subunit.
Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org> Autobuild-Date(master): Sat Oct 27 16:57:49 CEST 2012 on sn-devel-104
-rw-r--r--selftest/selftesthelpers.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/selftest/selftesthelpers.py b/selftest/selftesthelpers.py
index 00fa8aae7c..8d36356293 100644
--- a/selftest/selftesthelpers.py
+++ b/selftest/selftesthelpers.py
@@ -18,6 +18,7 @@
# three separated by newlines. All other lines in the output are considered
# comments.
+import errno
import os
import subprocess
import sys
@@ -68,7 +69,7 @@ python = os.getenv("PYTHON", "python")
tap2subunit = "PYTHONPATH=%s/lib/subunit/python:%s/lib/testtools %s %s/lib/subunit/filters/tap2subunit" % (srcdir(), srcdir(), python, srcdir())
sub = subprocess.Popen("tap2subunit", stdin=subprocess.PIPE,
- stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
sub.communicate("")
if sub.returncode == 0:
@@ -210,7 +211,12 @@ def print_smbtorture4_version():
:return: Whether smbtorture4 was successfully run
"""
- sub = subprocess.Popen([smbtorture4, "-V"], stdout=sys.stderr)
+ try:
+ sub = subprocess.Popen([smbtorture4, "-V"], stdout=sys.stderr)
+ except OSError, e:
+ if e.errno == errno.ENOENT:
+ return False
+ raise
sub.communicate("")
return (sub.returncode == 0)