Resolved: (MODPYTHON-121) The local/remote host tests fail
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > Apache Mod-Python > Resolved: (MODPYTHON-121) The local/remote host tests fail




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Resolved: (MODPYTHON-121) The local/remote host tests fail  
Graham Dumpleton (JIRA)


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-02-06 11:57 PM

[ http://issues.apache.org/jira/brows...ON-121?page=all ]

Graham Dumpleton resolved MODPYTHON-121:
----------------------------------------

Fix Version: 3.3
Resolution: Fixed

> The local/remote host tests fail for a virtual hosting system such as Open
VPS.
> --------------------------------------------------------------------------
----
>
>          Key: MODPYTHON-121
>          URL: http://issues.apache.org/jira/browse/MODPYTHON-121
>      Project: mod_python
>         Type: Bug

>     Versions: 3.2.7
>     Reporter: Graham Dumpleton
>     Assignee: Graham Dumpleton
>     Priority: Minor
>      Fix For: 3.3

>
> 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. 
>   '207.126.122.36'
> This fact causes various aspects of the test_connection_members() test to fail. To
 avoid the problem the test could factor in the actual IP as returned for "localhost
". Thus in htdocs/tests.py, could read as follows. This should be okay on UNIX syste
ms,
but should be confirmed as okay on Win32 systems.
>     def test_connection_members(self):
>         req = self.req
>         log = req.log_error
>         conn = req.connection
>         log("Examining connection memebers:")
>         try:
>             import socket
>             ip = socket.gethostbyname("localhost")
>         except:
>             ip = None
>         log("    connection.base_server: %s" % `conn.base_server`)
>         if type(conn.base_server) is not type(req.server):
>             self.fail("conn.base_server should be same type as req.server"
)
>         log("    connection.local_addr: %s" % `conn.local_addr`)
>         if not conn.local_addr[0] in ("127.0.0.1", "0.0.0.0", ip):
>             self.fail("conn.local_addr[0] should be '127.0.0.1' or '0.
0.0.0'")
>         log("    connection.remote_addr: %s" % `conn.remote_addr`)
>         if not conn.remote_addr[0] in ("127.0.0.1", "0.0.0.0", ip):
>             self.fail("conn.remote_addr[0] should be '127.0.0.1' or '0
.0.0.0'")
>         log("    connection.remote_ip: %s" % `conn.remote_ip`)
>         if not conn.remote_ip in ("127.0.0.1", ip):
>             self.fail("conn.remote_ip should be '127.0.0.1'")
>         log("    connection.remote_host: %s" % `conn.remote_host`)
>         if conn.remote_host is not None:
>             self.fail("conn.remote_host should be None")
>         log("    connection.remote_logname: %s" % `conn.remote_logname`)
>         if conn.remote_logname is not None:
>             self.fail("conn.remote_logname should be None")
>         log("    connection.aborted: %s" % `conn.aborted`)
>         if conn.aborted != 0:
>             self.fail("conn.aborted should be 0")
>         log("    connection.keepalive: %s" % `conn.keepalive`)
>         if conn.keepalive != 2:
>             self.fail("conn.keepalive should be 2")
>         log("    connection.double_reverse: %s" % `conn.double_reverse`)
>         if conn.double_reverse != 0:
>             self.fail("conn.double_reverse should be 0")
>         log("    connection.keepalives: %s" % `conn.keepalives`)
>         if conn.keepalives != 1:
>             self.fail("conn.keepalives should be 1")
>         log("    connection.local_ip: %s" % `conn.local_ip`)
>         if not conn.local_ip in ("127.0.0.1", ip):
>             self.fail("conn.local_ip should be '127.0.0.1'")
>         log("    connection.local_host: %s" % `conn.local_host`)
>         if conn.local_host is not None:
>             self.fail("conn.local_host should be None")
>         log("    connection.id: %s" % `conn.id`)
>         if conn.id > 100:
>             self.fail("conn.id should not be this high")
>         log("    connection.notes: %s" % `conn.notes`)
>         if `conn.notes` != '{}':
>             self.fail("conn.notes should be {}")






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:32 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register