Connection handler test fails on virtual hosting system such as OpenVPS.
------------------------------------------------------------------------
Key: MODPYTHON-120
URL: http://issues.apache.org/jira/browse/MODPYTHON-120
Project: mod_python
Type: Bug
Components: core
Versions: 3.2
Reporter: Graham Dumpleton
Priority: Minor
On a virtual hosting environment such as OpenVPS, "localhost" does not map to
the IP address "127.0.0.1" but the actual IP of the host.
>>> import socket
>>> socket.gethostbyname("localhost")
'207.126.122.36'
This fact causes the connection handler test to fail because it sets up the
virtual host listener definition as something like:
Listen 59180
<VirtualHost 127.0.0.1:59180>
SetHandler mod_python
PythonPath [r'/home/grahamd/mod_python-3.2.7/test/htdocs']+sys.path
PythonConnectionHandler tests::connectionhandler
</VirtualHost>
In this case it really needs to be:
Listen 59180
<VirtualHost 207.126.122.36:59180>
SetHandler mod_python
PythonPath [r'/home/grahamd/mod_python-3.2.7/test/htdocs']+sys.path
PythonConnectionHandler tests::connectionhandler
</VirtualHost>
To accomodate virtual hosting arrangements, the test might be able to be
rewritten as:
def test_connectionhandler_conf(self):
try:
ip = socket.gethostbyname("localhost")
except:
ip = "127.0.0.1"
self.conport = findUnusedPort()
c = str(Listen("%d" % self.conport)) + \
str(VirtualHost("%s:%d" % (ip,self.conport),
SetHandler("mod_python"),
PythonPath("[r'%s']+sys.path" % DOCUMENT_ROOT),
PythonConnectionHandler("tests::connectionhandler")))
return c
This should always work on UNIX boxes, but whether it does on Win32 boxes would
need to be confirmed.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira