nikademus79 / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

test_get_connections_all failure on OS X r1054 #176

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Error in test case test_get_connections_all() on OS X r1054 

===================================================
ERROR: test_get_connections_all (__main__.TestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_psutil.py", line 145, in inner
    return fun(self, *args, **kwargs)
  File "test/test_psutil.py", line 1034, in test_get_connections_all
    s.bind((conn.local_address[0], 0))
  File "<string>", line 1, in bind
error: [Errno 49] Can't assign requested address

----------------------------------------------------------------------

Printing the address and conn type when this exception occurs shows: 

conn.local_address[0] is 192.168.101.129 and conn.type is 1

I'm not sure what this means or what the bind to the local address is supposed 
to be testing in the first place.

Original issue reported on code.google.com by jlo...@gmail.com on 28 Jun 2011 at 3:46

GoogleCodeExporter commented 8 years ago
conn.type == 1 stands for TCP.
The test makes sure that all the local addresses returned by psutil can be used 
to create a listening socket.

s.bind((conn.local_address[0], 0))

0, here, means, "bind on any port".
I don't know why the test fails. Is 192.168.101.129 associated with a valid 
network interface? 
What happens if you manually do:

>>> import socket
>>> socket.socket().bind(("192.168.101.129", 0))

...?

Original comment by g.rodola on 28 Jun 2011 at 7:48

GoogleCodeExporter commented 8 years ago
Is this still failing?

Original comment by g.rodola on 22 Oct 2011 at 11:41

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Updated csets after the SVN -> Mercurial migration:
r1054 == revision 2985d46279e0

Original comment by g.rodola on 2 Mar 2013 at 12:01