You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-commits@quetz.apache.org by jg...@apache.org on 2005/11/16 20:23:19 UTC
svn commit: r345092 - /httpd/mod_python/trunk/test/test.py
Author: jgallacher
Date: Wed Nov 16 11:23:16 2005
New Revision: 345092
URL: http://svn.apache.org/viewcvs?rev=345092&view=rev
Log:
Changed unit test for global_lock to use either ab or ab2. If neither is
found the test is skipped.
Modified:
httpd/mod_python/trunk/test/test.py
Modified: httpd/mod_python/trunk/test/test.py
URL: http://svn.apache.org/viewcvs/httpd/mod_python/trunk/test/test.py?rev=345092&r1=345091&r2=345092&view=diff
==============================================================================
--- httpd/mod_python/trunk/test/test.py (original)
+++ httpd/mod_python/trunk/test/test.py Wed Nov 16 11:23:16 2005
@@ -135,8 +135,6 @@
TESTHOME = testconf.TESTHOME
MOD_PYTHON_SO = testconf.MOD_PYTHON_SO
LIBEXECDIR = testconf.LIBEXECDIR
-AB = os.path.join(os.path.split(HTTPD)[0], "ab")
-
SERVER_ROOT = TESTHOME
CONFIG = os.path.join(TESTHOME, "conf", "test.conf")
DOCUMENT_ROOT = os.path.join(TESTHOME, "htdocs")
@@ -164,6 +162,17 @@
return port
+def get_ab_path():
+ """ Find the location of the ab (apache benchmark) program """
+ ab = None
+ for name in ['ab', 'ab2']:
+ path = quoteIfSpace(os.path.join(os.path.split(HTTPD)[0], name))
+ if os.path.exists(path):
+ ab = path
+ break
+
+ return ab
+
def quoteIfSpace(s):
# Windows doesn't like quotes when there are
@@ -1728,9 +1737,13 @@
self.fail(`rsp`)
# if the mutex works, this test will take at least 5 secs
+ ab = get_ab_path()
+ if not ab:
+ print " Can't find ab. Skipping _global_lock test"
+ return
+
t1 = time.time()
print " ", time.ctime()
- ab = quoteIfSpace(AB)
if os.name == "nt":
cmd = '%s -c 5 -n 5 http://127.0.0.1:%s/tests.py > NUL:' \
% (ab, PORT)