aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-11-11 15:22:08 -0500
committerNick Mathewson <nickm@torproject.org>2013-11-11 15:22:08 -0500
commit4aa9affec2eac0a95ba026e380718b032451a0af (patch)
tree7bba94f653e7de7a76ce7a0bd69a566f1766b722
parentff08b9b231d5b6625587865584843134bf1a4d67 (diff)
downloadtor-4aa9affec2eac0a95ba026e380718b032451a0af.tar
tor-4aa9affec2eac0a95ba026e380718b032451a0af.tar.gz
Fix test_cmdline_args to work with old openssl
If openssl was old, Tor would add a warning about its version in between saying "no torrc found, using reasonable defaults" and "configuration was valid".
-rwxr-xr-xsrc/test/test_cmdline_args.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/test/test_cmdline_args.py b/src/test/test_cmdline_args.py
index e8edaa026..6d9cf44db 100755
--- a/src/test/test_cmdline_args.py
+++ b/src/test/test_cmdline_args.py
@@ -64,6 +64,12 @@ def randstring(entropy_bytes):
s = os.urandom(entropy_bytes)
return binascii.b2a_hex(s)
+def findLineContaining(lines, s):
+ for ln in lines:
+ if s in ln:
+ return True
+ return False
+
class CmdlineTests(unittest.TestCase):
def test_version(self):
@@ -260,7 +266,7 @@ class CmdlineTests(unittest.TestCase):
out = run_tor(["-f", fname, "--verify-config", "--ignore-missing-torrc"])
ln = [ strip_log_junk(l) for l in lines(out) ]
- self.assert_(", using reasonable defaults" in ln[-2])
+ self.assert_(findLineContaining(ln, ", using reasonable defaults"))
self.assert_("Configuration was valid" in ln[-1])
if __name__ == '__main__':