run_tests.py fails when no system tor is installed
run_tests.py
seems to once again be failing when there's no system tor installed. Installing a system tor binary causes the test to succeed. This might be a regression of #22366 (closed), but it seems that this time, running the run_tests.py
from the top of the stem source tree instead of make test-stem
from the top of the tor source tree also fails.
Again, I think this is a serious problem because attempting to run the system tor without intending to can cause the wrong tor binary to run, which can cause misleading test results. (Also we should support running stem without a tor binary being installed in the default path.)
Also, I confirmed that env -i
doesn't reproduce this problem, possibly because of special cases that execute in the absence of a PATH
variable. You have to delete or rename the system tor binary (or possibly otherwise remove it from the path).
I haven't had time to bisect this yet.
======================================================================
ERROR: test_no_orphaned_process
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/tlyu/src/stem/test/require.py", line 58, in wrapped
return func(self, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 1305, in patched
return func(*args, **keywargs)
File "/home/tlyu/src/stem/test/integ/process.py", line 276, in test_no_orphaned_process
stem.process.launch_tor()
File "/home/tlyu/src/stem/stem/process.py", line 98, in launch_tor
raise OSError("'%s' isn't available on your system. Maybe it's not in your PATH?" % tor_cmd)
OSError: 'tor' isn't available on your system. Maybe it's not in your PATH?
----------------------------------------------------------------------
Ran 22 tests in 0.004s
FAILED (errors=1)
Shutting down tor... done
Style checks require pycodestyle version 1.4.2 or later. Please install it from...
http://pypi.python.org/pypi/pycodestyle
TESTING FAILED (36 seconds)
[RUN_NONE] test_no_orphaned_process (test.integ.process.TestProcess) ... ERROR
[RUN_OPEN] test_no_orphaned_process (test.integ.process.TestProcess) ... ERROR
[RUN_PASSWORD] test_no_orphaned_process (test.integ.process.TestProcess) ... ERROR
[RUN_COOKIE] test_no_orphaned_process (test.integ.process.TestProcess) ... ERROR
[RUN_MULTIPLE] test_no_orphaned_process (test.integ.process.TestProcess) ... ERROR
[RUN_SOCKET] test_no_orphaned_process (test.integ.process.TestProcess) ... ERROR
[RUN_SCOOKIE] test_no_orphaned_process (test.integ.process.TestProcess) ... ERROR
[RUN_PTRACE] test_no_orphaned_process (test.integ.process.TestProcess) ... ERROR
You can re-run just these tests with:
./run_tests.py --tor ../tor/src/or/tor --all --log notice --target RUN_ALL --test test.integ.process