[tor-commits] [stem/master] Testing with relative tor paths failed with RELATIVE target

atagar at torproject.org atagar at torproject.org
Wed May 24 20:06:17 UTC 2017


commit 0d6212ed5f650f2364ac27dda88363b0de0265af
Author: Damian Johnson <atagar at torproject.org>
Date:   Wed May 24 13:05:37 2017 -0700

    Testing with relative tor paths failed with RELATIVE target
    
    When running with the RELATIVE target we shift our cwd causing relative paths
    to fail. Resolving them to absolute paths before that. Good thing to do anyway
    so our logs say what we're actually running.
    
    Another issue caught by catalyst...
    
      https://trac.torproject.org/projects/tor/ticket/22366
---
 test/runner.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/runner.py b/test/runner.py
index 5686b4c..bbaa4aa 100644
--- a/test/runner.py
+++ b/test/runner.py
@@ -197,6 +197,7 @@ class Runner(object):
         self._test_dir = tempfile.mktemp('-stem-integ')
 
       original_cwd, data_dir_path = os.getcwd(), self._test_dir
+      self._tor_cmd = os.path.abspath(tor_cmd)
 
       if test.Target.RELATIVE in self.attribute_targets:
         tor_cwd = os.path.dirname(self._test_dir)
@@ -207,7 +208,6 @@ class Runner(object):
         os.chdir(tor_cwd)
         data_dir_path = './%s' % os.path.basename(self._test_dir)
 
-      self._tor_cmd = tor_cmd
       self._custom_opts = extra_torrc_opts
       self._torrc_contents = BASE_TORRC % (data_dir_path, data_dir_path)
 
@@ -217,7 +217,7 @@ class Runner(object):
       try:
         self._tor_cwd = os.getcwd()
         self._run_setup()
-        self._start_tor(tor_cmd)
+        self._start_tor(self._tor_cmd)
 
         # strip the testing directory from recv_message responses if we're
         # simulating a chroot setup



More information about the tor-commits mailing list