Opened 6 years ago

Closed 6 years ago

#8479 closed defect (fixed)

pyobfsproxy tests don't run

Reported by: dcf Owned by: asn
Priority: Medium Milestone:
Component: Archived/Obfsproxy Version:
Severity: Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

This is Python 2.7.3 on Debian. After this output, tester.py seemingly hangs without exiting.

pyobfsproxy$ python obfsproxy/test/tester.py
EProcess Process-2:
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "obfsproxy/test/tester.py", line 135, in work
    listener.bind(address)
  File "/usr/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 98] Address already in use
EProcess Process-3:
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "obfsproxy/test/tester.py", line 135, in work
    listener.bind(address)
  File "/usr/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 98] Address already in use
EProcess Process-4:
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "obfsproxy/test/tester.py", line 135, in work
    listener.bind(address)
  File "/usr/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 98] Address already in use
EProcess Process-5:
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "obfsproxy/test/tester.py", line 135, in work
    listener.bind(address)
  File "/usr/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 98] Address already in use
E
======================================================================
ERROR: test_direct_transfer (__main__.DirectB64)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "obfsproxy/test/tester.py", line 191, in setUp
    self.input_chan = connect_with_retry(("127.0.0.1", ENTRY_PORT))
  File "obfsproxy/test/tester.py", line 114, in connect_with_retry
    return socket.create_connection(addr)
  File "/usr/lib/python2.7/socket.py", line 571, in create_connection
    raise err
error: [Errno 111] Connection refused

======================================================================
ERROR: test_direct_transfer (__main__.DirectDummy)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "obfsproxy/test/tester.py", line 191, in setUp
    self.input_chan = connect_with_retry(("127.0.0.1", ENTRY_PORT))
  File "obfsproxy/test/tester.py", line 114, in connect_with_retry
    return socket.create_connection(addr)
  File "/usr/lib/python2.7/socket.py", line 571, in create_connection
    raise err
error: [Errno 111] Connection refused

======================================================================
ERROR: test_direct_transfer (__main__.DirectObfs2)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "obfsproxy/test/tester.py", line 191, in setUp
    self.input_chan = connect_with_retry(("127.0.0.1", ENTRY_PORT))
  File "obfsproxy/test/tester.py", line 114, in connect_with_retry
    return socket.create_connection(addr)
  File "/usr/lib/python2.7/socket.py", line 571, in create_connection
    raise err
error: [Errno 111] Connection refused

======================================================================
ERROR: test_direct_transfer (__main__.DirectObfs2_ss)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "obfsproxy/test/tester.py", line 191, in setUp
    self.input_chan = connect_with_retry(("127.0.0.1", ENTRY_PORT))
  File "obfsproxy/test/tester.py", line 114, in connect_with_retry
    return socket.create_connection(addr)
  File "/usr/lib/python2.7/socket.py", line 571, in create_connection
    raise err
error: [Errno 111] Connection refused

======================================================================
ERROR: test_direct_transfer (__main__.DirectObfs3)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "obfsproxy/test/tester.py", line 191, in setUp
    self.input_chan = connect_with_retry(("127.0.0.1", ENTRY_PORT))
  File "obfsproxy/test/tester.py", line 114, in connect_with_retry
    return socket.create_connection(addr)
  File "/usr/lib/python2.7/socket.py", line 571, in create_connection
    raise err
error: [Errno 111] Connection refused

----------------------------------------------------------------------
Ran 5 tests in 5.563s

FAILED (errors=5)

Child Tickets

Change History (3)

comment:1 Changed 6 years ago by asn

Hm, one of the big problems with the pyobfsproxy integration tests is that when they fail, they fail in a very non-informative way, as you may have noticed.

Sorry for making you debug it this way, but the first thing I do when I see the integration tests fail, is check whether I can run pyobfsproxy at all. Usually the problem is an ImportError or something similar. Can you try running ./bin/pyobfsproxy and see if you get the usage?

comment:2 Changed 6 years ago by asn

FWIW, fixing the integration tests and making them fail nicely is in my TODO list.

comment:3 Changed 6 years ago by dcf

Resolution: fixed
Status: newclosed

It was my fault, I hadn't installed pyptlib.

ImportError: No module named pyptlib.util

Now it runs for me.

.....
----------------------------------------------------------------------
Ran 5 tests in 12.145s

OK
Note: See TracTickets for help on using tickets.