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

[tor-commits] [stem/master] Fixing test_reattaching_listeners to work with RUN_ALL



commit c482e68ebff140bdde174e15566b6be05f5b5dbd
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Sun Jan 6 14:48:31 2013 -0800

    Fixing test_reattaching_listeners to work with RUN_ALL
    
    Checking the runner's torrc to determine what kind of authentication it's
    using. This way we can skip this part of the test (rather than fail) for the
    RUN_COOKIE and RUN_SCOOKIE targets.
---
 test/integ/control/controller.py |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/test/integ/control/controller.py b/test/integ/control/controller.py
index 36e7f15..3514c23 100644
--- a/test/integ/control/controller.py
+++ b/test/integ/control/controller.py
@@ -171,16 +171,21 @@ class TestController(unittest.TestCase):
       event_notice.clear()
       event_buffer = []
       
-      # reconnect and check that we get events again
+      # Reconnect and check that we get events again. This is being done by
+      # calling AUTHENTICATE manually so skipping cookie auth.
       
-      controller.connect()
-      password = ""
-      if test.runner.CONTROL_PASSWORD:
-        password = " \"%s\"" % test.runner.CONTROL_PASSWORD
-      controller.msg("AUTHENTICATE%s" % password)
+      tor_options = test.runner.get_runner().get_options()
       
-      event_notice.wait(2)
-      self.assertTrue(len(event_buffer) >= 1)
+      if not test.runner.Torrc.COOKIE in tor_options:
+        controller.connect()
+        
+        if test.runner.Torrc.PASSWORD in tor_options:
+          controller.msg('AUTHENTICATE "%s"' % test.runner.CONTROL_PASSWORD)
+        else:
+          controller.msg('AUTHENTICATE')
+        
+        event_notice.wait(2)
+        self.assertTrue(len(event_buffer) >= 1)
   
   def test_getinfo(self):
     """

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