[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [stem/master] Include tor version in initialization information



commit d7eef9b7cf908e343bc28c8c4694f8a6838a2bf6
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Thu Jan 19 11:02:19 2017 -0800

    Include tor version in initialization information
    
    When running integ tests noting tor's version in our initialization information
    (along with stem, python, etc).
---
 run_tests.py | 6 +++++-
 test/util.py | 5 +++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/run_tests.py b/run_tests.py
index 2d31a1b..ca6be67 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -140,7 +140,7 @@ def main():
 
     sys.exit(1)
 
-  pyflakes_task, pycodestyle_task = None, None
+  tor_version_check, pyflakes_task, pycodestyle_task = None, None, None
 
   if not args.specific_test:
     if stem.util.test_tools.is_pyflakes_available():
@@ -149,9 +149,13 @@ def main():
     if stem.util.test_tools.is_pycodestyle_available():
       pycodestyle_task = PYCODESTYLE_TASK
 
+  if args.run_integ:
+    tor_version_check = Task('checking tor version', test.util.check_tor_version, (args.tor_path,))
+
   test.util.run_tasks(
     'INITIALISING',
     Task('checking stem version', test.util.check_stem_version),
+    tor_version_check,
     Task('checking python version', test.util.check_python_version),
     Task('checking pycrypto version', test.util.check_pycrypto_version),
     Task('checking mock version', test.util.check_mock_version),
diff --git a/test/util.py b/test/util.py
index a3348be..d62a080 100644
--- a/test/util.py
+++ b/test/util.py
@@ -20,6 +20,7 @@ Tasks are...
 
   Initialization
   |- check_stem_version - checks our version of stem
+  |- check_tor_version - checks our version of tor
   |- check_python_version - checks our version of python
   |- check_pycrypto_version - checks our version of pycrypto
   |- check_pyflakes_version - checks our version of pyflakes
@@ -204,6 +205,10 @@ def check_stem_version():
   return stem.__version__
 
 
+def check_tor_version(tor_path):
+  return str(stem.version.get_system_tor_version(tor_path)).split()[0]
+
+
 def check_python_version():
   return '.'.join(map(str, sys.version_info[:3]))
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits