aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric B Munson <ebmunson@us.ibm.com>2010-01-22 13:43:11 +0000
committerEric B Munson <ebmunson@us.ibm.com>2010-01-27 10:48:04 +0000
commite183f433594a8f3bf59ffa6c90c56445281736f1 (patch)
tree2dc96110158a53f19580387665a6323d0fa8ebcd
parentac53a52aad66254ee53c564c54fb432d937316ac (diff)
downloadlibhugetlbfs-e183f433594a8f3bf59ffa6c90c56445281736f1.tar.gz
Fix run_test_prog to handle OSError
Currently run_test_prog is unprotected from the OSError exception. This patch makes run_test_prog return an error value instead of having the exception kill the entire process. Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
-rwxr-xr-xtests/run_tests.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/run_tests.py b/tests/run_tests.py
index 8de0cb4..ebf9c80 100755
--- a/tests/run_tests.py
+++ b/tests/run_tests.py
@@ -69,12 +69,14 @@ def run_test_prog(bits, pagesize, cmd, **env):
% (bits, bits, local_env.get("LD_LIBRARY_PATH", ""))
local_env["HUGETLB_DEFAULT_PAGE_SIZE"] = repr(pagesize)
- p = subprocess.Popen(cmd, env=local_env, stdout=subprocess.PIPE)
try:
+ p = subprocess.Popen(cmd, env=local_env, stdout=subprocess.PIPE)
rc = p.wait()
except KeyboardInterrupt:
# Abort and mark this a strange test result
return (None, "")
+ except OSError:
+ return (None, "")
out = p.stdout.read().strip()
if paranoid_pool_check: