[tor-commits] [stem/master] Fix couple online integ tests

atagar at torproject.org atagar at torproject.org
Mon Feb 22 17:09:55 UTC 2016


commit a0fb3167b9a76f754a8d8293b58239197544c91a
Author: Damian Johnson <atagar at torproject.org>
Date:   Mon Feb 22 09:11:00 2016 -0800

    Fix couple online integ tests
    
    We don't run tests requiring our ONLINE target by default so they get a little less love. Fixing the following couple...
    
      ======================================================================
      FAIL: test_authorities_are_up_to_date
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/home/atagar/Desktop/stem/test/runner.py", line 161, in wrapped
          return func(self, *args, **kwargs)
        File "/home/atagar/Desktop/stem/test/runner.py", line 178, in wrapped
          return func(self, *args, **kwargs)
        File "/home/atagar/Desktop/stem/test/integ/descriptor/remote.py", line 38, in test_authorities_are_up_to_date
          self.fail("%s isn't a recognized directory authority in stem" % auth.nickname)
      AssertionError: dannenberg-legacy isn't a recognized directory authority in stem
    
      ----------------------------------------------------------------------
    
      ======================================================================
      FAIL: test_attributes
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/home/atagar/Desktop/stem/test/integ/manual.py", line 198, in test_attributes
          assert_equal('commandline options', EXPECTED_CLI_OPTIONS, set(manual.commandline_options.keys()))
        File "/home/atagar/Desktop/stem/test/integ/manual.py", line 190, in assert_equal
          self.fail("Changed tor's man page? The %s changed as follows...\n\nexpected: %s\n\nactual: %s" % (category, expected, actual))
      AssertionError: Changed tor's man page? The commandline options changed as follows...
    
      expected: set(['-f FILE', '--ignore-missing-torrc', '--list-fingerprint', '--defaults-torrc FILE', '--allow-missing-torrc', '--nt-service', '--verify-config', '--service remove|start|stop', '--quiet|--hush', '--list-torrc-options', '--service install [--options command-line options]', '--version', '--hash-password PASSWORD', '-h, -help'])
    
      actual: set([u'-f FILE', u'--hash-password PASSWORD', u'--ignore-missing-torrc', u'--list-fingerprint', u'--defaults-torrc FILE', u'--allow-missing-torrc', u'--nt-service', u'--verify-config', u'--service remove|start|stop', u'--keygen [--newpass]', u'--list-torrc-options', u'--service install [--options command-line options]', u'--quiet|--hush', u'--version', u'-h, -help'])
    
    I'm still getting a couple other failures but one is from #17913 and the rest
    are spurious.
---
 test/integ/control/controller.py | 2 +-
 test/integ/descriptor/remote.py  | 3 +++
 test/integ/manual.py             | 2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/test/integ/control/controller.py b/test/integ/control/controller.py
index a755540..7f9edd3 100644
--- a/test/integ/control/controller.py
+++ b/test/integ/control/controller.py
@@ -1106,7 +1106,7 @@ class TestController(unittest.TestCase):
       # The response data for our request for request should be an IP address + '\n'
 
       ip_addr = response[response.find(b'\r\n\r\n'):].strip()
-      self.assertTrue(stem.util.connection.is_valid_ipv4_address(stem.util.str_tools._to_unicode(ip_addr)))
+      self.assertTrue(stem.util.connection.is_valid_ipv4_address(stem.util.str_tools._to_unicode(ip_addr)), "'%s' isn't an address" % ip_addr)
 
   @require_controller
   @require_online
diff --git a/test/integ/descriptor/remote.py b/test/integ/descriptor/remote.py
index 9ce9b8f..a73bb0e 100644
--- a/test/integ/descriptor/remote.py
+++ b/test/integ/descriptor/remote.py
@@ -32,6 +32,9 @@ class TestDescriptorDownloader(unittest.TestCase):
     consensus = downloader.get_consensus(document_handler = stem.descriptor.DocumentHandler.BARE_DOCUMENT).run()[0]
 
     for auth in consensus.directory_authorities:
+      if auth.nickname == 'dannenberg-legacy':
+        continue  # skip due to https://trac.torproject.org/projects/tor/ticket/17906
+
       stem_auth = stem.descriptor.remote.get_authorities().get(auth.nickname)
 
       if not stem_auth:
diff --git a/test/integ/manual.py b/test/integ/manual.py
index fc679bb..d20c407 100644
--- a/test/integ/manual.py
+++ b/test/integ/manual.py
@@ -34,7 +34,7 @@ EXPECTED_CATEGORIES = set([
   'AUTHORS',
 ])
 
-EXPECTED_CLI_OPTIONS = set(['-h, -help', '-f FILE', '--allow-missing-torrc', '--defaults-torrc FILE', '--ignore-missing-torrc', '--hash-password PASSWORD', '--list-fingerprint', '--verify-config', '--service install [--options command-line options]', '--service remove|start|stop', '--nt-service', '--list-torrc-options', '--version', '--quiet|--hush'])
+EXPECTED_CLI_OPTIONS = set(['-h, -help', '-f FILE', '--allow-missing-torrc', '--defaults-torrc FILE', '--ignore-missing-torrc', '--hash-password PASSWORD', '--list-fingerprint', '--verify-config', '--service install [--options command-line options]', '--service remove|start|stop', '--nt-service', '--keygen [--newpass]', '--list-torrc-options', '--version', '--quiet|--hush'])
 EXPECTED_SIGNALS = set(['SIGTERM', 'SIGINT', 'SIGHUP', 'SIGUSR1', 'SIGUSR2', 'SIGCHLD', 'SIGPIPE', 'SIGXFSZ'])
 
 EXPECTED_DESCRIPTION = """



More information about the tor-commits mailing list