[tor-commits] [stem/master] Respecting custom tor commands for process integ tests

atagar at torproject.org atagar at torproject.org
Mon Jun 25 01:45:02 UTC 2012


commit a5f6006b3e1d072e1cd9524aa57408d707ff3ba0
Author: Damian Johnson <atagar at torproject.org>
Date:   Fri Jun 22 09:27:03 2012 -0700

    Respecting custom tor commands for process integ tests
    
    The process integ tests were attempting to run 'tor', which naturally doesn't
    work if it isn't in your path. Using the command that we're using for our main
    test instance instead since that is sure to work.
---
 test/integ/process.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/test/integ/process.py b/test/integ/process.py
index 2037d93..0573a1c 100644
--- a/test/integ/process.py
+++ b/test/integ/process.py
@@ -28,7 +28,9 @@ class TestProcess(unittest.TestCase):
     # Launch tor without a torrc, but with a control port. Confirms that this
     # works by checking that we're still able to access the new instance.
     
+    runner = test.runner.get_runner()
     tor_process = stem.process.launch_tor_with_config(
+      tor_cmd = runner.get_tor_command(),
       config = {'SocksPort': '2777', 'ControlPort': '2778'},
       completion_percent = 5
     )
@@ -36,7 +38,6 @@ class TestProcess(unittest.TestCase):
     control_socket = None
     try:
       control_socket = stem.socket.ControlPort(control_port = 2778)
-      runner = test.runner.get_runner()
       stem.connection.authenticate(control_socket, chroot_path = runner.get_chroot())
       
       # exercises the socket
@@ -62,8 +63,9 @@ class TestProcess(unittest.TestCase):
     
     if test.runner.only_run_once(self, "test_launch_tor_with_timeout"): return
     
+    runner = test.runner.get_runner()
     start_time = time.time()
-    self.assertRaises(OSError, stem.process.launch_tor_with_config, {'SocksPort': '2777'}, "tor", 100, None, 2)
+    self.assertRaises(OSError, stem.process.launch_tor_with_config, {'SocksPort': '2777'}, runner.get_tor_command(), 100, None, 2)
     runtime = time.time() - start_time
     
     if not (runtime > 2 and runtime < 3):





More information about the tor-commits mailing list